Dice snake

from Wikipedia, the free encyclopedia

The dice snake is an experiment by the Mathematikum in Gießen , which can also be performed as a magic trick .

A magician asks a spectator to throw about 50 dice and place them in a row, like this:

6 4 2 5 3 2 1 6 1 4 4 4 1 3 3 2 6 2 4 1 3 1 1 5 5 5 1 3 6 1 5 6 1 3 5 4 1 3 3 4 5 1 5 1 3 5 4 1 2 1

The viewer should now secretly choose one of the first six dice. For example, he chooses the second die. His number is 4. According to this number he should jump on the dice snake. So he gets to the sixth die with the number 2. The viewer should repeat this jumping according to the number until he can no longer jump within the dice line. In the example above, the following cubes are selected one after the other:

6 4 2 5 3 2 1 6 1 4 4 4 1 3 3 2 6 2 4 1 3 1 1 5 5 5 1 3 6 1 5 6 1 3 5 4 1 3 3 4 5 1 5 1 3 5 4 1 2 1

The magic trick is for the magician to guess the last die chosen. In the example this would be the penultimate die with the number 2.

Dissolution of the trick

How does the magician find out the last cube chosen by the audience? He just starts with the first die and secretly jumps in the same way as the spectator. In the example it would look like this:

6 4 2 5 3 2 1 6 1 4 4 4 1 3 3 2 6 2 4 1 3 1 1 5 5 5 1 3 6 1 5 6 1 3 5 4 1 3 3 4 5 1 5 1 3 5 4 1 2 1

Already on the 8th die, the magician meets the spectator's die and from then on he always chooses the same die as he does.

Calculating the probability

Obviously, the trick doesn't always work. For example, if the viewer rolls the following numbers

6 6 6 6 6 6 6 6 6 6 6 ...

the magician can only guess the last die chosen if he knows the first die chosen. Number sequences in which the jump sequences of the magician and the audience do not converge are very rare.

appraisal

The following is an estimate of how likely the trick is at least to work. To do this, one calculates an upper estimate that the trick does not work. You pick out the situation before a jump, for example

6 1 4 4 4 1 3.

Since jumps consist of a maximum of six dice, the spectator must have chosen at least one of the numbers 1 4 4 4 1 3. The probability that the last 3 is below it is at least . So the probability that the magician will miss the viewer's die at this step is at most .

The magician will do 50 / 3.5 jumps on average . So the probability of missing the spectator's dice on every jump is at most . This means that the probability of the trick being successful is at least , which corresponds to about 92%.

Exact calculation

The probability of the trick succeeding can also be calculated precisely. It is the probability that magicians and spectators exactly at (n + 1). Dice meet (not before). The probability that both meet up to the nth die is therefore

or simplified

.

There are various efficient methods for calculating the matrix power based on eigenvalue decomposition or binary exponentiation .

The matrices and vectors used are

  • the unit vector with ,
  • the start vector with ,
  • the transition matrix with .

For 50 dice you get a 99.17% probability of the trick being successful.

The calculation works as follows: One follows how the magician and the audience simultaneously jump along the cube line. One considers a section of 6 consecutive cubes and shifts this section by one cube to the right with each matrix multiplication . The vector describes the section from (n + 1). to (n + 6). Cube. This vector contains an element for every possible position of magician and spectator, whereby there is no distinction between magician and spectator. This is why the vector ( binomial coefficient ) has elements, ie 21. In the vector, the possible pairs are sorted lexicographically .

If one of the participants is exactly at the beginning of the section, he may throw the dice once and make the corresponding jump. All possible transitions are recorded in the matrix with their probability. There are two cases:

  • One of the participants stands at the beginning of the section and rolls the dice. There are 6 different options for a new constellation. This case is recorded in the matrix with the transition probabilities .
  • None of the participants is at the beginning of a section. Relative to the beginning of the section, both participants slide one position to the left. These cases are entered in the matrix with the probability .

More precise estimate

The spectral radius of the matrix is approximately 0.9083578428. In this way, you get a very good approximation of the probability of the trick being successful, which becomes better the more dice you use.

See also

  • Kruskal's Card Trick: A very similar trick with cards, but far more difficult to analyze the probabilities

Web links