26. At Least One Success

Medium

"At least one" is far easier through the complement: the only way to get none is for every event to fail.

P(at least one)=1i=1n(1P(Ai))P(\text{at least one}) = 1 - \prod_{i=1}^{n}\bigl(1 - P(A_i)\bigr)

Return that probability.

solve([0.5, 0.5])        ->  0.75
solve([0.1, 0.1, 0.1])   ->  0.2710000000000001

Sign in to write and run your own code.

Implement solve(...)