Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > General Gambling > Probability
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-28-2005, 12:58 PM
alThor alThor is offline
Junior Member
 
Join Date: Mar 2004
Posts: 6
Default Re: Exact answer 11.7327% ? (edited)

[ QUOTE ]
Look at the 1000 hands as 900 overlapping windows of width 100.

[/ QUOTE ]

I found no mistake in your formulas, but wouldn't use want to use 901 windows?

OTOH, I am confused by some entries in your sim post. Cell E1 should be =D1; the other 900 (or 899?) cells Ei should max cells Di and E(i-1). Is that what you actually did? Perhaps this explains the discrepancy.

alThor
Reply With Quote
  #2  
Old 08-28-2005, 02:41 PM
irchans irchans is offline
Senior Member
 
Join Date: Sep 2002
Posts: 157
Default Theory: 11.7447%, Excel Simulation: 10.4%, Mathematica Sim 11.3%

I agree, there are 901 windows. That changes the theoretical answer to 11.7447%.

For the Excel simulation, I agree that cell E1 should be =D1. In the other E cells I had max of cells D(i-1) and E(i-1) which I think works as well as your formula.

I reran the Excel simulation with your corrections. Among the 200,000 virtual deals there were 20,789 deals that had 14 pairs or more in a window. That simulation gives a 10.4% estimate of the probability. I wrote a simulator in Mathematica and got 22,545 deals with 14 pairs or more. That's 11.3%. Given the size of the simulations, either there is a bug one of the simulation programs and the theoretical derivation, or these random generators are not good enough. Hmm.
Reply With Quote
  #3  
Old 08-29-2005, 12:42 AM
DougOzzzz DougOzzzz is offline
Senior Member
 
Join Date: Dec 2004
Posts: 132
Default Re: Exact answer 11.7327% ? (edited)

I haven't tried to understand your post yet explaining your method for solving the problem

I can speak for Excel's RNG being crappy though. There are some very obvious patterns if you analyze a large sequence of randomly generated numbers. I almost always get incorrect answers when I write simulations in Excel even with millions of trials.

Still, it seems a bit strange that BruceZ's method could be so far off. I understood his method, and it makes sense. The flaw in the method also makes sense, and logically I concluded that the error would cause the odds to increase.

However the difference still seems large. I'll try to understand your method at a later time. I don't have as much mathematical training as most of you here so sometimes it's difficult for me to translate these formulas into something that makes sense to me.

I do appreciate the effort that everyone put into answering my question, though.
Reply With Quote
  #4  
Old 09-14-2005, 08:08 PM
BruceZ BruceZ is offline
Senior Member
 
Join Date: Sep 2002
Posts: 1,636
Default Re: Exact answer 11.7327% ? (edited)

I have PMed irchans about this, and he agrees with my objections.

This method has a problem similar to the one in my solution.


[ QUOTE ]

The Probability p[n] that the nth window will have exactly 14 hands is 0.0014279740790007608. Let g[n] be the probability that the nth window has exactly 14 hands and that no previous window had 14 hands. Let r[n,i] be the probability that the nth window will have exactly 14 hands given that the ith window had exactly 14 hands. Note that r[n,i] = r[n-i] because it only depends on the difference between n and i. Then

p[n] = Sum[ g[j] * r[n-j] , {j, 1, n}].

[/ QUOTE ]

For this formula to be correct, r[n,i] must be the probability that the nth window will have exactly 14 hands given that the ith window had exactly 14 hands, and given that no window previous to i had 14 hands. This latter condition will change the probability.

Further, it is not true that r[n,i] only depends only on n-i, because when the windows overlap, small values for the starting position of the first window i place different constraints on the window starting at n than larger values of i, since there would be more potential windows with 14 pairs that could start before a large value of i, and the hands in the window starting at n would be constrained to preclude this.


[ QUOTE ]
Now we just need the sequence r[n] to compute g[n]. If n<100, r[n] is the sum over k=0,...,14 of the probability that the first n hands of a window has k pairs times the probability that the next n hands after the window have k pairs. (If n>=100, r[n] = 0.0014279740790007608.)

Code:


r[n] = Sum[ C[n, i]
*(1/17^i)*(16/17)^(n - i) * prfirst[n, i],
{i, 0, Min[n, 14]}]



The probability that the first n hands of a 100 hand window have i pairs is

Code:


prfirst[i, j] = If[ j < 14 - (100 - i),
0,
C[i, j]*C[100 - i, 14 - j] / C[100, 14]]

[/ QUOTE ]

Because of the conditional issue discussed above, all C[100,14] do not have the same probability when the window starting at n overlaps with the first window. In this case, arrangements which put more pairs at lower values of n would be less likely, since these arrangements are constrained to preclude a window of 14 starting before the first window. The C[i, j]*C[100 - i, 14 - j] would be similarly constrained.
Reply With Quote
  #5  
Old 08-27-2005, 09:39 AM
irchans irchans is offline
Senior Member
 
Join Date: Sep 2002
Posts: 157
Default Simulation Results

I wrote two quick simulations. Here are the results for the probability that at some time in a sequence of 1000 hands, there exists a 100 hand window with 14 or more pocket pairs.

In the first simulation of 10000 1000 hand sequences, I got 14 or more pairs 1091 times. The second simulation I got 1040. So, I think the correct answer is around 10% or 11%.


For the second simulation I copied the following formulas into excel:


cells c1 to c1000 >>>> +IF(RAND()<1/17,1,0)
cells d1 to d1000 >>>> +SUM(C1:C100)
cell e1 >>>> 0
cells e2 to e1000 >>>> +MAX(E1,D1)

Each time you hit the F9 button, the worksheet shows the maximum number of pairs in a 100 hand window in cell e1000.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.