Probability of Multiple Events In A Row

If the probability of success for a single event (such as a dice roll) is p, and you need to roll n successes in a row to win the game, then the probability of doing so if you only roll n times is p^n.

But what if you roll more than n times? For a number of rolls N > n, how can you calculate the probability of winning? Alternatively, if you want a specific probability of winning (say, 95%), how can you calculate the number of rolls required to get this probability?

A major assumption is of course, as with dice, that each event is independent of the previous or following events.

The probability of the event is p. As you point out, for n events, the probability of all being the desired result of probability p is p^n.

The usual way to evaluate a complex probability is to enumerate all possibilites and their odds, and add up the different probabilities… I.e. in craps, the odds I’ll 6 or less is odds throw a 2 plus the odds I’ll throw a 3, plus…

So let’s say we have n results in m tries. The odds that we’ll have n results p followed by n results not-p is (p^n) * ((1-p)^(m-n)). The odds of throwing p n-1 times, followed by m-n of not-p and then 1 of p is the same number.

So really, it’s the odds times the number of combinations of p and not-p we can make up…
i.e. 2 P and 2 anti-P (call it “A”)

The simple formula for permutations is m!/(n!(m-n)!) where ! is factorial.
In our example, this is 4!/2!2! or 24/2*2=6.
So the result is (P^n)(A^m-n) m!/(n!(m-n)!) if I can still do math.

For lotto 6/49 for example, pick any 6 numbers from 49, every number equally likely - it’s (49!)/(6!)(43!) which IIRC works out to odds of 13.9 Million to 1.
Which is logical, because it is 4948474645*44/6! Or pick any number of the 49 then any from the remaining 48, etc. Then divide by all possible permutations of that result (6!), because a result where we picked, say, 1,7, 10 is the same winning ticket as 7,10,1… and 1, 10, 7…

For n or greater p in m, you need to sum:

SUM (i=n to i=m; (P^i)(A^m-i) m!/(i!(m-i)!)

Of course, math was never my strong suite and I probably missed something here…

If by “win” you mean getting n successes out of N trials, then you should read up on the binomial distribution. The key assumptions are that p stays the same for each trial and that the trials are independent. Usually the probabilities can be found in a table, so no complicated calculations are required.

If you just need to get a certain number of successes, this is what you want.

The probability of getting X successes out of N trials, where p is the probability of success on each trial, is [sub]N[/sub]C[sub]X[/sub] p[sup]X[/sup] (1–p)sup[/sup].

There are also tables for this sort of thing, and functions built in to graphing calculators and statistics software. See the chapter on “binomial probability” or “the binomial distribution” or “Bernoulli trials” in any basic book on probability and statistics.
If, on the other hand, you need to get a certain number of successes in a row, it becomes more complicated. I don’t know if there’s an easy answer; I’d have to think about that for awhile.

Note that this is the probability of exactly X successes in N trials. AS pointed out previously, to win you could get X, X+1, … N successes out of N trials so you’d want to sum formula from X to N.

You’d probably not actually toss the die again once you’d gotten X successes in fewer than N trials, but this is still the correct formula.

To determine how big an N you need to get a specific probability of winning, just try different N’s until you read the required level. The win probability will be increasing in N so there will be a smallest value that meets your criterion.

One way to figure out the probability of getting n successes in a row, anywhere in N tries, is to keep track of the probabilities that you’ve had m successes in a row for m=0,…,n. You can write down a system of recursion relations for these probabilities, and then solve the system.

This sounds complicated but it’s not actually very hard. For example, take n=3. Let P(m,k) be the probability that the last m tries were successes, after k tries… except that P(n,k) will be the probability that we’ve had n successes somewhere in these k tries (not just in the last n of them). We keep track of the probability for each of four states: P(0,k) (the last try was a failure), P(1,k) (the last try was a success, but the penultimate one was not), P(2,k) (the last two were successful, but the antepenultimate was not), and P(3,k) (we’ve had three in a row somewhere in the last k tries). It’s easy to write down the values for P(m,k+1) in terms of P(m,k):

A straightforward way to solve this is to write it as a matrix update equation:

[ P(0,k+1) ]   [ 1-p  1-p  1-p   0  ]   [ P(0,k) ]
[ P(1,k+1) ] = [  p    0    0    0  ] * [ P(1,k) ]
[ P(2,k+1) ]   [  0    p    0    0  ]   [ P(2,k) ]
[ P(3,k+1) ]   [  0    0    p    1  ]   [ P(3,k) ]

Now just take powers of this matrix to compute the probability of three successes in a row after N tries:

[ P(0,N) ]   [ 1-p  1-p  1-p   0  ]^N   [ 1 ]
[ P(1,N) ] = [  p    0    0    0  ]   * [ 0 ]
[ P(2,N) ]   [  0    p    0    0  ]     [ 0 ]
[ P(3,N) ]   [  0    0    p    1  ]     [ 0 ]

For p=0.5, this gives P(3,3)=0.125 (obvious), P(3,4)=0.1875, … P(3,10)=0.5078, …, P(3,30)=0.9078.

For larger values of n than 3, you just use a larger matrix. Note that all of the recursion formulas except for P(0,k+1) and P(n,k+1) look basically the same, so you just follow the pattern for any desired n.