Shanten
Shanten 「向聴」 refers to the minimum number of tiles required in order for a hand to reach tenpai. For example, a hand in 1-shanten (iishanten) is one tile away from tenpai, and thus two tiles away from winning.
Shanten counts
Lower shanten counts are better: the lower the shanten, the closer the hand is to tenpai, and thus the closer the hand is to winning.
The maximum shanten a hand can have is 6-shanten, since all hands are 6-shanten or lower for chiitoitsu. The maximum shanten a hand could be from the standard "4 groups + 1 pair" shape is 8-shanten.
Iishanten
Example: 1-shanten
Ryanshanten
Example: 2-shanten
Sanshanten
Example: 3-shanten
Counting shanten
Multiple methods can be used to count a hand's shanten. These can be used to get a quick, ballpark estimate of shanten during a game.
Lower bound estimate
For the standard "4 groups + 1 pair" shape, every "useless" tile (any lone honor tile; number tiles with no neighbors in a +/- 2 interval) must be discarded or grouped in order to reach tenpai. Therefore, the # of useless tiles will be the lower bound for the "4 group + 1 pair" shape. The shanten could be higher, but cannot be lower for the standard winning shape.
It is important to note that counting useless tiles does not account for chiitoitsu or kokushi musou.
minimumShanten = Useless_tiles
This method is most effective at the start of a game, and less towards the end.
Basic shanten
A hand with 13 disconnected tiles would be 8-shanten from the "4 groups + 1 pair" shape, the furthest you can get from that shape. Drawing a taatsu or pair will get you a tile closer to tenpai, thus reducing shanten by 1. Completing a taatsu/pair, thus forming a tile group, will reduce shanten by 1 again (2 total). This results in the following calculation:
- Every hand starts at 8-shanten. Each complete group reduces shanten by 2. Each taatsu/pair in hand reduces shanten by 1.
- However, a mahjong hand requires exactly 4 groups. This means the hand's (taatsu + pairs + groups) count is capped at 4. In other words, if a hand would have more than 4 taatsu/pairs/groups, any taatsu/pair past the 4th won't count.
- In addition to 4 groups, the hand requires at least one pair. So, when (taatsu + pairs + groups) > 4, having at least one pair will reduce shanten by 1.
For example, a hand with 6 taatsu and a lone tile is not (8-6=) 2-shanten; it is instead (8-4=) 4-shanten. A hand with 5 taatsu + 1 pair would be 3-shanten.
Note: A hand may be organized into different sets of groups. The interpretation with the lowest possible shanten is the correct answer. For example, "123456" could be interpreted as 1 complete group + 1 taatsu ("12 + 345 + 6") or 2 complete groups ("123 + 456"). In this case, the latter interpretation is clearly better. With more complex hands, it is less obvious which tiles to remove: it is essential to test every possibility or skip obvious possibilities.
basicShanten = 8 - 2 * groups - max(taatsu + pairs, 4 - groups) - 1, if at least one pair and (taatsu + pairs + groups) >= 5
Chiitoitsu
The shanten for chiitoitsu is always (6 - pairs). A hand with 6 pairs is tenpai for chiitoitsu, a hand with 5 pairs is 1-shanten, and so on.
chiitoitsuShanten = 6 - pairs
Kokushi
The shanten for kokushi musou is 13, minus the number of unique terminals/honors, then minus 1 if you have at least one pair. This means a hand with no terminals/honors is 13-shanten from kokushi.
kokushiShanten = 13 - unique_terminals - max(terminal_pairs, 1)
Accurate shanten formula
Base formula
The accurate shanten formula combines the formulas for standard form, chiitoitsu, and kokushi musou.
accurateShanten = Smaller of: * 8 - (2 * groups) - max(pairs + taatsu, 4 - groups) - min(1, max(0, pairs + taatsu + groups - 4) * 6 - pairs * 13 - diffTerminals - max(terminalPairs, 1))
Accurate correction (perfect shanten)
Calculating shanten with the above formula will give a proper result, where -1 indicates a complete hand, while any positive integer is the distance from tenpai.
However, when the result is 0, there is a chance that there are no existing tiles that could lead to creating a winning hand. If a hand is 0-shanten, but has all 4 copies of its own winning tiles, as in the below example, then it usually does not count as "tenpai" for the purposes of gameplay. (This only accounts for tiles in the hand, not tiles discarded or in other players' hands.)
If accurateShanten = 0, for all possibilities of tile: keep lowest accurateShanten(hand + tile) value (-1 or 0) and add 1 (for 0 or 1). The hand above, when any other tile is added to it, is never complete. A proper test would never make a 5th copy of 3p or 6p.
External links
|