Simulations

Background

In order to make some predictions about how often certain scoring possibilities arise, it is sometimes helpful to turn to simulations. Simulations can help when the complete solution would be impractical to compute, or when a model is close enough to the real problem to be helpful, or when the real problem is not well enough understood but some understanding is desired.

Opportunities for Pung and Kong

For this simulation, I attempt to find out the relative and absolute frequency of

  1. Concealed Kong
  2. Melded Kong, where I have 3 identical tiles and the 4th gets discarded
  3. Promoted Kong, where I have 2 identical tiles, a 3rd gets discarded, and I later get the 4th
  4. Concealed Pung, where I have 3 identical tiles and the 4th appears before my 2nd
  5. Melded Pung, where I have 2 identical tiles and a 3rd appears later

In order to avoid building an entire game simulator with intelligent opponents, I simplified the game into an idealized scenario. Imagine getting all the tiles you would get from a wall game (which is 1/4th of the 136 tiles in a game excluding flowers). Each player then turns over tiles one by one but at the same time. If someone turns over a tile that you already have 3 of in your hand, you can count a Melded Kong. If someone turns over a tile and you already have a pair, you can count a Melded Pung; and further if you later discover the 4th in your hand, you can instead count a Promoted Kong. That is the basis for my simulation.

I shuffle the tiles and divide them into four hands. Each hand has the tiles numbered (from 1 to 34) to give them some order. For each hand and for each of the 34 different tiles, I evaluate the following test:

if I have all 4 of the tile, count a Concealed Kong opportunity
if I have 3 of the tile, and the 4th appears in another hand after my 3rd, count a Melded Kong opportunity
if I have 3 of the tile, and the 4th appears in another hand after my 2nd, count a Promoted Kong opportunity
if I have 3 of the tile, and the 4th appears before my 2nd, count a Concealed Pung opportunity
if I have 2 of the tile, and the 3rd appears in another hand after my 2nd, count a Melded Pung opportunity

I wrote a program in C using the Standard Library to generate the random numbers. Since I am fairly certain the random number generator has at least 32 bits of entropy, I stopped the simulation at 3.5 billion deals, which generated 14 billion hands. (After 4.2 billion simulations, the deals may have repeated.) The following table describes the frequency of opportunity for each particular scoring element. For example, one hand in 9.334 should have one chance for a Concealed Kong, and about one hand in 65 will have no chances for a pung of any kind!

There are several factors stopping you from getting each kong or pung, however:

  • You don't know which tile to keep to match the tiles you'll get later in the game
  • Other players will not be discarding randomly
  • Someone else may win before you get all the tiles
  • There are scoring opportunities you want to achieve but must discard the matching tile to do so
  • The tiles you would get are in a Kong box
  • Players claiming kong get extra tiles
  • etc.
Number of Chances Concealed Kong Melded Kong Promoted Kong Any Kong Concealed Pung Melded Pung Any Pung
0 1.125 1.436 1.504 0.444 2.350 64.92 2.268
1 9.334 3.797 3.537 1.531 2.510 12.56 2.092
2 242.2 26.56 20.91 11.16 6.854 5.413 3.024
3 15,880 382.0 239.7 145.9 36.94 3.936 3.557
4 2,573,000 10,470 4,909 3,337 361.7 4.343 4.291
5 1,400,000,000 534,000 176,500 132,600 6,308 6.908 6.900
6 58,820,000 11,120,000 9,352,000 200,600 15.45 15.45
7 14,000,000,000 1,556,000,000 1,400,000,000 12,300,000 48.17 48.17
8 3,500,000,000 209.7 209.7
9 1,291 1,291
10 11,500 11,500
11 154,200 154,200
12 3,199,000 3,199,000
13 122,800,000 122,800,000
14 7,000,000,000 7,000,000,000
4 or more 2,568,000 10,260 4,774 3,254 351.5 2.145 2.132

Because of the rarity of some events (such as 14 chances for a melded pung), the very large numbers should probably be disregarded.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NoDerivs 3.0 License