All problems
Union Probability Independent Events
Problem
For independent events, P(union) = 1 - prod_i (1 - p_i).
Given the event probabilities, return the union probability.
Hint
Complement the probability that none occurs.
Test cases
case 1
in: [[0.1,0.2]]
expected: 0.2799999999999999
case 2
in: [[0.5,0.5]]
expected: 0.75
case 3
in: [[0.9]]
expected: 0.9
Starter codePython
def union_probability_independent_events(probs):
# Your code here
pass3 test cases · run your code against them in the editor