• + 0 comments
    from math import comb
    n = 10
    p = 0.12
    print(round(sum(comb(n, i) * (p**i) * ((1 - p)**(n - i)) for i in range(3)),3))
    print(round(1 - sum(comb(n, i) * (p**i) * ((1 - p)**(n - i)) for i in range(0, 2)),3))