You are viewing a single comment's thread. Return to all comments →
import math ratio_boy = 1.09 ratio_girl = 1 p_boy = ratio_boy / (ratio_boy + ratio_girl) k = 3 n = 6 result = 0 for i in range(3, 7): comb = math.factorial(n) / (math.factorial(i) * math.factorial(n-i)) result += comb * pow(p_boy, i) * pow(1 - p_boy, n - i) print(round(result, 3))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 4: Binomial Distribution I
You are viewing a single comment's thread. Return to all comments →