Premium problem26. At Least One Success

Medium Locked

"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)=1−∏i=1n(1−P(Ai))P(\text{at least one}) = 1 - \prod_{i=1}^{n}\bigl(1 - P(A_i)\bigr)

Return that probability.

Input

[0.5, 0.5]

Output

0.75

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)