Shanten: Difference between revisions

From Japanese Mahjong Wiki
Jump to navigation Jump to search
No edit summary
Line 20: Line 20:


Often, the decision to open the hand rests on the tiles needed and the yaku most conveniently acquired.  In addition, the shanten count may play a factor too, especially at 1-shanten where a discarded tile could put the hand into tenpai.
Often, the decision to open the hand rests on the tiles needed and the yaku most conveniently acquired.  In addition, the shanten count may play a factor too, especially at 1-shanten where a discarded tile could put the hand into tenpai.
== How to count shanten ==
There are ways to count shanten and ways to count quick shanten estimates. The variable names below are obvious enough, but with the extra precision that a hand or sub-hand that has groups removed will not include pairs with tiles removed.
=== Minimum shanten ===
Minimum shanten can easily be checked by how many useless tiles are in hand (any single 3 away, plus single word tiles). It is important to remember that seven pairs and kokushi musou will ignore this basic calculation.
Minimum = min(uselessTiles, 6 - pairs, 13 - terminals - max(terminalPairs,1)).
This method is most effective at the start of a game, and less towards the end.
=== Maximum or basic shanten ===
Maximum shanten can easily be estimated by naïvely removing groups from the hand, then counting pairs, then taatsu. Assuming no pairs are present, the worst shanten count is always 6. Removing different possible groups will lead to different results: the lowest result from the universe of removable groups is the correct result.
Maximum = max(8 - 2 * groups - max(pairs + taatsu, floor(hand.length/3)-g) - min(1,max(0,p+t-(4-g))), 6).
=== Accurate shanten ===
Accurate shanten uses the maximum formula, and then includes the conditions for seven pairs and kokushi musou.
AccurateShanten = min(8 - 2 * groups - max(pairs + taatsu, floor(hand.length/3)-g) - min(1,max(0,p+t-(4-g))), 6 - pairs, 13 - terminals - max(terminalPairs,1)).
=== Accurate correction (perfect shanten) ===
Calculating accurate shanten will give a proper result, -1 indicating a complete hand, any strictly positive integer indicating a distance from tenpai. However, when the result is zero, there is a chance that there are no tiles existing that could lead to creating a winning hand. From 34 possible tiles, trying out every tile ''not present in four copies'' should lead either to a complete hand (-1), or a hand that is "still tenpai" (0). A tenpai hand that can't win does not exist, usually because of the need of a 5th copy of a tile. This does not take into account tiles discarded or melded by other players. Only one's hand and one's melds count against this limit.
{{#mjt:3456p111m}} {{#mjt:3'336'66p}}
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==
==External links==

Revision as of 20:50, 11 April 2015

Shanten 「向聴」 is the number of tiles needed for reaching tenpai. It can also be viewed as the minimum number of tile draws or tile calls required to attain tenpai.

Shanten counts

The lower the shanten count, the closer the hand is to tenpai. Naturally, that is advantageous as far as tile efficiency is concerned. After all, the sooner the hand gets to tenpai, then the sooner can the hand win. For every shanten count, the hand needs any needed tile just to reduce that count.

Iishanten

Example: 1-shanten

Needs: Any to tenpai.

Ryanshanten

Example: 2-shanten

Needs: Any to 1-shanten.

Sanshanten

Example: 3-shanten

Needs: Any to 2-shanten.

Open vs closed

Often, the decision to open the hand rests on the tiles needed and the yaku most conveniently acquired. In addition, the shanten count may play a factor too, especially at 1-shanten where a discarded tile could put the hand into tenpai.

How to count shanten

There are ways to count shanten and ways to count quick shanten estimates. The variable names below are obvious enough, but with the extra precision that a hand or sub-hand that has groups removed will not include pairs with tiles removed.

Minimum shanten

Minimum shanten can easily be checked by how many useless tiles are in hand (any single 3 away, plus single word tiles). It is important to remember that seven pairs and kokushi musou will ignore this basic calculation.

Minimum = min(uselessTiles, 6 - pairs, 13 - terminals - max(terminalPairs,1)).

This method is most effective at the start of a game, and less towards the end.

Maximum or basic shanten

Maximum shanten can easily be estimated by naïvely removing groups from the hand, then counting pairs, then taatsu. Assuming no pairs are present, the worst shanten count is always 6. Removing different possible groups will lead to different results: the lowest result from the universe of removable groups is the correct result.

Maximum = max(8 - 2 * groups - max(pairs + taatsu, floor(hand.length/3)-g) - min(1,max(0,p+t-(4-g))), 6).

Accurate shanten

Accurate shanten uses the maximum formula, and then includes the conditions for seven pairs and kokushi musou.

AccurateShanten = min(8 - 2 * groups - max(pairs + taatsu, floor(hand.length/3)-g) - min(1,max(0,p+t-(4-g))), 6 - pairs, 13 - terminals - max(terminalPairs,1)).

Accurate correction (perfect shanten)

Calculating accurate shanten will give a proper result, -1 indicating a complete hand, any strictly positive integer indicating a distance from tenpai. However, when the result is zero, there is a chance that there are no tiles existing that could lead to creating a winning hand. From 34 possible tiles, trying out every tile not present in four copies should lead either to a complete hand (-1), or a hand that is "still tenpai" (0). A tenpai hand that can't win does not exist, usually because of the need of a 5th copy of a tile. This does not take into account tiles discarded or melded by other players. Only one's hand and one's melds count against this limit.

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