Let’s Debunk Some Mahjong Superstitions!

Hey, this is UmaiKeiki, a very lazy mahjong player — although I’m often in the company of some real addicts. They’ve scoured the internet for anything and everything related to Mahjong, and found some really outrageous ideas. Are the tiles given by Tenhou really random? Is a hanchan really the same length as two tonpuusen? Questions like these, while not exactly about “luck” and the “flow of the game”, are a bit reminiscent of “occult” Mahjong, which is essentially the belief that random events in Mahjong are not really random.

Now there’s nothing terribly wrong with Occult Mahjong in that it can be a convenient way to explain away some minor issues — such as that awful losing streak you just had, or some secret technique you don’t want to share with everyone. However, it sure would be fun to test some of these claims against the mathematics of probability and statistics! Today we shall do exactly this, and see how well they stand up.

Are Tenhou’s Tiles Random?

Was that ippatsu tsumo your opponent just got really due to chance, or did the game rearrange the tiles to give it to him on purpose? Does Tenhou intentionally give you extra character tiles in your starting hand? The answer is no, such things don’t happen on Tenhou. According to the manual page, the walls are arranged randomly before the start of every game (random number generator / seed and wall generation). The walls are generated by Mersenne twister and can be recreated from the seed given in every game log, which looks something like this:

INIT seed=”0,0,0,2,4,76″ … shuffle=”mt19937ar,069A462D,7D366808,AE07C00E,CDB80045,F3637452,D39609BA,965B922D,DCDCC2BE”

In the past you could get the seed by observing your own games, and thus predict what everybody would draw. Fortunately Tenhou fixed that bug, but it proves tile order in the walls doesn’t change during the game.

One specific complaint I heard was that starting hands can contain 4-6 character tiles, which can be a significant slowdown when going for Pinfu. How many character tiles SHOULD you get in the beginning? A basic, if flawed, calculation might look like this:

(7 / 34) * 13 = 2.676

Now to see what the statistics say. I tallied how often starting hands had each number of character tiles for a large number of games, and here are the results:

We can see that it is most common to start with 2-3 character tiles in the hand. The average turned out to be 2.569. The feeling that you start with 4-6 all the time can possibly be explained that such hands are more memorable because of the added frustration. By the way, the probability of starting with 4 or more character tiles seems to be 26.425%, so it will probably happen at least once per game.

If this talk of games fudging the draws sounds like a complete joke to you, be aware that major poker sites are notorious for doing this as it makes them a LOT more revenue. The idea is to give everyone a big hand at the same time so they are more likely to push all in. I wouldn’t put it past any gambling site to do something like this, even Mahjong sites, so… (insert obligatory disclaimer to be wary of paysites)

Is A Hanchan Longer Than Two Tonpuusen?

Here’s an interesting one. A Tonpuusen is a game consisting of East 1st through 4th rounds. A Hanchan has East 1st-4th and South 1st-4th. So, by default, a Hanchan has exactly twice the number of hands as a Tonpuusen. What, then, would cause someone to regard a hanchan as longer than that? The answer: Ren Chans. Since a hanchan has more rounds, there are more opportunities for a renchan to occur. Of course, if you look at many games over time, the average number of renchans in a hanchan would turn out to be twice the average in a tonpuusen. Or would it? Let’s look at a large number of games and find out!

The average number of rounds per game were as follows:

Tonpuusen – 5.698
Hanchan – 10.766

From this data we can see that there isn’t much difference between one hanchan and two tonpuusen. One interesting observation is that while hanchan are more likely to have renchan, they are also more likely to end early because someone busted out!

Of course, this says nothing of player mentality when sitting down for a game. Since a hanchan is a “normal” game, someone joining a tonpuusen would be more interested in getting the game over with as fast as possible. Thus, the players might play for speed instead of strategy in order to end a tonpuusen quickly.

Is The Suit Of The Riichi Tile Significant?

I heard a rumour that the tile discarded after a Riichi declaration can be used to guess which suit contains the waits. Well, sure, in combination with the other discards, you can probably figure it out. But here’s a question: given only the tile discarded immediately after a Riichi declaration, can you ignore all other discards and identify a suit that’s more safe or dangerous than another? Here’s what the statistics say:

4475 Riichis examined,
1336 had a wait in the same suit as the discarded tile,
3139 had no waits in the same suit,
29.855% ratio.

So you should have a 1 in 3 chance of there being a wait in the same suit as the Riichi tile. And that’s exactly how it should be, since there are 3 suits. But is there any difference in early or late game? Let’s look at the turn number when the Riichis were made:

