6

Made hands are very rare in mahjong. Is there a table that lists the possibilities of starting with a complete hand?

  • @Closers: Please let a comment. I will glad to follow your votes if I know and agree your arguments. – Maniero Oct 28 '10 at 0:47
  • @Bigown - The question isn't clear what a "made hand" is. I'm also concerned about a flood like we had for the poker questions before... these seem like shotgun questions – LittleBobbyTables - Au Revoir Oct 28 '10 at 0:51
  • 2
    @bigown I didn't vote to close, but I think this is the concern; I have posted some further discussion as well: meta.boardgames.stackexchange.com/questions/212/… – Brian Campbell Oct 28 '10 at 1:45
  • 3
    All SE sites have to deal with vague or ambiguous questions. You ask the poster to clarify. If they do, great, if not, answer as best you can. I'm not sure 'close all vague' questions is the right response. – DaveParillo Oct 28 '10 at 15:07
  • 1
    I didn't know that the term "made hand" was unclear, I'm not a native speaker and know (and misused, on second thought) the term from poker. This question is asking for the chances to get a hand that allows a player to finish on their first turn. – mafu Oct 28 '10 at 15:27
4

I wrote a program to simulate mahjong hand dealings.

It's not verified yet, but so far, the ratio appears to be around 1 in 100,000 games. (The output was the chance that the case happened to at least 1 out of 4 players)

I had the fixed program run for a bit (1.7 billion draws):

3004 mahjong in 1057000000 random draws: 0.00028%, 1 in 351864
4392 mahjong in 1526000000 random draws: 0.00029%, 1 in 347449
4930 mahjong in 1695000000 random draws: 0.00029%, 1 in 343813

At this point, the state space of the random number generator is likely rather close to exhausted, so further research requires a different implementation (this is easy, I just did not bother yet).

If the math of @Jan is correct, it would be pretty easy to replace the RNG with a permutator and just perform a whole-space search to calculate a precise result. The above program calculates around 2m hands per second on my box, so it would take 40-ish hours.


Update: I implemented a proper RNG, optimized the program slightly and let it search through 25 billion random draws:

 737s: 15433 mahjong in  5000m random draws: 0.00031  %, 1 in 323981. 6.78m checks/s
1557s: 31080 mahjong in 10140m random draws: 0.00031  %, 1 in 326254. 6.51m checks/s
2281s: 46008 mahjong in 15000m random draws: 0.0003067%, 1 in 326030. 6.58m checks/s
3116s: 60971 mahjong in 20000m random draws: 0.0003049%, 1 in 328024. 6.42m checks/s
4020s: 75921 mahjong in 25000m random draws: 0.0003037%, 1 in 329289. 6.22m checks/s

The last line is the current state (previous lines for picturing variance).

| improve this answer | |
3

Not sure I know what a 'made hand' is. Are you asking what are the odds of being dealt the Nine Gates? If yes, the odds are about 5000:1 in a 136 tile set. This page has a combinatorial treatment of the 13 orphans vs the Nine Gates.

| improve this answer | |
  • 1
    Just to clarify: The 5000:1 ratio described in your interesting link is not the chance to get Nine Gates but the ration between Nine Gates and 13 orphans. Both of them are, as far as I can tell, a lot rarer than 0.02%. I heard that even regular players often get them only once in their life. – mafu Oct 28 '10 at 15:26
3

I wrote a program that draws a random 14-tile set from a reservoir of all possibles tiles (expect flowers and seasons, sorry):

then the program checks if the hand is a mahjong. So far here are my results:

enter image description here

This means that for 71 millions random hands, I got 151 mahjong hands. We can say it has converged (almost).

Conclusion: You will get a "tinwu", "tenhou", "heavenly hand" aka a wining hand by chance, once every ~471 000 draws, on average.

Here are example of drawn mahjong hands: r: dots d: dragons (b: white, v: green, r: red) v: winds b: bamboos c: characters

hand number 433035 mahjong! ['b1', 'b1', 'b3', 'b4', 'b5', 'c6', 'c7', 'c8', 'r5', 'r5', 'r5', 'r7', 'r8', 'r9']

