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])

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