Both seem to follow the same curve. From this, I would conclude that turn number does not affect whether a riichi tile indicates nearby safe or dangerous tiles. This doesn’t mean you should start ignoring the riichi tile completely, though. Late game discards from the hand can often tell you what tiles that player considered important enough to keep when close to tenpai.

Have fun, and I wish you… statistically favourable odds.

36 thoughts on “Let’s Debunk Some Mahjong Superstitions!

  1. So basically, we’ve been right all the time, and them other people are wrong. As it should be.

    Edit: although I think you should do a truncated mean for the tonpuusen/hanchan topic.

  2. bps collected a lot of Tenhou logs and saved them here: http://arcturus.su/tenhou/gamelogs/

    I made a filter to only count 4-player games on the special or phoenix tables. That left me with only 970 total game logs, but it was enough to get over 20000 dealt hands and 4000 riichis.

    It also ensured the players in each game were of decent skill levels so I would get “optimal” hanchan length and riichi habits.

  3. With all these logs, we could be getting some actual useful data.

    But here I am counting how long hanchan are.

    Truly, this was a valuable and productive post. ( ´_ゝ`)

  4. The last thing about the riichi tile is flawed though. It works more than 1 in 3, IF you consider the discards as a whole, which those numbers don’t do.

    A quick think shows you why that’s logical. You wouldn’t reach on a tile from your final wait suit unless:

    a) you just upgraded your previous tenpai before reaching (e.g. kanchan->ryanmen)

    b) your reach tile is pretty much a junk tile (one you never really needed to hold on to)

    c) that suit doesn’t show up in your earlier discards because you are collecting it predominantly

    if you watch some replays with the hands open you’ll start to see it at work. the analysis you have here does not disprove it.

  5. Sumio: Uh… wait…

    So basically you’re saying: “watch this small sample of hands and you’ll see I’m right” vs Umai saying “I analyzed 20,000 hands, and the riichi tiles has a 1:3 ratio of being in the same suit.”

    We’re not talking about the discards as a whole, we’re talking about a claim elsewhere on the internet that the tile discarded for riichi is “almost never” in the same suit as the final wait.

  6. Will figure out how to have a look at those gamelogs.

    Question though:

    In those stats you have about riichis compared to reach-tile suit, how are non-suit tiles counted?

    Is there a way to compare the two numbers WITHOUT counting non-suit tiles or tsumokiri-reaches?

    Finally, as with most reading techniques they only apply to two-sided waits. Is there a way to narrow down the numbers to include only those?

    If after filtering all these things out, you still get a 1-in-3, I stand corrected. However, I’d be very surprised.

    Also, 29% is nevertheless slightly less than 1 in 3…. but…. I’m most interested in the final analysis.

  7. Well… this is a post about superstitions so I don’t know how useful it would be to add in extra checks and conditions when there’s nothing that really affects gameplay or strategy.

    What would be really worthwhile, though, is how you can tell that someone is using a ryanmen wait when they riichi. Now that would be some useful information right there.

  8. Not sure what you mean.

    I’m asking to tighten up the statistical check, not chase empty superstitions.

    As far as ryanmen, I’m not sure of a technique although there was an article on reachmahjong.com explaining how to detect dual set waits.

  9. But there’s the problem. If that tile is significant under certain conditions, the information is useless if we can’t tell during a game whether those conditions have been met. I would be much more interested in knowing these things during a game rather than looking at logs where we can see everyone’s hand.

    Also, link to that article?

  10. With UmaiKeiki’s help I have now got every houou game log ever (and new ones are automatically downloaded every day at 2-3AM JST). May be useful to Sumio/MotelFSR so he can do some analysis himself rather than asking UmaiKeiki to. =3=

  11. How do you use that link?

    As far as I can see you get access to replays, but how do you look at stats and crunch numbers?

  12. Do we have to teach you everything? Do some programming!

    Also, Umai – I’ve shit for us to analyze (fuck you, German keyboards) when I get home. Fuck EMA and their shit, I’m getting open tanyao into the rules.

    >Is there a way to compare the two numbers WITHOUT counting non-suit tiles or tsumokiri-reaches?
    Of course there are. Don’t use the hands where a riichi tile is a non-numbered suit (don’t know if Umai counted them or not, but given the numbers, I’m thinking he didn’t). What’s tsumokiri got to do with it though? Although if you want to protect your theory that badly, then yes – that can be done as well (I suspect – if how they pull numbers is anything like I think it is).

    But you can do that yourself now that you’ve access to the game logs.

    Also guys, 0x23mahjong update with whining about weather in Vienna and shit like that. And German keyboards.

  13. Program it myself? Don’t even know how to begin doing that.

    If you guys have figured out how to do it why not share with the community?

  14. Seriously though there is no DEFINITIVE TOOL to do this analysis with. UmaiKeiki used part of my util.pl and did the rest in perl to analyze it. I can assure you that all the tools are subjective and completely inapplicable to any other sort of “analysis”.

    In short, like the Oxfordshire county council IT system, it “runs on an intricate series of complex and unintelligible perl scripts.” It is not to be understood.

  15. The Russians are right, though, there’s no one way to do this. Each log contains a packet for every event that happens in a game so you have to pick and choose the ones that are relevant to your study.

    Now that I think about it, the results are kind of skewed by character tiles. I’d let this slide since this study doesn’t have any practical application, but there seem to be a lot of controversial views so I’ll redo it so that it doesn’t count character tiles.

    3996 riichis,
    1283 had a wait in the same suit.
    Ratio: 32.107%

    There we go. This seems to be a bit closer to our expected outcome of 33%. Perhaps I’ll remove tsumokiri later.

  16. Tsumokiri is the last 0.807%

    Bahahaha. I’m so amused. Could be because I’m drunk of mz arse and it#s been hot as hell here. WTF Vienna, WTF?

    Went to … eh fuck it, I#ll post it on 0x23 tomorrow. Also, shitload of asians here, although most seem to be chinese. ezed a pair of hot chicks, but once thez started talking german I lost all interest.

    Otherwise, Vienna is a cool ciotz. Lots of museums to act like a faggot in and whatnot.

  17. Hmm, I removed tsumokiris as well, didn’t seem to make much of a diference though.

    3841 riichis
    1240 had a wait in the same suit
    Ratio: 32.283%

  18. Might be on to something here. Here’s the statistics for riichis on ryanmen-like waits only:

    2744 riichis
    725 had a wait in the same suit
    Ratio: 26.421%

    You can see why a strategy for spotting ryanmen waits is important here. Even though a large number (71%) of the riichis were on ryanmen-like waits, we can’t tell they are ryanmen waits in-game with such certainty. That makes any strategy that could come of this useless as long as the overall probability of there being a wait in some suit is 1 in 3. Any ideas?

  19. Yeah; it’s just superstitions – there’s no real way for us to look at the riichi tile and say “Ok, that suit is safe.” Hell, I’d go so far as to say that it’s safer to discard the idea completely than base a strategy around it/incorporating it into current tactics.

  20. Actually i think you can build a strategy around it-

    i.e. if you want to fold completely, throw 100% safe tiles as far as possible.

    However, if you have to resort to suji reading (such as 1-4-7) and all related methods, you might as well consider that the reach-tile suit is only dangerous in 1 out of 4 times.

    This is simply because you’ll be assuming that the wait is ryanmen by default, if you are going to bother with suji reading. Don’t use it if you can help it, but sometimes you have no other choice.

    Now, if you can combine this with actually spotting when a wait is not ryanmen, then you’re really onto something.
    Here’s a link to the article I mentioned concerning that:


    You might want to read the previous article to review the questions posed.

  21. One more point: the strategy can be more or less effective defending on the player. Some people almost always only reach when they have ryanmen. Depends how much of a read you have.

    Obviously there will never be a failsafe reading strategy in a game like this but every little edge can help.

  22. I think that it would be a mistake to assume there is a 1 in 4 chance every time when the statistics showed an overall 1 in 3 chance. The problem is that you can get a 1 in 4 chance only under unknown conditions, so to just blindly assume them means you’ll still get bitten 1 time in 3.

  23. well, yeah, but not if you combine it with what that article showed (the one i linked from reachmahjong.com).

    also, like i said, sometimes you have no choice but to make defensive decisions based on assuming ryanmen-waits. pulling out these things is an edge you will occasionally want to exploit if you simply have no safer options.

    i also wonder whether the frequency of ryanmen reaches increases if you filter out early-turn reaches and such. i think you can also at times sense when you are up against non-ryanmen waits because the discards don’t make ‘sense’ as they usually do (basically an extension of what is mentioned in the article).

  24. I would really like to see a graph representing “turn number of riichi” in function of “average value of the hand.” Of course I have a pretty good idea what it will look like, but who knows when it will display some surprising/mildly interesting data.

  25. Math and Statistics are cute, but only scratch the surface of the game. If anything, having a solid understanding of the mathematical aspect of the game is merely a basic requirement to improving beyond beginner-level play.

Leave a Reply

Your email address will not be published.