Dou Dizhu is a popular card game in China. The normal version of Dou Dizhu is a three-player imperfect information game, where each player is dealt with cards from a standard 54-card deck (including two Jokers).
One of the three players will be Dizhu (meaning landlord) and will utimately have 20 cards at the end of the bidding phase. The rest two are called farmers who will have 17 cards each. A game ends if a player had played all of its cards, given several categories of playable hands.
I found the most complex and confusing category of playable hands to be airplane with solo. Here my goal is to calculate the total number of possible combinations of such hands. The relevant game rules/properties are:

Definition

Accroding to Wikipedia, an airplane with solo combination is "\(\ge\) Two consecutive trios with each carries a distinct individual card as the kicker".
For example, it says the hand 333-444 + 5-6 is the lowerest rank of the shortest chain length (2 consecutive trios). While 101010-JJJ-QQQ-KKK-AAA + 7-8-9-2-colored joker is the highest rank of the longest chain possible (since the maximum number of hands a player can have is 20). Here the consecutive parts are the primals while the kickers are the secondaries.
Also it worth pointing out that the order among the solo cards does not matter: 333-444 + 5-6 and 333-444 + 6-5 are the same, so it really didn't specify which trio "carries" which solo card.
However, Wikipedia also suggests that pair cannot be kickers. For example, 333-444 + 5-5 is not allowed under this rule. This contradicts to the local playing custom I am familaring with. And also to make my calculation more fun, I will use the following rule for computing the answer: These seem to give us enough information to compute the answer. And let me start with the simplest case where only two consecutive trios are considered.

Two consecutive trios

It can be seen that there are 11 different consecutive trios of length 2 under the game rules (from 333-444 to KKK-AAA). Denote the trio-variable to be BBB-CCC. Now let us consider the two solo cards. There are two cases: the two solo cards form the pattern \(\{X, Y\}\) or \(\{X, X\}\).
The first question is: can \(X\) or \(Y\) be one of B or C? If so then it will make it a Bomb inside the pattern. Since we mentioned that Bomb domaintes all other categories except Rocket, it seems pretty odd to "contain a Bomb inside a airplane", isn't it? Well, one can argue that it will play more cards (8 cards at least) than a bomb (4). However, notice that by playing so it eliminates the possibilities of playing a bomb in a future trick! Since a bomb is very likely to make you the winner of a trick, this may sound a bigger loss in the long run. So, here I will assume that \(X\) or \(Y\) cannot be one of B or C. Following the same reasoning, \(\{X, Y\}\) cannot be \(\{ColoredJoker, BlackWhiteJoker\}\). And I asked a few people around: it seems that this is standard custom, so I will assume this pattern holds in the rest of my computation.
Therefore, given a consecutive trios of length 2, there are \(\binom{13}{2}-1\) possible \(\{X, Y\}\). This is because we should subtract the 2 different ranks within the trios out of the 15. And we should also subtract the case where \(\{X, Y\}=\{ColoredJoker, BlackWhiteJoker\}\).
For pattern \(\{X, X\}\), there are 11 possibilities, since 2 of the 13 ranks (excluding Jokers) had already been taken by the trios.
Therefore, the number of possible combinations for consecutive trios of length 2 is \[ 11\times\left(\binom{13}{2}-1+11\right)=968\]

Three consecutive trios

