ThatDonGuy
Joined: Jun 22, 2011
• Posts: 5413
December 2nd, 2014 at 8:31:08 AM permalink
Quote: mustangsally

I noticed that, if P(n) is the probability of not getting two (or more) wins in a row over n trials with individual win probability = p:
P(1) = 1
P(2) = 1 - p2
P(n) = (1-p) P(n-1) + p(1-p) P(n-2), since if the first trial is a loss, the probability is the same as for n-1 trials, and if the first trial is a win, the second needs to be a loss, at which point the probability is the same as for n-2 trials

I tried deducing a recursive formula, but I noticed some strange patterns:
the p0 term = 1
the p1 term = 0
the p2 term = 1 - n
the p3 term = n - 2
the p4 term = (n - 4) (n - 3) / 2
the p5 term = - (n - 4)2

I did a matrix-based recursive solution, and got:

P(n) = ( (1 - p2) (Jn-1 - Kn-1) + JK (Jn-2 + Kn-2) ) / (J + K)
where J = sqrt(1 + 2p - 3p2) / 2 + (1 - p) / 2
and K = sqrt(1 + 2p - 3p2) / 2 - (1 - p) / 2

For n = 12 and p = 244/495, this returns 0.0987983465, so it "looks accurate".

Just don't ask about runs without streaks of 3 or more, as the mathematics becomes more and more complicated when doing it this way.
For example, for runs without streaks of 5:
P(n) = (1-p) P(n-1) + p (1-p) P(n-2) + p2 (1-p) P(n-3) + p3 (1-p) P(n-4) + p4 (1-p) P(n-5)
The only way I know to solve this requires calculating the eigenvalues for a 5 x 5 matrix, which I think results in solving a quintic equation (which has been proven not to have a general solution).
mustangsally
Joined: Mar 29, 2011
• Posts: 2463
December 2nd, 2014 at 12:08:57 PM permalink
Quote: ThatDonGuy

The only way I know to solve this requires calculating the eigenvalues for a 5 x 5 matrix, which I think results in solving a quintic equation (which has been proven not to have a general solution).

Looks to me you have fun doing lots of math and that is so cool

Here is a fast video I just did
on how I would do the run of 5 in Excel

has no sound or music
should slow it down to see cell entries if one wants
and full size if you wear glasses as I do at the computer

Sally

I currently love the MonaLisa Twins

and If you have come this far
the Excel workbook is in my onedrive folder
link to it in me blog
file name: excel-markov-chain-easy-stuff-streaks.xlsb

here is a video on how to expand a sheet to do another run size.
I went from 7 to 8
wow, I only started with 5 and now have 2 thru 8, with colors
imagine