25. All of n Independent Events

Easy

For independent events the intersection is just the product:

P(i=1nAi)=i=1nP(Ai)P\left(\bigcap_{i=1}^{n} A_i\right) = \prod_{i=1}^{n} P(A_i)

Return the probability that all of them happen.

solve([0.5, 0.5])       ->  0.25
solve([0.9, 0.9, 0.9])  ->  0.7290000000000001

Sign in to write and run your own code.

Implement solve(...)