Following the same reasoning, we can see there are 10 different BBB-CCC-DDD.
For pattern \(\{X, Y, Z\}\), there are \(\binom{12}{3}-10\) possibilities, where in \(-10\) we eliminate the cases of \(\{X, ColoredJoker, BlackWhiteJoker\}\).
For pattern \(\{X, X, Y\}\), there are \(10\times 11\), where 10 corresponds to if we first enumerate \(X\) (exclude Jokers) and 11 corresponds to then we enumerate \(Y\) (including Jokers).
Now here comes the tricky part: do we need to consider pattern \(\{X, X, X\}\)? For example if we play 666-777-888-A-A-A, that probably should be acceptable. Although playing A-A-A as the carried cards looks like a waste, if A-A-A are the only cards remaining, why not playing it?
However, how about 666-777-888-9-9-9? Now here is a confusion: we can actually also interpret it as 777-888-999-6-6-6. Furthermore, it can also be interpreted as the TrioChain category: 666-777-888-999.
Now, in real human plays, people can definitely resolve the confusion by explicitly saying which ones they want to play. However if we were to write a computer program, some pre-determined tie-breaking rules should be established. In the few computer Dou Dizhu programs I examined on (with graphical interfaces), they tends to interpret it as 666-777-888-999 if it was first played in a trick. But if it is played during the middle of a trick and the previous plays were airplane + solo, it is unclear which one it was interpreted to.
However, if you think about it, 666-777-888-9-9-9 and 777-888-999-6-6-6 are strategically equivalent during the middle of a trick: the hands that can beat either of them must at least start with three 10s, and the hands that either of them can beat must be the airplanes with 333-444-555. That means, if one develops a Dou Dizhu AI, it probably should learn that these two actions always have the same value.
So, are we going to view 666-777-888-9-9-9 and 777-888-999-6-6-6 as the same primitive action? Well, I would argue that depends on the endgoal of you application. If you are going to build an effective AI bot: sure, incorporating such inductive biases typically will speed up the learning process. In fact, such technique is called action abstraction which was widely adopted in computer poker research.
However, if you are going to implement a game engine: probably not. You should still treat them as two different primitive actions. Although they are strategically equivalent, they are still semantically different which is directly entailed from the game rules. The fact that they always have the same value is a result of a reasoning process, instead of a ruleset.
For my computation, I decide to treat 666-777-888-9-9-9 and 777-888-999-6-6-6 as different primitive actions, while both are different from the TrioChain action 666-777-888-999. And that means within the computer program 666-777-888-9-9-9, 777-888-999-6-6-6 and 666-777-888-999 should all be mapped onto different action IDs.
Then, for pattern \(\{X, X, X\}\), there should be 10 possibilities, after excluding the three ranks in the airplane and the two Jokers. That makes the answer for this part \[ 10\times \left(\binom{12}{3}-10+10\times 11+10\right)=3300\]

Four consecutive trios

My calculation from now on becomes much more obvious. It can be checked there are 9 different BBB-CCC-DDD-EEE. And we should examine patterns \(\{X, Y, Z, W\}\), \(\{X, X, Y, Z\}\), \(\{X, X, Y, Y\}\) and \(\{X, X, X, Y\}\).
My answer for this part is \[ 9\times \left(\binom{11}{4}-\binom{9}{2}+\binom{9}{1}\cdot\left(\binom{10}{2}-1\right)+\binom{9}{2}+9\times10\right)=7344\] Where each terms within the most outer bracket corresponds to each patterns.

Finally, five consecutive trios

The patterns for kickers are \(\{X, Y, Z, W, V\}\), \(\{X, X, Y, Z, W\}\), \(\{X, X, Y, Y, Z\}\), \(\{X, X, X, Y, Z\}\) and \(\{X, X, X, Y, Y\}\). My answer is \[ 8\times\left(\binom{10}{5}-\binom{8}{3}+8\times\left(\binom{9}{3}-\binom{7}{1}\right)+\binom{8}{2}\times\binom{8}{1}+\binom{8}{1}\times\left(\binom{9}{2}-1+\binom{7}{1}\right)\right)=10976\]

The answer

Finally, taking all up together, the answer is \[ 968+3300+7344+10976=22588\]

Summary and Disclaimer

In summary, the tie-breaking rules I am adoting are And there is one more rule that is different from what Wikipedia described: This by no means is the only true answer; using different tie-breaking rules will lead to different numbers. The only reference I have found online is the table listed in the RLCard library, where it says the number should be 21822. The other numbers match with my calculation. After contacting with the authors, I found the only difference is that they prohibit cases like 333-444-555-6-6-6. One can check there are \[ 9\times 2+8\times2\times10+7\times2\times\left(\binom{9}{2}-1+\binom{7}{1}\right)=766\] such cases. And 22588-766=21822. I would argue it is more reasonable to allow these cases. Because since we already allow 333-444-555-7-7-7, why not 333-444-555-6-6-6?

Last updated by Zun Li on 12/01/2022