Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import math
  2.  
  3. print("Calculating confidence of 95%")
  4. avg = float(input("Enter average of the data:"))
  5. n = int(input("Enter number of items:"))
  6. sd = float(input("Enter standard devation:"))
  7. z = 1.96
  8.  
  9. conf_high = avg + z * (sd/math.sqrt(n))
  10. conf_low = avg - z * (sd/math.sqrt(n))
  11.  
  12. print("Confidence high: {}".format(conf_high))
  13. print("Confidence low: {}".format(conf_low))
  14. print("With 95 percent confidence we have determined that the\nmean of the data is between\n{} and {}".format(conf_low, conf_high))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement