Skip to content
DeepForgeby svx
All problems
EasyProbabilitypr-009

At Least One Success

Problem

Given success probabilities for independent trials, return the probability that at least one trial succeeds.

P(at least one) = 1 - product(1 - p_i). An empty list returns 0.0.

Hint

Work with the complement: all trials fail simultaneously.

Test cases

case 1
in: [[0.5,0.5]]
expected: 0.75
case 2
in: [[0.1,0.2,0.3]]
expected: 0.496
case 3
in: [[]]
expected: 0
case 4
in: [[1,0.5]]
expected: 1
Starter codePython
def at_least_one_independent(probs):
    # Your code here
    pass

4 test cases · run your code against them in the editor