Picture

Hi, I'm Chris Kang.

I'm Chris, a CS Major at the University of Washington. I'm fascinated by quantum computing, macroeconomics, and any field that unites different perspectives with mathematics to create impact.

Home \\ Blog

Modeling Mahjong

My family - they love Mahjong. They play it religiously on weekends - it’s like clockwork. And, it always sparks a debate as to who is truly more skilled vs who is more lucky. So, I set out to perform some analysis.

Mahjong & Assumptions

Mahjong is a zero-sum game - the tokens you earn directly follow from someone else’s losses. There are four players, and typically an entire “game” takes place over multiple rounds. Our first assumption is that:

  • The overall game of Mahjong will be modeled, versus modeling individual rounds

This was made primarily because available data only recorded game-level data. Second, the dynamics of mahjong is related pretty heavily to seating order - plays move counterclockwise and only some discarded tiles can be “eaten” by the person to immediately follow. We simplify this by assuming:

  • Data is drawn uniformly from all potential seating arrangements

Model

Call $p_i \sim \mathcal{D}_i$ to be the skill of person $i$ drawn from a specific distribution $\mathcal{D}_i$. Because Mahjong is a zero-sum game, the total winnings/losses must add to zero. So, take the reward for each player $r_i$ to be:

\[r_i = p_i - \overline{\mu}\]

Where $\overline{\mu}$ is the average skill level of all other players in that game. This model is useful because it accounts for the inherent randomness of tiles provided and variability in player performance. It is also justifiable in the real world - in particular, if everyone is given a bad hand (all $p_i$ small), then the rewards would be comparable as if everyone had a good hand (all $p_i$ large).

For the $\mathcal{D}_i$, we take this to be $\mathcal{N}(\mu_i, \sigma_i^2)$ for convenience. Then, this becomes an optimization problem to identify $\mu_i, \sigma_i$ which best fits the data.

Identifying variables from data

We begin by simplifying $r_i$ to identify the distribution that it is drawn from. Note that $\overline{\mu} = \frac{1}{4}(p_1 + p_2 + p_3 + p_4)$, so $p_i - \overline{\mu} = \frac{3}{4} p_i - \frac{1}{4}\sum_{j \neq i} p_j$. Thus,

\[r_i \sim \mathcal{N}(\frac{3}{4} \mu_i - \sum_{j \neq i} \mu_j, \frac{1}{2} \sigma_i^2 + \frac{1}{16}\sum \sigma_j^2)\]

Thus, given the normality of our rewards observed, we should be able to solve for $\mu_i, \sigma_i$.

Empirics

Considerations

The result of our analysis suggests that our $r_i$ should be normal. So, normality testing on these variables is necessary - one way is graphically looking at the CDF