Advertisement
keselyoleren

Untitled

Jan 10th, 2025
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. from scipy.stats import norm
  2.  
  3. # Data yang diberikan
  4. mean = 151
  5. std_dev = 15
  6.  
  7. # (a) Mahasiswa dengan berat antara 120 lb dan 155 lb
  8. z_120 = (120 - mean) / std_dev
  9. z_155 = (155 - mean) / std_dev
  10.  
  11. # Probabilitas kumulatif untuk rentang 120 lb - 155 lb
  12. p_120_155 = norm.cdf(z_155) - norm.cdf(z_120)
  13.  
  14. # (b) Mahasiswa dengan berat lebih dari 185 lb
  15. z_185 = (185 - mean) / std_dev
  16.  
  17. # Probabilitas kumulatif untuk lebih dari 185 lb
  18. p_more_than_185 = 1 - norm.cdf(z_185)
  19.  
  20. # Menghitung jumlah mahasiswa berdasarkan probabilitas
  21. total_students = 500
  22. students_120_155 = p_120_155 * total_students
  23. students_more_than_185 = p_more_than_185 * total_students
  24.  
  25. students_120_155, students_more_than_185
  26.  
  27. # hasil === (292.87715122357815, 5.8526490402791564)
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement