The Hand Analysis Project

My bridge database. Continue reading

When experts argue in favor of or against a treatment in bridge, they customarily provide a hand that illustrates the point that they are emphasizing. This has always struck me as somewhat odd. There are 635,013,559,600 possible bridge hands. What does one hand prove?

Ideas about what works in bridge and what does not have changed drastically over the fifty or so years that I have been playing. The fact that I took thirty years off in the middle has made this easy to realize. Many of the “truths” that I learned in the sixties are considered silly by most experts today.

On some very important issues there is still no consensus whatever among the experts. I decided that it would be useful to have a database of hands that I could query easily to determine what worked best. The hand records that are often provided at the end of games that use computer generated hands provide a wealth of information. Not only do they show each of the four hands, they also provide the dealer, the vulnerability, and the analysis by Deep Finesse as to what the best contracts are. Many tournaments provide these hand records as pdf files, and hundreds are available over the Internet.

At first I keyed in the results, but this was too labor-intensive for a lazy man like myself. After thinking about this for a while, I devised a process for converting the pdf files downloaded from the Internet into the format of my database. Here is how it (usually) works. 1) I save the pdf file onto my hard drive. 2) I load that file into Adobe Acrobat (not the Reader, the one that you have to pay for). 3) I save it on my hard drive as a postscript file. This is a text file that can be parsed by a program. 4) I run my php program to convert the file to the format of my MySQL database.

The process, which takes only a couple of minutes, results in thirty-six new records on my database. It currently has approximately twenty thousand hands.

Unfortunately, the algorithm is not perfect. Sometimes my copy of Acrobat is not able to read the pdf files. Sometimes my program is not able to parse the postscript file correctly. The latter problem can be fixed if I am willing to put the time into improving the program’s logic, which was built without any documentation of the formats used in creating the pdf files. At present, I do not know what to do about the first issue.

In subsequent posts I will provide some of the results of my queries of the database.

Leave a Reply