Probability

Revision as of 19:08, 25 September 2016 by Senechal (talk | contribs) (Probability: WIP. Don't shoot the messenger.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
    • WORK IN PROGESS**

Probability in mahjong is a concept that can be applied to many different situations. Because unlike chess, go or shogi, playing mahjong is an incomplete-information game, requiring players to predict outcomes and chances of completing their hand, reaching tenpai, improving their hand state (lowering tenpai or raising uke-ire (the useful tile count)), as well as attempting to project what an opponent can be waiting on. Naturally, some of these are difficult concepts to describe with mathematical models.

Basic concepts and variables

  • A, B, C, D as indices: for player 1, 2, 3, 4.
  • E as index: total for everyone.
  • X as index: explanatory concept.
  • X, Y, Z as indices: the three-tile indices for a function requiring inputs from 2-shanten or better.
  • numCopies: The number of copies of any given tile.
  • remTiles: The number of tiles remaining in a game. Equal to 136 - 1 - discardPonds - handE - 3 * calls - 2 * kans; as the number of kans reveal an extra tile for the group and an extra tile in the dead wall. This concept may be different according to the perspective of who is counting. A single player may not know that his opponents may have all his tiles buried in his hand.
  • remDrawsX: The number of draws left for a given player, or the entire table.

Chance of any given tile occuring once

P(tile) = numCopies(tile) / remTiles

Chance of a subset of tiles occuring once

{Sum: (tile=0 to 33)} numCopies(tile) / remTiles

Chance of drawing from a subset (tsumo chance)

S = 1 - notS; notS = ({Sum: (tile=0 to 33)} numCopies(tile) / remTiles)^remDrawsE

Chance of calling a final tile from a subset (ron chance)

R = 1 - notR; notR = ({Sum: (tile=0 to 33)} numCopies(tile) / remTiles)^(remDrawsE - remDrawsX)

Chance of winning (raw chance, at tenpai stage)

W = 1 - (notS * notR); note that raw chance will give numbers whose total can easily exceed a total probability of 1. This is to be expected.

Chance of not having a win declared in one full turn

Q = notWA * notWB * notWC * notWD

Chance of winning (net chance)

N = WA + {Sum: (i=1 to remDrawsA)} [ WA * Qi ]
    + if(remDrawsE - 4 * remDrawsA >= 1;1;0) * notWA * notWB * QremDrawsA
    + if(remDrawsE - 4 * remDrawsA >= 2;1;0) * notWA * notWB * notWC * QremDrawsA
    + if(remDrawsE - 4 * remDrawsA >= 3;1;0) * Q * QremDrawsA