
In Yahtzee you play with five dice, each with 6 numbers on it. This means that the number of different combination achievable in one roll is: 6 * 6 * 6 * 6 * 6 = 6^{5} = 7776. The combinations are:
1,1,1,1,1
1,1,1,1,2
1,1,1,1,3
…
2,1,1,1,1
2,1,1,1,2
…
6,6,6,6,6
In this game the following combinations are practically equal: 1,1,1,1,2 or 1,1,1,2,1 or 1,1,2,1,1 or 1,2,1,1,1 or 2,1,1,1,1.
If we take into consideration only distinct combinations, it turns out that their count is 252 and not 7776!
Note: in Yahtzee there are only 252 different combinations of the five dice.
Now, why is this important? If you develop a computer program which uses recursive calls and store many data in the memory, the number of different cases is really that counts. In Yahtzee you have 13 boxes, all unused at the beginning of the game. During the game play any combination of unused places can theoretically be encountered, so in total there are 8191 different box combinations.
And there we come back to the 7776 versus 252: it is not the same if we have to store
7776 * 8191 = 63 693 216 or only 252 * 8191 = 2 064 132 data in the memory.
Next
