You are viewing a single comment's thread. Return to all comments →
import math
x, y = map(int,input().split()) p = x/100 q = 1-p
no_more_than_two = []
for i in range(3): val = math.comb(y,i)p*(i)q*(y-i) no_more_than_two.append(val) print(round(sum(no_more_than_two),3))
at_least_two = []
for i in range(2, y+1): val = math.comb(y,i)p*(i)q*(y-i) at_least_two.append(val) print(round(sum(at_least_two),3))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 4: Binomial Distribution II
You are viewing a single comment's thread. Return to all comments →
import math
x, y = map(int,input().split()) p = x/100 q = 1-p
no_more_than_two = []
for i in range(3): val = math.comb(y,i)p*(i)q*(y-i) no_more_than_two.append(val) print(round(sum(no_more_than_two),3))
at_least_two = []
for i in range(2, y+1): val = math.comb(y,i)p*(i)q*(y-i) at_least_two.append(val) print(round(sum(at_least_two),3))