hand number 443206 mahjong! ['b1', 'b2', 'b3', 'c3', 'c4', 'c5', 'r2', 'r3', 'r4', 'r6', 'r7', 'r8', 'v4', 'v4']

hand number 833989 mahjong! ['b2', 'b2', 'b6', 'b7', 'b8', 'r1', 'r2', 'r3', 'r4', 'r5', 'r6', 'r7', 'r8', 'r9']

hand number 2194755 mahjong! ['b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'c6', 'c7', 'c8', 'r1', 'r1', 'r7', 'r8', 'r9']

hand number 2338547 mahjong! ['b6', 'b7', 'b8', 'c7', 'c8', 'c9', 'dr', 'dr', 'r1', 'r2', 'r3', 'r6', 'r7', 'r8']

hand number 3803349 mahjong! ['b2', 'b3', 'b4', 'b9', 'b9', 'c6', 'c7', 'c8', 'r3', 'r4', 'r5', 'r8', 'r8', 'r8']

EDIT: My simulation continues to converge. I have now drawn 2186 mahjong hands from 966 millions random draws. I did fit a distribution on my dataset. I got an exponential distribution of parameter mu= 442501 +/- 9466.47 (that a 2% error) According to wikipedia, the exponential distribution is the probability distribution of the time between events in a Poisson point process, i.e., a process in which events occur continuously and independently at a constant average rate. This is coherent I think, at least qualitatively. It could be awesome if someone could deduce this theoretically (that's too difficult for me). Then we could write a paper!

| improve this answer | |
  • 1
    Could you have your program create a (large) list of examples of mahjong and non-mahjong draws, so I can compare with my program? It seems they converge to different values. – mafu May 15 at 11:53
  • Good idea but I've try to generate such a file. It quickly gets really big and I have a limited data plan :( How large is enough? I use the algorithm proposed by Victor Nicollet here. I can send you my code (in python) but a lot of comments and variable are in French and it's a bit messy. I suspect my program fails to see some Mahjong if it is wrong. – pierebean May 15 at 17:15
  • Simple check: did your program include the 7pairs? It is a valid hand, but not in the form of 3*4+2. My program did not include the 7 pairs (nor the 13 orphans but that's negligible). It now does. I don't think it will help the probability to go to ~1/350000 but I can check. Other simple check: my program seems to be more strict than yours. So I suspect it does not count some mahjongs as valid (excluded the 7 pairs). Why don't you send me your list of valid hands so I can check if my program agrees? If you can format them as in my comment, it will be easier for me. – pierebean May 16 at 6:35
  • Mine included 7 pairs and 13 orphans. Sure, I'll prepare a list and upload it. – mafu May 17 at 11:31
  • Here's a list of 500 valid hands: gist.github.com/nerai/7f524d2b0a08f57a89534bde3eb21c62 or gist.github.com/nerai/8a7ab081c7687acce6b93c2fee01fe32 (your format) – mafu May 17 at 12:26
1

Note: I am basing this answer on Japanese Mahjong rules; Chinese rules will probably lead to a different outcome.

Tenhou, Chihou or Renhou hands must be valid hands, i.e. they must satisfy the requirement of having four groups of three and one pair; except for Chiitoi (seven pairs) and Kokushi Musou (13 orphans) which we must treat separately.

The four groups of three can technically be kan, pon or chi. For a kan-containing hand to qualify, this would imply Rinshan Kaihou which complicates the picture a little. However, combinatorically it does not matter whether we draw the winning tile first and the kan-completing tile second or vice-versa (there is no confounding discard) so even if Saki is playing the outcome should be the same and the discussion can be limited to pons instead of including kans.

This leads us to the following cases:

Kokushi Musou: there are 13 possible hands

Chiitoi: the pairs can be taken from 1–9 in three colours, four winds and three dragons (34 tile faces). As most rules specify that no pair can be repeated, this gives us 34C7 = 5,379,616 possibilities

Four chi: there are 21 possible starting tiles for the chis (1 through 7).

  • If each starts on a different tile that gives 21C4 = 5985 possibilities.
  • If two chi are identical (Iipeikou), that gives us an additional 21C3 × 3 = 3990 possibilities. It is not possible to have exactly three chi identical as that would be a three pon + chi hand. Further, it is not possible to have all four identical as that would be a special case of a three pon + chi hand.
  • However, there are an additional 21C2 = 210 hands of Ryanpeikou (two pairs of identical chis that are distinct from each other).
  • The final pair makes it slightly more complicated. Naively, one might assume that there are 34 possible pairs but the real number may be smaller for a given hand due to chi using three or four of a number tile.
    • If all chis start on different tiles: a given number 4 through 6 will be the only one used three times in exactly 16 hands; 3 and 7 add another 17 hands each for a total of 82 per suit. In addition, there are 6 hands per suit in which two consecutive numbers are used three times (e.g. 1-2-2-3-3-3-4-4-4-5-5-6 composed of the chi 1-2-3, 2-3-4, 3-4-5, 4-5-6)
    • If the hand has Iipeikou, each number 3 through 7 will be unavailable in exactly 10 × 16 = 160 hands per suit. Two consecutive numbers are unavailable for pairs in 76 (2/3 and 7/8), 72 (3/4 and 6/7) and 68 (4/5 and 5/6) hands per suit or 216 overall. There are 3 possible combinations per suit which render two non-consecutive numbers unavailable (e.g. 1-2-3-3-3-4-4-5-5-5-6-7), meaning there are 219 hands per suit with two pairs unavailable. Finally, three consecutive numbers can be unavailable; for 3/4/5 through 5/6/7, three hands each, for 2/3/4 and 6/7/8 two hands each.
    • If the hand has Ryanpeikou, each number 3 through 7 is not available for pairing in exactly 1 hand per suit and two consecutive numbers beginning on 2 through 7 are not available in exactly 1 hand per suit.
    • (It is not possible to remove the 1’s or 9’s from the list of possible pairs using only chis)
  • therefore, including the pair there are:
    3 × 6 × 32 + 3 × 5 × 33 + (210 – 3 × 6 – 3 × 5) × 34 = 7089 Ryanpeikou hands
    3 × 13 × 31 + 3 × 219 × 32 + 3 × 160 × 33 + (3990 – 3 × 13 – 3 × 219 – 3 × 160) × 34 = 133,749 Iipeikou hands 3 × 6 × 32 + 3 × 82 × 33 + (5985 – 3 × 6 – 3 × 82) × 34 = 203,208 hand that have neither
    7089 + 133,749 + 203,208 = 344,046 all-chi hands.

One pon: again, assuming three different starting numbers there are 21C3 or 1330 ways to choose the chis plus an additional 21 × 20 = 420 Iipeikou options.

  • With Iipeikou, the numbers 3 through 7 can be unavailable for pairing in two cases per suit. Two consecutive numbers from 2/3 to 7/8 are also unavailable in two cases per suit. As only the choice of Iipeikou matters for which tiles can be pon, there are 3 × 10 × 31 = 930 hands where one can choose from 32 possible pairs and 3 × 12 × 31 = 1116 hands where one can choose from 31 possible pairs.

  • Without Iipeikou, the only way to make a digit unpairable is for the three chis to start on three consecutive digits; this gives 5 options per suit and leaves 31 choices for the pons.

  • The more difficult case is when the pons are restricted but not the pair.

    • If one wishes to remove exactly one possible pon, this restricts the possible placement of the third chi:
      When removing 5, the third chi must have a different suit (14 options)
      When removing 4 or 6, the third chi can be one of the same suit or a different suit (15 options)
      When removing 3 or 5, there are two possibilities within that suit for the third chi (16 options)
      Overall 76 options
    • If one wishes to remove two consecutive pons, the following restrictions are in place:
      When removing 4/5 or 5/6, one option remains in that suit for the third chi (15 possibilities)
      When removing 3/4 or 6/7, two remain within that suit (16 overall)
      When removing 1/2 or 7/8, three remain (17 overall)
      Overall 96 options
    • Two non-consecutive pons can be removed; there are three options to do this per suit and it requires all three chis
    • There are eight options per suit to remove three consecutive numbers from being ponable and this uses all three chis; e.g. 1-2-2-3-3-4-4-5-6 (individual chis: 1-2-3, 2-3-4, 4-5-6).
  • Therefore, there are:
    930 × 32 + 1116 × 31 + (420 – 30 – 36) × 31 × 33 = 422,406 Iipeikou options
    3 × 5 × 31 × 32 + 3 × 76 × 33 × 33 + 3 × 99 × 32 × 33 + 3 × 8 × 31 × 33 + (1330 – 3 × 5 – 3 × 76 – 3 × 99 – 3 × 8) × 34 × 33 = 1,460,808 options without Iipeikou

  • Altogether 422,406 + 1,460,808 = 1,883,214 one-pon options.

Two pons: it’s best to decide where to put the two chis first.

  • Assuming Iipeikou, there are 21 possible chis. Furthermore, there are 31 remaining tiles that can be the pons (pons and Iipeikou cannot overlap), so 31C2 × 21 = 9765 main hands. The pair is only restricted by the pons (Iipeikou will leave two of each number) so there are 32 possible pairs per hand giving 312,480 hands.

  • Assuming all independent chis, there are 21C2 = 210 ways to choose the chis. We now have to decide how we can choose the pons. As above, the pons will be the only thing restricting the pair so there will always be 32 possible pairs.

    • For each number 3 through 7, there is exactly one combination of chis that will make this and only this number unavailable for pons. This means 15 × 33C2 = 7920 main hands.
    • For each number 2 through 7, there is exactly one combination of chis that will make this and the consecutive number unavailable for pons. This means 18 × 32C2 = 8928 main hands.
  • Thus, for chis, pons and pair there are 7920 × 32 + 8928 × 32 + (210 – 15 – 18) × 34C2 × 32 = 3,716,640
  • Overall, that is 3,716,640 + 312,480 = 4,029,120 hands with two pons.

Sanankou: It is impossible for the pons to interfere with the chi, so it is safe to say that the main hand has 34C3 × 21 = 125,664 possibilities. The pair might seem to pose a problem but actually it does not as there is no way a single chi would remove any number from the pair pool in addition to the pons; thus there are 125,664 × 31 = 3,895,584 possible Sanankou hands.

Toitoi/Suuankou: finally something easy! There are 34C4 = 46,376 options for the four triplets and each leaves 30 possible pairs giving 1,391,280 Toitoi/Suuankou hands.

Assuming there is no error in my maths, there should thus be 16,922,873 hands that can win Tenhou, Chihou or Renhou.

To determine how likely it is to win, consider that there are 136 tiles in the game of which you choose 14. This is the same for Tenhou and Chihou and it doesn’t matter that your tile picks are non-consecutive. 136C14 = 4,250,305,029,168,220,000 = 4.250 × 1018 so there are 4 quintillion 250 quadrillion possible starting hands. A quick division of the two values shows that the probability of Tenhou or Chihou is around 3.982 × 10–12 or somewhere around 1 in two trillion.
The above chain of thought is incorrect. It assumes that all tiles are individual but there are four identical copies of each tile.

I was dreading having to calculate how many combinations with limited repetitions (drawing 14 from 34 distinct tiles but allowing each tile to be repeated a maximum of 4 times) because it seemed a daunting task but thankfully JMoravitz over at Maths.SE already did that work for me and showed me a shortcut. Using their method, there are in fact only:
47C14 – 42C9 × 34 – 37C4 × 34C2 = 326,446,402,010 or 326 billion possible hands.

Thus, the odds of getting Chihou or Tenhou are much better than my initial estimate and come in at around 5.18 × 10–5 or 0.005183967 % or a 1 in 20,000 chance.
As part of an old running joke from over at Chemistry.SE, I will add: or 5 m%.

Renhou is essentially like Chihou except you get one, two or three tries at the 14th tile depending on whether you are South, West or North wind. Thus, naively I want to assume that the probability of Renhou is somewhere between Chihou and 3 × Chihou but I would have to confirm that with a mathematician.

| improve this answer | |
  • 1
    No, I don’t know why I did this; no, I did not really have the time; yes, I had to rewrite a couple of times because I noticed errors in my maths; no, I am not certain that my maths is error-free now; yes, this XKCD is relevant. – Jan Dec 10 '19 at 18:01
  • Thank you for this detailed explanation. Do you know why it contradicts the other answers? – mafu May 9 at 13:42
  • @mafu I don’t, I suspect I have an error in my maths somewhere. However, it’s interesting to see that this question now has attracted to large-number approximations whose results differ by a factor of 4 and where my answer comes in in the middle …? – Jan May 11 at 1:36
  • To make sure, do you account for the different probabilities of the various unique hand compositions? You've reduced the total number of unique hands to 326 billion, but some of them are more or less likely (winds) – mafu May 15 at 11:58
  • @mafu Whether a hand contains x North Winds or x 7-sous is irrelevant for how likely the hand is because there are four North Wind tiles and four 7-sou tiles. But now you’ve got me unsure whether all hands are really equally probable; i.e. if it matters whether a hand has one, two, three or four of the same tile. – Jan May 18 at 2:58
1

The https://tenhou.net/sc/prof.html page contains statistics on yaku. As I understand it, Tenhou (天和) is found in 0.00046% of the hands that ended in someone victory, and Chiihou (地和) in 0.00091%. Thus, one case is obtained for approximately 100,000 or less.

| improve this answer | |
  • Interestingly, Chiihou is currently listed as 0.00015. If my Japanese is on point, these statistics were drawn from a pool of 650k games (which is to say, relatively few). – mafu May 11 at 13:15
1

Here is yet another answer from this page. 以上により、天和の確率は12859078207674÷4250305029168216000 =約0.000003025 (約1/330530)となります。

I think it means that the probability to get a tenhou=tenwu is 1/330530. Unfortunately i don't follow precisely the derivation because it is written in Japanese.

So far the answers are:

  • 1/350000 according to @mafu's program ==> Is the program counting everything?
  • 1/19290 according to @Jan's maths ==> Is the maths correct?
  • 1/442501 according to @Pierebean's program ==> Is the program counting everything?
  • 1/217391 according to tenhou.net ==> Is N large enough? As Mafu says: 650k is not much.
  • 1/330530 according to rascalhp ==> Can someone who speaks Japanese check the maths and compare it to Jan's ?

Come on people, we can crack this!

| improve this answer | |
  • 1
    I don't remember the further results I got from the program I wrote back then. I'll dig it out and let it run again. – mafu May 14 at 19:21
  • (edited my answer with the results) – mafu May 14 at 21:07
  • Notably, the linked page has 4250305029168216000 as the divisor, which @Jan said to be not correct. Maybe the calculation of the dividend is different to account for this. – mafu May 14 at 21:28
  • I’m off to a bad start as Rascalhp’s stats already have a different number of total possible dealer hands ^^' – Jan May 21 at 6:27
  • (I should also add that I can’t be pinged if I am not yet in the comment thread so I didn’t get your ping above but I should get all subsequent pings in this comment thread. Also, posts don’t ping. – Jan May 21 at 6:29
0

"Made" hands are those that satisfy certain requirements, specifically four "sets" of either triplets or "three in a row," plus a pair. There are also a handful of "special cases" of "made hands" that don't meet these requirements. If, after taking a tile, you don't have a "made hand" (in either regard), you need to discard a tile and try again.

The "special cases" are easily countable. The more common cases can be counted using a branch of math called "combinatorics" (the math of combinations). Increasingly powerful software programs can do this easily.

The older "authorities" probably lacked "combinatoric" capabilities, hence no tables from them. The answer (in the form of a table, or a descriptive function), could now well exist somewhere in the world. That may or may not include the western world, depending on how popular the topic of mahjong is among western problem solvers. But the answer appears attainable, and may soon be, if it hasn't been already.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.