You are viewing a single comment's thread. Return to all comments →
import math
binomial = lambda x,n,q,p : math.comb(n, x)*(p**x)(q*(n - x))
rb = 1.09 rg = 1
p = rb/(rb + rg) q = 1 - p
n = 6
P = [binomial(x, n, q, p) for x in range(3,7)]
print(round(sum(P),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 →
import math
binomial = lambda x,n,q,p : math.comb(n, x)*(p**x)(q*(n - x))
rb = 1.09 rg = 1
p = rb/(rb + rg) q = 1 - p
n = 6
P = [binomial(x, n, q, p) for x in range(3,7)]
print(round(sum(P),3))