Dealer software with Double Dummy Solver
#1
Posted 2023-March-17, 09:49
I've run a few quick tests and it works like a charm. And it's fast too - finding the par for 1000 deals takes just under two minutes on my laptop! Mostly I want to spread the word in case other people are looking for dealer software and/or double dummy solvers. Personally I plan to generate a host of statistics on competitive calls and pressure bidding, verifying age-old facts on 3NT vs 4M and testing some response schemes over multi-way bids. If anybody has interesting questions that could be answered with dealer software, or has expertise in/questions on using this software, I'd love to hear them.
#2
Posted 2023-March-17, 10:06
https://github.com/z...e-bridge-redeal
This one is Thomas Andrews Deal, reimplemented in Python, disributed together with Bo Haglun's DD solver.
Uwe Gebhardt (P_Marlowe)
#3
Posted 2023-March-17, 17:28
I would be interested in seeing answers to 'real-world' questions.
For example:
There was a recent discussion about the value of 'right-siding' in 1NT contracts.
Received wisdom from pre-computer days is that there is a huge advantage to using transfers.
Is this true?
Concerning 1NT vs 5CM
Suppose opener has 15-17 and a 5CM, will the DD optimal contract be reached more often after opening 1M or 1NT?
Suppose opener is in 3rd or 4th seat: is the answer still the same?
Does it matter if opener uses 14-17 (or anything else)?
Does the vulnerability matter?
On the question of opening points.
HCP+spades=15 is commonly used as a guideline in 4th seat.
Assuming that the goal is to reach a makeable contract DD, should this be a lower or higher.
For that matter, is opening with 10, 11 or 12, and in which seat, and at which vulnerability, most likely to lead to winning DD contract.
#4
Posted 2023-March-18, 04:08
Could you perhaps clarify the point on right-siding 1NT - are you referring to the recent T-Walsh discussion with split range 1♠ vs 1NT responses? Or is this about e.g. using transfers in competition? Or after we have opened 1NT, right-siding contracts in general?
#5
Posted 2023-March-18, 04:29
I am curious especially about leads, and how genuine expert best defence compares with DD best defence
Other areas of curiosity I have considered with sims are points required for NT slams
Super accepts with less than the desired maximum - or with 3 trumps, and various loser combinations
Jacoby 2NT with only 3 trumps
All kinds of variations from strict following of conventions
It all gets rather vague and complicated but adjusting all the hands for loser counts etc
A favourite article I read years ago which made me think was the analysis on Slam bidding by Matthew Kidd - comparing real hands played by different level players with DD
Another huge vague and complicated question. How often can a particular bidding system reach the best DD contract
We need a natural language interface to it all
#6
Posted 2023-March-18, 05:00
Richard Pavlicek has a lot of DD data on NT contracts (in particular 3NT, 6NT and 7NT) split by shape and total HCP. One question that I haven't seen answered (but maybe I haven't been searching enough) is the inverted question - given that we can make 12 tricks in notrump and opener holds a (say) 20-21 balanced, what is responder's point distribution.
As for leads - I think this is part of the EDGAR analysis to catch cheaters. Real experts perform a known amount worse at leads than double dummy on average, and if people outperform the experts by a wide margin that is cause for suspicion. If I'm not mistaken some analysis has been published on the average tricks lost compared to DD by an expert due to the lead, though I can't recall what the figure is.
As for slightly deviating from standard conventions - I'm not sure how to simulate this. The remainder of the auction will likely be influenced by the fact that your agreement has changed slightly, plus that you chose a different way to represent the hand.
#7
Posted 2023-March-18, 05:16
Regarding the leads issue and DD vs expert play that was something that I remembered from Matthew's analysis on slams
He was wondering why experts perform worse, or more conservatively in slam bidding than DD
For me that is obvious. Surely expert defence (leads) would be based on the best outcome from the unknown hands of declarer and dummy
Who knows how easily that can be analysed.
DD is an obvious overfit of a model. Maybe experts have the optimal model
Along the lines of the EDGAR cheating analysis you mention
Also on leads, there are all these standard leads that evolved over time (eg small from longest suit, top of sequence)
In my experience of modelling (maybe its biased by how algorithms are written) but models tend on the whole to backup expertise
But my head is going into an infinite loop and its time to sleep
One final rant before sleep. It is my big concern about the state of the world, the dominance of analytics with so many of the people involved not having much of clue about models and data and statistics. It is a big concern. People do not understand fundamentals of variance and overfitting and inbuilt bias which is propagated etc. Those people are running much of our world and many don't have a clue. Not many people involved in analytics are expert statisticians or modellers
#8
Posted 2023-March-18, 20:19
DavidKok, on 2023-March-18, 04:08, said:
Could you perhaps clarify the point on right-siding 1NT - are you referring to the recent T-Walsh discussion with split range 1♠ vs 1NT responses? Or is this about e.g. using transfers in competition? Or after we have opened 1NT, right-siding contracts in general?
Sorry for the dysclarity (?!).
The previous thread was about the value of transfers after a 1NT opening.
AFAIK transfers came about long before DDS's
When pescetom and others ran some basic sims it appeared that the advantage to using transfers was minimal at best.
I suspect that for most people the advantage would be lost in the noise.
If the advantage is really small it raises the question: If we don't use transfers would the alternatives be more useful ('useful' being a whole different problem to define).
To the novice player, one disadvantage of the transfer/Stayman system is that responder can't use 2♣/♦ to mean a weak hand with 5 ♣/♦.
If nothing else, your approach might help to put a factual base under the "well this is what everyone does around here" arguments.
The law problem is really interesting also.
The rule (guideline) of 17 - which I assume is law-based - helps to set contracts after a preempt, but your approach could help at the margins to locate sets of hands where the law tends to crumble so these can be identified and managed.
Current attempts to deal with this using Ogust and feature-asking may be helpful but don't seem to have a solid statistical underpinning.
#9
Posted 2023-March-19, 13:02
Humans are also notoriously bad at defending, doubly so when most of the picture cards are hidden from view. As far as I know there is a significant practical benefit to concealing the strong hand that DD analysis fails to capture. I like the question though, and will look into it.
I love your questions on preempts, especially since my style is very aggressive. Exactly how much does responder need (rule of X? Big balanced? Other?) to make it, on average, worth looking for game over our weak two?
#10
Posted 2023-March-19, 14:00
DavidKok, on 2023-March-19, 13:02, said:
Thus is definitely true, though on the flipside the NT opener is very tightly defined, so you could argue that having the more variable hand hidden could be tricky too. But I think the hidden honors works out better.
But I think an even greater thing that DD fails to take into account is the opening lead. This is always where the biggest swing between DD and real life comes into play, and I suspect that leading into the strong hand is much riskier than leading into the weak hand. DD ignores this entirely, though it's hard to quantify.
#11
Posted 2023-March-19, 14:21
#12
Posted 2023-March-23, 04:53
How do we simulate something real
Can we hook up an AI bot to everything
To supervise leads perhaps
To supervise real bidding too
I know. True Scotsman Fallacy or whatever
Can I ask a stupid question again
I considered looking at the code and wondered why it hadn't been ported to Windows. Now I know
Why doesn't the preferred simulation method in Bridge simulate incomplete defence information. I'm sure the answer is obvious like too difficult or impossible or along those lines
Thanks for the reminder about Richard Pavlicek. I tried replicating a few of his lead sims today
#13
Posted 2023-March-23, 05:12
#14
Posted 2023-March-23, 10:11
The exact hands included in the 1NT opening (all within range) are:
- Any 4333, 4432 or 5332 (including 5cM)
- Any 5422 unless the 5-card is higher than the 4-card suit and we have concentrated values in the long suits (at least half our HCP in the long suits). We exclude all 5=4=2=2. I included 4=5=2=2, which may be controversial (but is an infrequent hand type and won't change the conclusions).
- 6m322 with values in the short suits (not at least 8 points in the minor suit)
- All the above but with a singleton ace or king instead of a doubleton - in particular 6m331, any 5431 or 4441 subject to the same assumptions as the shapes above.
Responder's hand type for this simulation, in the range of 9-10 HCP, is restricted to:
- Any 5332 or 4432 without a 4cM
- Any 4333
- Any 5422 or 5431 without a 4cM
The contracts and strategies I've considered are:
- "Pass" - play 1NT.
- "Invite" - play 2NT opposite 14, 3NT opposite 15-16.
- "Blast" - play 3NT.
The full code of this simulation is available in the spoiler.
I've changed the parameters a few times (in particular the vulnerability and South's strength). My conclusions are:
- With the parameters as stated, blasting is exactly as good as inviting when not vulnerable (a gain of +0.06 points, not IMPs, these are the things you get 90 of when you play 1NT=, per board average over 3319 deals). When vulnerable blasting is slightly better (+13.60 points per board average over 3317 deals).
- With 10 points blasting outperforms inviting (+20.22 points per board average over 1000 deals vulnerable, +5.69 points per board average over 1000 deals not vulnerable)
- With 8 points passing beats inviting (and, presumably, also blasting), at -70.37 points per board average for inviting when vulnerable.
- With 9 points inviting scores +20.84 points per board over blasting when vulnerable and +17.24 points per board over blasting when not vulnerable. Also, with 9 points inviting scores -2.00 points per board over passing (so it loses to passing!) when not vulnerable and scores +12.46 points per board over passing when vulnerable.
#15
Posted 2023-March-25, 15:48
Perhaps also (as repeatedly requested) split that forum into two separate fora specific for the two unrelated issues?
Seeing as trick taking analysis with Dealer has in a rather discussable manner become a DIY problem rather than the BBO function it was, we should at least be able to find the related information easily.
#16
Posted 2023-March-25, 16:27
I call the new version Dealerv2 because of the many additions (as well as some subtractions) to the original.
Most of my changes were motivated by the idea of doing simulations, and then doing statistics on the results. (see CSV report)
That is why I added the ability to re-import into Dealerv2 hands generated by previous selection criteria. (Using the Predeal function)
In my own simulations, I generate say 100 hands where one side has say a 9 card fit and 23 hcp.
Then I re-import those hands into Dealerv2, one at a time, and for each one generate 500 hands for the opponents
and solve for the number of tricks. This gives me 100 example hands, and for each of those example hands I now have
a pretty good idea of how many tricks they will likely take on average. I can wrap this whole process in a shell script and let it run
unattended.
Its kind of fun.
Just recently I added the ability to use Richard Pavlicek's library of SOLVED deals as an input source.
If you are doing heavy simulations, having the deals already solved can greatly speed up the runs, maybe by a factor of 100.
Bo Haglund's (and his colleague Soren Hein's) DDS is pretty fast but nothing is as fast as just looking up the answer.
Of course if I am using RP's solved Database, I cant use the Predeal functionality so I need to modify my approach.
JGM
#17
Posted 2023-March-25, 16:33
pgmer6809, on 2023-March-25, 16:27, said:
I call the new version Dealerv2 because of the many additions (as well as some subtractions) to the original.
Most of my changes were motivated by the idea of doing simulations, and then doing statistics on the results. (see CSV report)
That is why I added the ability to re-import into Dealerv2 hands generated by previous selection criteria. (Using the Predeal function)
In my own simulations, I generate say 100 hands where one side has say a 9 card fit and 23 hcp.
Then I re-import those hands into Dealerv2, one at a time, and for each one generate 500 hands for the opponents
and solve for the number of tricks. This gives me 100 example hands, and for each of those example hands I now have
a pretty good idea of how many tricks they will likely take on average. I can wrap this whole process in a shell script and let it run
unattended.
Its kind of fun.
Just recently I added the ability to use Richard Pavlicek's library of SOLVED deals as an input source.
If you are doing heavy simulations, having the deals already solved can greatly speed up the runs, maybe by a factor of 100.
Bo Haglund's (and his colleague Soren Hein's) DDS is pretty fast but nothing is as fast as just looking up the answer.
Of course if I am using RP's solved Database, I cant use the Predeal functionality so I need to modify my approach.
JGM
Thanks for the good work.
If you could offer a native Windows (or web based) version of Dealerv2 including DD capability it would be a huge plus for the bridge community, many of whom are technically challenged.
#18
Posted 2023-March-25, 16:38
smerriman, on 2023-March-19, 14:00, said:
But I think an even greater thing that DD fails to take into account is the opening lead. This is always where the biggest swing between DD and real life comes into play, and I suspect that leading into the strong hand is much riskier than leading into the weak hand. DD ignores this entirely, though it's hard to quantify.
Richard Pavlicek has made some attempt to quantify it tho. See http://rpbridge.net/ac01.htm
It really is a good idea to visit his web site, as I cant really do it justice. But TL:DR here is an extract with his explanation:
Quote
Another factor in these analyses is the relationship between double-dummy and actual play. There is no doubt that declarer in actual play has the advantage (below the slam level) because the defense at double-dummy gets the first shot — and it will always be right — while in actual play, the opening lead is often inferior, and sometimes an outright gift.
In order to quantify this, I turned to Actual Play vs. Double-Dummy, a previous study based on 72 major events from 1996-2014. Results there showed that 4 S was made 8044 times out of 12,086 occurrences, but at double-dummy would have been made only 7865 times — an increase of 2.28 percent — and this was against world-class opening leaders. Versus less stellar defense it would be higher, perhaps as much as 10 percent against typical club players.
Arbitrarily I decided that 4 percent would be a good general adjustment, and even if inaccurate would be the same for all methods and comparatively have little if any effect. To implement this I increased the number of successful occurrences by 4 percent, as shown by the gold-tinted cells in the following table. All calculations are then based on the Adjusted column.
#19
Posted 2023-March-27, 00:09
I spent a few hours considering trying to port the thing to a Windows compiler but life is too short for some of us - but the project did tempt me _ wish I had more energy, more time and fewer things to pack into it
Following the thread with great interest
I realise this may not be the thread to discuss it but reading old papers and other DD projects back in the day with slow processors and not much RAM makes interesting reading
#20
Posted 2023-March-27, 00:58
pgmer6809, on 2023-March-25, 16:38, said:
It really is a good idea to visit his web site, as I cant really do it justice. But TL:DR here is an extract with his explanation:
That quantifies declarer advantage, but not what I was referring to - which was whether declarer advantage *changes* based on whether you're leading into the strong hand vs the weak hand.