View Single Post
  #4  
Old 08-26-2005, 05:19 AM
BruceZ BruceZ is offline
Senior Member
 
Join Date: Sep 2002
Posts: 1,636
Default Re: Question for BruceZ (or others) regarding streaks

[ QUOTE ]
A while ago you showed how to calculate the odds of getting 3 PP in a row any time during 1000 hands.

I'm interested in calculating the odds of getting X or more PP's in Y hands at any point over the course of Z hands. For example, use 14 as X, 100 as Y, and 1000 as Z. I know using the BINOM function in excel that the probability of getting 14 or more PP's in 100 hands is 0.002182578 or, about 458:1. How do I calculate the odds of this happening at any point over 1000 hands? 10000 hands? Etc.

Thanks.

[/ QUOTE ]

<font color="red">It has been pointed out that this is only an approximation. See the note in red below</font>.

Let f(n,k) be the probability of exactly k pairs in the last 100 hands out of n hands for 0&lt;=k&lt;=13, and let f(n,14) be the probability of 14 or more pairs in any 100 hands out of n hands. You want to find f(1000,14).

Binomdist(k,100,1/17,false) is the probability of exactly k pairs in 100 hands, with the probability of a pair = 1/17. 1 - Binomdist(13,100,1/17,true) is the probability of more than 13 pairs in 100 hands. This is an Excel function.

f(100,k) = binomdist(k,100,1/17,false), for k &lt; 14
f(100,14) = 1 - binomdist(13,100,1/17,true)

for n &gt; 100:

f(n,0) = f(n-1,0)*16/17 + f(n-1,1)*16/17*(1/100)

f(n,k) = f(n-1,k)*[1/17*(k/100) + 16/17*(1-k/100)] +
f(n-1,k-1)*1/17*[1-(k-1)/100] +
f(n-1,k+1)*16/17*(k+1)/100, for 1 &lt;= k &lt;= 12

f(n,13) = f(n-1,13)*[1/17*(13/100) + 16/17*(1-13/100)] +
f(n-1,12)*1/17*(1-12/100)

f(n,14) = f(n-1,14) + f(n-1,13)*1/17*(1-13/100)

f(1000,14) =~ 9.35%


In Excel, this requires computing n rows by k columns, or for this specific example, 901 rows and 15 columns, with the first row representing f(100,k). Think of each row as a 15 dimensional state vector, where states k = 0 to 13 hold the probability of k pairs in the last 100 hands, and state k = 14 accumulates the probability of 14 or more pairs anywhere in the last n hands. Note that there is no exit from state 14, so this accumulates the answer over all n. All of the other states only hold the fraction of pairs in the last 100 hands. If you like, I can email you this spreadsheet.

To understand this method, picture a sliding window 100 hands long that we advance 1 hand at a time. With each advance, we pick up one new hand (hand n), and lose 1 hand from the beginning of the window (hand n-100). The number of pairs in the window does not change if the nth hand is a pair (probability 1/17) and hand n-100 was also a pair (probability k/100), and there is also no change if hand n is not a pair (16/17) and hand n-100 was not a pair (1-k/100). In these cases, we update f(n,k) from f(n-1,k). We update f(n,k) from f(n-1,k-1) when the sliding window gains a pair, that is, when the nth hand is a pair (1/17) and hand n-100 was not a pair which has probability 1-(k-1)/100. We update f(n,k) from f(n-1,k+1) when the sliding window loses a pair, that is, when the nth hand is not a pair (16/17) and hand n-100 was a pair with probability (k+1)/100.

If you were writing a program to do this, the only storage required would be 2 arrays of length 15, where each one gets updated from the other back and forth.

This is a Markov process, and it can also be set up as a matrix. The matrix would be 15x15, with each row having at most 3 entries. The initial state vector would be f(100,k), which are the probabilities after 100 hands. The matrix would be multiplied by this vector 900 times, or the matrix could be raised to the 900th power, and the resultant matrix would then be multiplied by the vector one time.

<font color="red">It is assumed in the above that when k pairs appear in the window of length 100, that the probability that the first hand in the window is a pair is k/100. This would be true if we considered all hand sequences with k pairs in this window; however, we are only considering the hand sequences which do not have 14 or more pairs in any preceding window of length 100. This condition would sometimes change this probability, though perhaps only slightly.</font>
Reply With Quote