Tuesday, January 09, 2007

 

My Luck Day - 3 No Trump!

I play bridge with some friends of mine. Recently, I got dealt a hand which had more high card points in it than I had ever seen: 26. Later that evening, I got another strong hand of 25 points! The proper opening bid for these situations is 3 no trump.

This got me to wondering what the probability of getting a hand like this would be (assuming the cards were shuffled properly). So, I wrote a quick and dirty Python program to simulate large number of hands and count the occurrences of the possible initial high card points. On the following graph, the x axis is the high card count, while the y axis is the percentage of times that count occurs. Note that this data is from a simulation, and is not exact.



The specific probability of 26 points is about 0.011842% or 1 in 8,444 hands. The chances for 25 points is about 1 in 3,703 hands.

It is interesting to note that in the 10 million hands I generated, not one of them had 33 points or more. Maybe next time I'll get one of those :-)

Here is the code I used:

import random

a = []
for i in range(0,4):
for j in range(0,4):
a.append(j + 1)
for j in range(0,9):
a.append(0)

d = []
for i in range(0,41):
d.append(0)

for c in xrange(1,9999999):
random.shuffle(a)
s = sum(a[0:13])
d[s] += 1

if c % 10000 == 0:
print c
for i in xrange(0,41):
print '%2d: %f %d' % (i, 100.0 * d[i] / c, d[i])

Comments:
This post got me to thinking. Of course there is no way to get 40 points, as this would require having all 16 point cards, and you only can have 13 of them. So all but 3 of the jacks. And there are 4 ways to have a hand like that. So what are the chances of getting that hand with 37 points?

For the answer I turned to my GRE study book, and I read the section on probability and factorials. The odds of getting any one specific hand is (52! / (52-13)!) / 13! or restated 52! / (13! * 39! ) or one in 635,013,559,600. So the chances of get one of those four 37 point hands is four in 635 billion or 158,753,389,900. You may need to do more than the measly 10 million hands you generated.

So then I got to further wondering why the curve is not more bell shaped, having a very distinctive steep rise on the left, and a long tail on the right? How many ways are there to get a one point hand? The gyrations I had to go through for that were much harder and apparently wrong! I first determined that there were only four cards that have a single point (the jacks), and 36 cards worth no points. I needed one of the jacks, and then any 12 of the remaining 36 cards. 4 * 36! / (13! * (36 - 13))! Which calculates out to one in 9 billion??? Your results show about 1 in 100,000.

For just random fun.
 
This is also a good resource for the combanatorics.
 
I figured out where I went wrong. My formula is attempting to calculate the number of possible one point hands, rather than the odds. Additionally, my formula is off a bit.

A one point hand is any 12 of the 36 no point cards (36! / (36-12)! ) / 12! or restated 36! / ( 24! * 12! ) = 1,251,677,700 and then multiply that with the four possible jacks and I get 5,006,710,800 total possible one point hands. Divide that by the 635b total possible hands, and I get a 1 : 126 hands or about .008 probability, matching what your sampling came up with.
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?