Code Monkey home page Code Monkey logo

bga's Introduction

BGA

Bridge Gameplay Analysis (BSc Thesis project)

Subject: Desktop application for the analysis of gameplay in card game of Bridge

University: Politechnika Bydgoska im. Jana i Jędrzeja Śniadeckich

alt text

Introduction

The aim of this project is to create a desktop application enabling the analysis of Bridge gameplay. The following doc discusses the practical result of the application development process, provides insight into the architecture of components and the adopted solutions using the Bridge Calculator library (http://bcalc.w8.pl/), as well as statistical analysis. The main program requirements include a user-friendly graphical interface allowing users to define their own gameplay problems, navigate through the game by placing cards on the table, perform gameplay analysis from the perspective of the declarer, and update analysis results for each possible play in terms of approximate win probability and predicted number of tricks to be taken. Based on the analyzed game positions, the program statistically selects moves promising the highest number of winning playouts.

In the recent past, similar programs have been developed, which to this day can be divided into two categories - commercial software and freeware. Their significant drawback is the closed source code - apart from the code curtain itself, these applications operate solely based on the selection of the best move, without presenting any calculations or the reasons behind choosing such a move. The discussed solution in the project is fully available for free, along with open-source code under the MIT license. This license allows for unlimited use, modification, and distribution. The advantage of open-sourcing is primarily flexibility, as unrestricted access gives developers the opportunity to customize the program to their needs, and thanks to the community, one can be assured that any gaps and suggestions will be easily addressed by the creator.

Apart from its open distribution, the application can serve as a "teacher" - it instructs new Bridge enthusiasts on how to play a contract for maximum chances, allows them to shape popular Bridge techniques such as finesses or squeezes, and also reinforces the acquired knowledge that can be applied in practice. The application supports all possible card distributions intended for analysis with any contract agreed upon by the players. Thus, users can analyze previously played hands and assess to what extent the gameplay progressed in terms of strategy and tactics. A precise knowledge of the deals is not necessarily required, as the analysis can take place concurrently with the ongoing contract.

Solution

The solution relies on the use of statistical analysis to calculate the probability of winning a contract by the declarer pair. The analysis is based on the popular Perfect Information Monte Carlo method, originally used for decision-making in games with imperfect information. Position evaluation operates by utilizing the Bridge Calculator library, which solves the game with an assumption that all cards are not hidden. The entire process of analysis, problem definition, and game simulation takes place in a desktop application created in the .NET Framework 4.6.1 environment.

An essential element of the analysis is generating combinations of opponents' card distributions and drawing conclusions based on the calculations performed, as well as implementing multithreading to expedite this process. Users have the ability to navigate through the game by placing cards on the table. It should be noted that only the card distributions of the declarer pair playing the contract are defined at the input. This is because the algorithm analyzing the game must examine many different opponents' card distributions. The more cards we add to the table, the more the program learns about the entire distribution. For example, if a particular opponent does not play a card in the led suit, it indicates that they no longer have cards of that suit. The game under consideration should proceed according to the actual distribution of cards, where the user takes responsibility for their correct placement - since the distributions of the declarer pair are well known, the program also prevents illegal plays from their side. Additional information for the algorithm includes knowledge of the contract, the side currently leading the trick, and the cards already played to the table.

Perfect Information Monte Carlo

According to the theory of games with incomplete information, individual game states form an information set, which dictates how the game under consideration unfolds. For example, in card games, some participants do not reveal their cards, so the set of positions includes states that define all possible combinations of card distributions. A player aims to maximize their chances by analyzing each possible scenario. When choosing a position from the set (also known as determinization), we receive a game with perfect information. The Perfect Information Monte Carlo (PIMC) method is a technique designed for decision-making in games with incomplete information. Random determinizations are assigned as samples, for which the algorithm statistically determines the move that yields the highest winning coefficient. The algorithm uses a function returning values of game position evaluations for an analytical compilation of results. Although the method has received positive feedback across a wide range of games with imperfect information, it is not without flaws.

The PIMC method, when applied to Bridge games, cannot play based on bluffing or retain information about the participants' leads, which could be very useful for a defensive play. Problems also arise from the fact that the move statistically determined by PIMC to be winning is based on the analysis of games with perfect information - however, there are many situations where this assumption is incorrect. This problem was described in the paper of Frank and Basin and termed the "strategy fusion" (https://core.ac.uk/download/pdf/82412244.pdf). It arises from the properties of games with incomplete information, where each move determines how the game will unfold further. In the deterministic variant, only one game state is possible - in games with incomplete information, however, there are many possible states. When analyzing different determinizations, the algorithm gains insight into all participants' cards and determines the optimal line of play for each state. In other words, the method assumes that it knows the solution for all considered cases, which is impossible to achieve because players do not know which cards the other players hold, except for the declarer's partner. With such an approach, the evaluation of the position changes drastically after playing the card for which the highest winning coefficient was determined, and the consequences can be negative.

This problem could be solved in many different ways. The simple one works by conducting a game simulation for each possible play by the declarer, in which the opponent plays any card to the led suit. Subsequently, the algorithm calculates tricks for the declarer's partner's hand and determines whether any of the cards yield one trick less for the pair than originally assumed. The simulation should consist of two variations - one composed of randomly drawn opponent cards and the other based on the same distributions but reversed. The modification was included into the statistical analysis when calculating tricks using the Bridge Calculator engine.

bga's People

Contributors

ark223 avatar

Watchers

Thorvald Aagaard avatar  avatar

Forkers

thorvaldaagaard

bga's Issues

I am not sure this is the right plan

image

North is playing 3N and at trick 9 I got to this situation. During play no discards, and constraints based on bidding as almost none.

Here we have 462 combinations and 86 is validated OK. It seems to be the hearts, that filters the deals away, but I would expect the finesse to be the right play.

Let me know if I can help you identify the problem (and solution)

Zero playouts at trick 10

I played the default hand and reached this position
image

Declarer can make the last 3 tricks, but there are no playouts, and thus no stats on the card to play

Same trick added twice

Perhaps I am misunderstanding but I assumed that Playouts was like possible combinations, so I was surprised seeing a card play more than Playout.

Here the Card is added twice
image

so I assume it is safe to delete line 176

Finding best move

// find the best move
if (bestScore.Equals(-1f) || 
    probability > bestScore ||
    bestScore.Equals(1f) && probability.Equals(1f) && tricks > bestTricks || 
    bestScore.Equals(0f) && probability.Equals(0f) && tricks > bestTricks)
{
    bestMove = label;
    bestScore = probability;
    bestTricks = (float)tricks;
}

If there are multiple BestScore with the same value, it will select the first, and not the one with most tricks, so I suggest to add

if (bestScore.Equals(-1f) || 
    probability > bestScore ||
    bestScore == probability && tricks > bestTricks 
{
    bestMove = label;
    bestScore = probability;
    bestTricks = (float)tricks;
}

Was the intention to use highest card?

Seed the random function to get reproduceable result

I recommend to seed the random function like this

            if (seed == 0)
            {
                seed = CalculateSeed(this.northHand.ToString() + this.southHand.ToString());
                this.random = new Random(seed);
            }

            this.LoadCombinations();
        }

        static int CalculateSeed(string input)
        {
            // Calculate the SHA-256 hash
            using (SHA256 sha256 = SHA256.Create())
            {
                byte[] inputBytes = Encoding.UTF8.GetBytes(input);
                byte[] hashBytes = sha256.ComputeHash(inputBytes);

                // Convert the first 4 bytes of the hash to an integer and take modulus
                int hashInteger = BitConverter.ToInt32(hashBytes, 0);
                return hashInteger;
            }
        }

in SetupEvaluation

I am using the 2 hands concatenated as input, but perhaps you want to add it as an input field.

When queue is empty stop evaluation

I have added this

                    if (this.queue.IsEmpty)
                    {
                        this.evaluate = false;
                    }

at the bottom of BeginEvaluate

so it is possible to continue before the timer expires.
This is not needed for the UI, but mandatory for the DLL

I assume the UI can benefit from this functionality

An interesting deal, where we can use some improvement

You bid to 6H on this deal
image
A fine slam, but look what happens
Opening lead C5, so now the contract is 100%
Loading BGA gives this result:
image
Now the interesting part is that all 5 hearts score almost the same, but here H8 is selected.
BGA claims it is making, but I can see the only problem is hearts 4-0 and playing K or Q will ensure the contract.
Now in BEN this happens
image
As all cards from PIMC are even, BEN use the result from the Neural Network and play H3

BEN is using these constraints
2 8 0 7 0 5 0 6 1 11 - 1 7 0 7 0 5 0 6 0 8 - 2704156 - 123 - 114
It evaluates 123 position and 114 is OK but out of 2704156 possible

Now 4-0 is about 10% and in one hand 5%, so I would expect at least 5 deals of the playouts to have 4-0

So I printed the hands:

T52.AT75.AK62.3 9843.642.Q.JT97 AKJ6.KQ983.J5.Q Q7.J.T98743.864
T52.AT75.AK62.3 Q83..T9874.T876 AKJ6.KQ983.J5.Q 974.J642.Q3.J94
T52.AT75.AK62.3 Q98.62.T983.974 AKJ6.KQ983.J5.Q 743.J4.Q74.JT86
T52.AT75.AK62.3 Q98.J642.9843.9 AKJ6.KQ983.J5.Q 743..QT7.JT8764
T52.AT75.AK62.3 984.42.T743.986 AKJ6.KQ983.J5.Q Q73.J6.Q98.JT74
T52.AT75.AK62.3 843.6.Q98.JT876 AKJ6.KQ983.J5.Q Q97.J42.T743.94
T52.AT75.AK62.3 Q973.J6.T843.J4 AKJ6.KQ983.J5.Q 84.42.Q97.T9876
T52.AT75.AK62.3 9874..9874.J987 AKJ6.KQ983.J5.Q Q3.J642.QT3.T64
T52.AT75.AK62.3 Q984.62.Q73.T64 AKJ6.KQ983.J5.Q 73.J4.T984.J987
T52.AT75.AK62.3 Q98743.J4.983.6 AKJ6.KQ983.J5.Q .62.QT74.JT9874
T52.AT75.AK62.3 Q83..743.J98764 AKJ6.KQ983.J5.Q 974.J642.QT98.T
T52.AT75.AK62.3 Q83.J42.9743.J8 AKJ6.KQ983.J5.Q 974.6.QT8.T9764
T52.AT75.AK62.3 3.642.T74.JT964 AKJ6.KQ983.J5.Q Q9874.J.Q983.87
T52.AT75.AK62.3 73.J42.QT873.64 AKJ6.KQ983.J5.Q Q984.6.94.JT987
T52.AT75.AK62.3 74.J62.QT3.JT87 AKJ6.KQ983.J5.Q Q983.4.9874.964
T52.AT75.AK62.3 3.J6.Q874.T9864 AKJ6.KQ983.J5.Q Q9874.42.T93.J7
T52.AT75.AK62.3 Q9843.J6.T.JT96 AKJ6.KQ983.J5.Q 7.42.Q98743.874
T52.AT75.AK62.3 74.64.QT83.9874 AKJ6.KQ983.J5.Q Q983.J2.974.JT6
T52.AT75.AK62.3 Q743.42.Q943.T8 AKJ6.KQ983.J5.Q 98.J6.T87.J9764
T52.AT75.AK62.3 98.42.Q843.9764 AKJ6.KQ983.J5.Q Q743.J6.T97.JT8
T52.AT75.AK62.3 743.J4.T983.T76 AKJ6.KQ983.J5.Q Q98.62.Q74.J984
T52.AT75.AK62.3 Q84.J2.QT8743.6 AKJ6.KQ983.J5.Q 973.64.9.JT9874
T52.AT75.AK62.3 74.642.8743.964 AKJ6.KQ983.J5.Q Q983.J.QT9.JT87
T52.AT75.AK62.3 Q98.6.Q98.JT984 AKJ6.KQ983.J5.Q 743.J42.T743.76
T52.AT75.AK62.3 Q98.J42.QT984.7 AKJ6.KQ983.J5.Q 743.6.73.JT9864
T52.AT75.AK62.3 Q943.J2.Q74.J84 AKJ6.KQ983.J5.Q 87.64.T983.T976
T52.AT75.AK62.3 9874.642.83.T97 AKJ6.KQ983.J5.Q Q3.J.QT974.J864
T52.AT75.AK62.3 Q984.642.T3.874 AKJ6.KQ983.J5.Q 73.J.Q9874.JT96
T52.AT75.AK62.3 Q43.J4.QT84.987 AKJ6.KQ983.J5.Q 987.62.973.JT64
T52.AT75.AK62.3 Q9873.J4.98.T94 AKJ6.KQ983.J5.Q 4.62.QT743.J876
T52.AT75.AK62.3 984.J64.T.JT976 AKJ6.KQ983.J5.Q Q73.2.Q98743.84
T52.AT75.AK62.3 87.64.QT83.T974 AKJ6.KQ983.J5.Q Q943.J2.974.J86
T52.AT75.AK62.3 Q974.J2.Q98.T86 AKJ6.KQ983.J5.Q 83.64.T743.J974
T52.AT75.AK62.3 Q987.J6.97.J864 AKJ6.KQ983.J5.Q 43.42.QT843.T97
T52.AT75.AK62.3 Q743.J.T94.JT96 AKJ6.KQ983.J5.Q 98.642.Q873.874
T52.AT75.AK62.3 743.642.Q9874.T AKJ6.KQ983.J5.Q Q98.J.T3.J98764
T52.AT75.AK62.3 743.J6.987.J864 AKJ6.KQ983.J5.Q Q98.42.QT43.T97
T52.AT75.AK62.3 Q94.J4.97.98764 AKJ6.KQ983.J5.Q 873.62.QT843.JT
T52.AT75.AK62.3 73.J4.Q987.8764 AKJ6.KQ983.J5.Q Q984.62.T43.JT9
T52.AT75.AK62.3 974.J642.T.9764 AKJ6.KQ983.J5.Q Q83..Q98743.JT8
T52.AT75.AK62.3 Q9743.642.Q97.7 AKJ6.KQ983.J5.Q 8.J.T843.JT9864
T52.AT75.AK62.3 98743.4.Q87.864 AKJ6.KQ983.J5.Q Q.J62.T943.JT97
T52.AT75.AK62.3 843.62.QT83.876 AKJ6.KQ983.J5.Q Q97.J4.974.JT94
T52.AT75.AK62.3 Q.J2.8743.JT984 AKJ6.KQ983.J5.Q 98743.64.QT9.76
T52.AT75.AK62.3 Q987.42.QT873.7 AKJ6.KQ983.J5.Q 43.J6.94.JT9864
T52.AT75.AK62.3 Q74.4.Q84.J9864 AKJ6.KQ983.J5.Q 983.J62.T973.T7
T52.AT75.AK62.3 Q84.J2.Q873.T94 AKJ6.KQ983.J5.Q 973.64.T94.J876
T52.AT75.AK62.3 8.J4.QT873.T864 AKJ6.KQ983.J5.Q Q9743.62.94.J97
T52.AT75.AK62.3 3.642.QT84.JT64 AKJ6.KQ983.J5.Q Q9874.J.973.987
T52.AT75.AK62.3 Q94.642.Q9.9764 AKJ6.KQ983.J5.Q 873.J.T8743.JT8
T52.AT75.AK62.3 Q843.J64.QT7.JT AKJ6.KQ983.J5.Q 97.2.9843.98764
T52.AT75.AK62.3 Q874.42.T3.JT86 AKJ6.KQ983.J5.Q 93.J6.Q9874.974
T52.AT75.AK62.3 Q984.6.Q9874.94 AKJ6.KQ983.J5.Q 73.J42.T3.JT876
T52.AT75.AK62.3 Q983.J62.94.986 AKJ6.KQ983.J5.Q 74.4.QT873.JT74
T52.AT75.AK62.3 Q43.6.T743.J986 AKJ6.KQ983.J5.Q 987.J42.Q98.T74
T52.AT75.AK62.3 Q93.J642.QT98.4 AKJ6.KQ983.J5.Q 874..743.JT9876
T52.AT75.AK62.3 84.J42.T987.J94 AKJ6.KQ983.J5.Q Q973.6.Q43.T876
T52.AT75.AK62.3 Q3.2.T9874.JT84 AKJ6.KQ983.J5.Q 9874.J64.Q3.976
T52.AT75.AK62.3 73.J62.Q973.986 AKJ6.KQ983.J5.Q Q984.4.T84.JT74
T52.AT75.AK62.3 Q987.J64.T94.74 AKJ6.KQ983.J5.Q 43.2.Q873.JT986
T52.AT75.AK62.3 Q4.64.Q93.T9764 AKJ6.KQ983.J5.Q 9873.J2.T874.J8
T52.AT75.AK62.3 Q73.4.Q973.J974 AKJ6.KQ983.J5.Q 984.J62.T84.T86
T52.AT75.AK62.3 Q873.J.QT4.J984 AKJ6.KQ983.J5.Q 94.642.9873.T76
T52.AT75.AK62.3 Q97.642.Q83.J76 AKJ6.KQ983.J5.Q 843.J.T974.T984
T52.AT75.AK62.3 Q9843.62.43.876 AKJ6.KQ983.J5.Q 7.J4.QT987.JT94
T52.AT75.AK62.3 Q9743.J4.T87.J7 AKJ6.KQ983.J5.Q 8.62.Q943.T9864
T52.AT75.AK62.3 Q743.4.Q98.T984 AKJ6.KQ983.J5.Q 98.J62.T743.J76
T52.AT75.AK62.3 983.42.QT9.JT87 AKJ6.KQ983.J5.Q Q74.J6.8743.964
T52.AT75.AK62.3 Q74.6.T84.JT874 AKJ6.KQ983.J5.Q 983.J42.Q973.96
T52.AT75.AK62.3 94.J6.T9873.974 AKJ6.KQ983.J5.Q Q873.42.Q4.JT86
T52.AT75.AK62.3 Q974.42.Q3.T986 AKJ6.KQ983.J5.Q 83.J6.T9874.J74
T52.AT75.AK62.3 973.4.QT974.J86 AKJ6.KQ983.J5.Q Q84.J62.83.T974
T52.AT75.AK62.3 Q983.6.QT743.JT AKJ6.KQ983.J5.Q 74.J42.98.98764
T52.AT75.AK62.3 93.J.QT873.JT94 AKJ6.KQ983.J5.Q Q874.642.94.876
T52.AT75.AK62.3 Q4.42.QT943.J87 AKJ6.KQ983.J5.Q 9873.J6.87.T964
T52.AT75.AK62.3 Q987.62.Q8.J987 AKJ6.KQ983.J5.Q 43.J4.T9743.T64
T52.AT75.AK62.3 973.4.T987.J986 AKJ6.KQ983.J5.Q Q84.J62.Q43.T74
T52.AT75.AK62.3 43.64.QT943.984 AKJ6.KQ983.J5.Q Q987.J2.87.JT76
T52.AT75.AK62.3 987.J4.T98.J964 AKJ6.KQ983.J5.Q Q43.62.Q743.T87
T52.AT75.AK62.3 83.J2.QT73.JT84 AKJ6.KQ983.J5.Q Q974.64.984.976
T52.AT75.AK62.3 Q74.64.QT3.JT94 AKJ6.KQ983.J5.Q 983.J2.9874.876
T52.AT75.AK62.3 Q74.62.Q974.T74 AKJ6.KQ983.J5.Q 983.J4.T83.J986
T52.AT75.AK62.3 98.J64.943.JT84 AKJ6.KQ983.J5.Q Q743.2.QT87.976
T52.AT75.AK62.3 Q8.2.QT843.T984 AKJ6.KQ983.J5.Q 9743.J64.97.J76
T52.AT75.AK62.3 73.J64.Q73.T864 AKJ6.KQ983.J5.Q Q984.2.T984.J97
T52.AT75.AK62.3 Q3.6.Q9843.T976 AKJ6.KQ983.J5.Q 9874.J42.T7.J84
T52.AT75.AK62.3 843..T98.JT9874 AKJ6.KQ983.J5.Q Q97.J642.Q743.6
T52.AT75.AK62.3 Q4.J62.987.9876 AKJ6.KQ983.J5.Q 9873.4.QT43.JT4
T52.AT75.AK62.3 Q9873.2.Q843.96 AKJ6.KQ983.J5.Q 4.J64.T97.JT874
T52.AT75.AK62.3 Q843.6.T94.T976 AKJ6.KQ983.J5.Q 97.J42.Q873.J84
T52.AT75.AK62.3 Q83.J62.7.J9874 AKJ6.KQ983.J5.Q 974.4.QT9843.T6
T52.AT75.AK62.3 Q873.J64.Q3.T97 AKJ6.KQ983.J5.Q 94.2.T9874.J864
T52.AT75.AK62.3 Q943.J6.QT9.987 AKJ6.KQ983.J5.Q 87.42.8743.JT64
T52.AT75.AK62.3 3.J62.Q9743.J86 AKJ6.KQ983.J5.Q Q9874.4.T8.T974
T52.AT75.AK62.3 73.J642.QT83.98 AKJ6.KQ983.J5.Q Q984..974.JT764
T52.AT75.AK62.3 Q87..Q984.JT876 AKJ6.KQ983.J5.Q 943.J642.T73.94
T52.AT75.AK62.3 Q743.6.Q987.J86 AKJ6.KQ983.J5.Q 98.J42.T43.T974
T52.AT75.AK62.3 Q983.J.T974.J98 AKJ6.KQ983.J5.Q 74.642.Q83.T764
T52.AT75.AK62.3 Q93.2.Q93.JT987 AKJ6.KQ983.J5.Q 874.J64.T874.64
T52.AT75.AK62.3 974.6.9873.8764 AKJ6.KQ983.J5.Q Q83.J42.QT4.JT9
T52.AT75.AK62.3 Q987.J2.T8743.6 AKJ6.KQ983.J5.Q 43.64.Q9.JT9874
T52.AT75.AK62.3 97.J642.QT97.J8 AKJ6.KQ983.J5.Q Q843..843.T9764
T52.AT75.AK62.3 Q9.62.Q743.J964 AKJ6.KQ983.J5.Q 8743.J4.T98.T87
T52.AT75.AK62.3 Q8743.4.T4.9876 AKJ6.KQ983.J5.Q 9.J62.Q9873.JT4
T52.AT75.AK62.3 Q943.J6.943.964 AKJ6.KQ983.J5.Q 87.42.QT87.JT87
T52.AT75.AK62.3 873.2.QT9874.64 AKJ6.KQ983.J5.Q Q94.J64.3.JT987
T52.AT75.AK62.3 Q87..T98743.T64 AKJ6.KQ983.J5.Q 943.J642.Q.J987
T52.AT75.AK62.3 43.J642.QT983.7 AKJ6.KQ983.J5.Q Q987..74.JT9864
T52.AT75.AK62.3 Q874.2.Q73.T764 AKJ6.KQ983.J5.Q 93.J64.T984.J98
T52.AT75.AK62.3 Q87.J64.Q9.JT74 AKJ6.KQ983.J5.Q 943.2.T8743.986
T52.AT75.AK62.3 Q73.4.QT9874.J7 AKJ6.KQ983.J5.Q 984.J62.3.T9864
T52.AT75.AK62.3 983.4.Q743.JT76 AKJ6.KQ983.J5.Q Q74.J62.T98.984
T52.AT75.AK62.3 974.42.98.JT976 AKJ6.KQ983.J5.Q Q83.J6.QT743.84
T52.AT75.AK62.3 Q874.J64.97.JT7 AKJ6.KQ983.J5.Q 93.2.QT843.9864
T52.AT75.AK62.3 98..QT9843.JT98 AKJ6.KQ983.J5.Q Q743.J642.7.764
T52.AT75.AK62.3 Q873.J64.Q943.T AKJ6.KQ983.J5.Q 94.2.T87.J98764
T52.AT75.AK62.3 98.6.T9873.J986 AKJ6.KQ983.J5.Q Q743.J42.Q4.T74
T52.AT75.AK62.3 7.J642.T873.986 AKJ6.KQ983.J5.Q Q9843..Q94.JT74
T52.AT75.AK62.3 4.J64.QT9.T9876 AKJ6.KQ983.J5.Q Q9873.2.8743.J4
T52.AT75.AK62.3 Q8743.4.Q87.T98 AKJ6.KQ983.J5.Q 9.J62.T943.J764
T52.AT75.AK62.3 98743.62.Q43.98 AKJ6.KQ983.J5.Q Q.J4.T987.JT764
T52.AT75.AK62.3 Q973.4.T983.T64 AKJ6.KQ983.J5.Q 84.J62.Q74.J987
T52.AT75.AK62.3 Q987.6.QT73.JT4 AKJ6.KQ983.J5.Q 43.J42.984.9876
T52.AT75.AK62.3 Q3.J.Q9743.JT84 AKJ6.KQ983.J5.Q 9874.642.T8.976
T52.AT75.AK62.3 Q87.64.743.J864 AKJ6.KQ983.J5.Q 943.J2.QT98.T97

And found 4 deals with a heart void in East, so that was OK

But shouldn't 4-5% be visible in the choice of cards?

Now for an overtricks it is not that important, but here the weight of going down is from 980 to -50

Another observation is that when declarer play H3, and next hand follow like this
image

Then the contract is suddenly only making 97.7% but coming from always making that should still be the case
Here is the PBN:

[Event ""]
[Site ""]
[Date ""]
[Board "126"]
[Dealer "E"]
[Vulnerable "None"]
[Deal "E:T52.AT75.AK62.32 97..QT874.KJT964 AKJ6.KQ983.J5.AQ Q843.J642.93.875"]
[Scoring ""]
[BCFlags "1f"]
[Generator "BridgeComposer Version 5.88.5"]
[Score "EW -50"]
[South "BENNS"]
[West "BENEW"]
[North "BENNS"]
[East "BENEW"]
[Declarer "W"]
[Contract "6H"]
[Result "11"]
{PAR of the deal: 6NT = played by East : 990 points}
{PAR computation time: 00'00"}
{Feasability: 6 3 1 1 1 7 10 12 12 12 6 3 1 1 1 6 10 12 11 12 }
[Auction "E"]
1D Pass 1H Pass
2H Pass 4NT Pass
5H Pass 5NT Pass
6C Pass 6H Pass
Pass Pass 
[Play "N"]
C5 C3 CK CA
H6 HA D4 H3
H4 H7 C6 HK
D3 DA D7 DJ
H2 H5 S7 HQ
HJ HT D8 H8
D9 DK DT D5
SQ S5 S9 SJ
S4 S2 C4 SA
C8 D6 CJ H9
S8 ST CT S6
C7 C2 C9 CQ
S3 D2 DQ SK

Error in strategy, or something else?

Playing in 4H south we reach this position
image

Playing HK is wrong as we will lose 2 tricks if CT is together with DA, where we will get 2 tricks with DA onside if playing Diamond first.

If dropping the strategy with reversed opponents we will get the correct result

image

While examining this I found another "error" in the code:

image

this.N is Norths hand but as the suits in a hand are delimited by "." this.N > 2 will always be true.

Was the intention not to use the strategy if only 2 cards left the value should have been 5.

Based on the boards played it seems to favor playing trump, when the opponents are void, because then there are no reversed hands.

When only 20 combinations left the reverse strategy might not be valid.

Do you have an idea for this?

lorserker/ben#139

Constraints are based on length and hcp, but here North is almost guarantied to have SK after the first finesse.
How can we add this kind of constraints to to PIMC - at that point we have

Examined 446 of 184756

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.