You are viewing a single comment's thread. Return to all comments →
b, g = map(float, input().split(' ')) p= b/(b+g) def func(n): if n == 1 or n==0: return 1 else: return n * func(n-1) def Binomial_Distribution(r, n, p): return func(n)/(func(r)*func(n-r))*(p**r)*((1-p)**(n-r)) res = 0.0 for i in range(3, 7): res+= Binomial_Distribution(i, 6, p) print(round(res, 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 →