People usually talk about “judgement” and the importance of experience in bridge. But what if I told you that with even a tiny bit of programming knowledge (or knowledge of editing other people’s programs) you can produce and process way more hands than any world-class player has played in decades? Simulations can help us tune our intuitions and test our bidding methods objectively and makes us better players.
If that sounds too good to be true — you’re not wrong. Simulations have their downsides, but they are still fun to set up and to sift through. In this case, I ask a simple question: “what hcp adjustments should I make depending on my shape if I want to be in 3NT? and what about 4S?”
These simulations have produced and analysed thousands of hands in only 10-20 minutes, and I didn’t really care about programming efficiency; that would make the coding process longer than necessary.
A certain level of Python knowledge will help you understand the video better, but you can still skim through it if you want to have a rough idea on how one might simulate hands with a computer.
Comments
6 responses to “Video: Simulating hands in Python with gwnn”
Thanks – makes redeal much more accessible to the python novice
Glad to have helped. Let me know if you need any help! I am hardly a redeal expert, but I think even knowing the basics of redeal and python can be enough for some pretty cool analyses.
I generally just use dealmaster pro or lead captain which now allows you to enter constraints and compare bidding chocies.
so what advantage is python going to add over these 2 programs
I don’t know those programs so well and I’m not equipped to compare them properly to redeal. But for people who have at least some familiarity with data analysis (for example, the regressions I showed here), I would guess that a script written using redeal will end up being more customisable/versatile than DealMaster Pro for example. I am the one who decides how I generate the deals, how I aggregate the results, and how I choose to analyse them. For example:
Suppose I wanted to answer the question “if I have a 6-9 raise of spades, how will the chances of making game depend on what I have in trumps? Are trump honours a positive or a negative feature of my hand?” I could just generate a bunch of these raises and track how the % of hcp in spades correlates with the chances of making game. This would be about 20 lines of code (plus output maybe). I just do not know that a “black box”-ish program would be able to do this; at best, you’d be able to output all those hands and then you’d end up needing to go through them yourself using a different code. Or maybe you’d give S Qxx Axxx xx xxxx or xxx Axxx xx Qxxx and compare stats. But this is just one possible comparison, not the kind of “big data” approach I’d like to perform.
Finally, redeal is also free and open source, which may be important for some users. But absolutely, if you are happy with your simulations right now, there is no reason to switch. 🙂 I have no horse in this race at all. I just like coding in python and was surprised how easy these scripts were to write.
generally I have run hands with Dealmaster pro where is the breaking point on 4333 hands with 10-15 hcp and 4-4 major fit where is the line between 3nt and 4-4 major fit.
Wow super interesting, thanks! I can’t wait to play around with that. The difference is striking.