views:

416

answers:

3

I'm trying to put together an app for fun that has a scenario where I need to figure out a probability equation for the following scenario:

Suppose I have a number of attempts at something and each attempt has a success rate (known ahead of time). What are the odds after doing all those attempts that a success happens?

For example there are three attempts (all will be taken individually).

The first is known to have a 60% success rate. The second is known to have a 30% success rate. The third is known to have a 75% success rate. What are the odds of a success occurring if all three attempts are made?

I've tried several formulas and can't pinpoint the correct one.

Thanks for the help!

+5  A: 

1 - .4 * .7 * .25

That is, find the probability that all attempts fail, and invert it. So in general, given a finite sequence of events with probabilities P[i], the probability that at least one event is successful is 1 - (1 - P[0]) * (1 - P[1]) * ... * (1 - P[n])

And here's a perl one-liner to compute the value: (input is white-space separated list of success rates)

 perl -0777 -ane '$p=1; $p*=1-$_ foreach @F; print 1-$p . "\n"'
William Pursell
This is one of the equations I thought worked until I tried to add a success chance of 2%.So take my example and replace the 60% with a 2% rate. You'd expect it to go DOWN but instead the chance of success using this formula is 99.85% (1-.3*.02*.25).This is what threw me for a loop.
byanity
@byanity: you've got it backwards. If you want a 2% success rate, you'd add a 0.98 term to that equation, since we're calculating based on the chance of failure.
rmeador
(- 1 (* 0.98 0.7 0.25)) => 82.85% <br>(- 1 (* 0.4 0.7 0.25)) => 93.0%
Svante
+2  A: 

Compute the chance of "all failures" (product of all the 1-pj where pj is the jth chance of success -- probability computations that represent probabilities as anything but numbers between 0 and 1 are crazy, so if you absolutely need percentages instead as input or output do your transformations at the start or end!) and the probability of "at least 1 success" is 1 minus that product.

Edit: here's some executable pseudocode -- i.e., Python -- with percentages as input and output, using your numbers (the original ones and the ones you changed in a comment):

$ cat proba.py
def totprob(*percents):
  totprob_failure = 1.0
  for pc in percents:
    prob_this_failure = 1.0 - pc/100.0
    totprob_failure *= prob_this_failure
  return 100.0 * (1.0 - totprob_failure)
$ python -c'import proba; print proba.totprob(60,30,75)'
93.0
$ python -c'import proba; print proba.totprob(2,30,75)'
82.85
$
Alex Martelli
+9  A: 

Probability of winning is probability of not losing all three: 1 - (1 - 0.6)(1 - 0.3)(1 - 0.75)

JustJeff