Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from scipy.stats import norm
- # Data yang diberikan
- mean = 151
- std_dev = 15
- # (a) Mahasiswa dengan berat antara 120 lb dan 155 lb
- z_120 = (120 - mean) / std_dev
- z_155 = (155 - mean) / std_dev
- # Probabilitas kumulatif untuk rentang 120 lb - 155 lb
- p_120_155 = norm.cdf(z_155) - norm.cdf(z_120)
- # (b) Mahasiswa dengan berat lebih dari 185 lb
- z_185 = (185 - mean) / std_dev
- # Probabilitas kumulatif untuk lebih dari 185 lb
- p_more_than_185 = 1 - norm.cdf(z_185)
- # Menghitung jumlah mahasiswa berdasarkan probabilitas
- total_students = 500
- students_120_155 = p_120_155 * total_students
- students_more_than_185 = p_more_than_185 * total_students
- students_120_155, students_more_than_185
- # hasil === (292.87715122357815, 5.8526490402791564)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement