Advertisement
jig487

Untitled

Apr 18th, 2022
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. local function txt(x,y,t)
  2. term.clear()
  3. term.setCursorPos(x,y)
  4. write(t)
  5. end
  6.  
  7. txt(1,1,"X: ")
  8. local x=read()
  9.  
  10. txt(1,1,"Mean: ")
  11. local u=read()
  12.  
  13. txt(1,1,"Standard Deviation: ")
  14. local sDev =read()
  15.  
  16. local pi = math.pi
  17. local e = 2.718281828
  18.  
  19. local result = ((1)/(sDev*math.sqrt(2*pi)*e))^(-0.5*(((x-u)/sDev)^2))
  20.  
  21. txt(1,1,"val: "..result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement