Sunday, November 1, 2020

A Game of Hot Pumpkin, or How I Was Left Holding the Chinese Remainder

In a game of Hot Pumpkin with $61$ people, the players count off clockwise upward from $1$ to $N$, eliminating the $N$th player and then then beginning again with the player to the left of the most recently eliminated. The integer value of $N$ is mutually agreed upon prior to beginning the game.

I start and say $1$, with the first eliminated player sitting $18$ spots to my left. Then Ricky starts up the next round and the person $31$ spots to her left is eliminated next. Zach both begins and is eliminated in the third round.

Based on the first three eliminations, what is the smallest value of $N$?

This game sets up as an example of the Chinese remainder theorem, which states that the system of congruences involved in this game, namely \begin{align*} N & \equiv 19 \mod 61 \\ N & \equiv 32 \mod 60 \\ N & \equiv 1 \mod 59,\end{align*} has a single unique solution in $\mathbb{Z}_{59 \cdot 60 \cdot 61} = \mathbb{Z}_{215940}.$

For any two congruences, $N \equiv a_1 \mod n_1$ and $N \equiv a_2 \mod n_2,$ with $\text{gcd}(n_1,n_2) = 1,$ we can use Euclidean algorithm to calculate the integer solution to $$m_1 n_1 + m_2 n_1 = 1$$ that is asserted by B\'{e}zout's identity. From here, we note that $$N = a_1 m_2 n_2 + a_2 m_1 n_1 \mod n_1 \cdot n_2 $$ is a solution to both congruences.

So in particular, we see that $(m_1, m_2) = (1, -1)$ is a solution to $61m_1 + 60m_2 = 1$ and hence $$N = 19 \cdot (-1) \cdot 60 + 32 \cdot 1 \cdot 61 \mod 61 \cdot 60 = 812 \mod 3660$$ is a solution to the first two congruences of our game of Hot Pumpkin.

Continuing onward, we can use the extended Euclidean algorithm to find that the solution to $3660m_1 + 59m_2 = 1$ is $(m_1, m_2) = (-29, 1799).$ This gives the smallest possible solution to all three congruences as \begin{align*}N &= 812 \cdot 1799 \cdot 59 + 1 \cdot (-29) \cdot 3660 \mod 3660 \cdot 59\\ &= 86080352 \mod 215940 \equiv 136232.\end{align*}

No comments:

Post a Comment