Books · The Fiddler: Solutions
Chapter 72
Can You Survive Squid Game (Season 2)?
In “Mingle,” contestants play rounds. In round everyone must form groups of exactly ; anyone left over is eliminated. What is the smallest for which at least one contestant can survive all rounds?
The Fiddler, Zach Wissner-Gross, January 10, 2025(original post)
Solution
Playing to save as many as possible, a count entering round leaves survivors. Round keeps everyone, so the survivors evolve as for , and we need the final count to be at least (hence at least , a full last group). Searching upward, the smallest starting value that never collapses is which finishes with exactly survivors (the trajectory ends ).
The computation
Run the elimination itself: from each starting , apply round by round and reject any whose count ever hits zero. The first survivor is .
def survives(N):
c = N
for k in range(2, 39):
c = (c // k) * k
if c == 0: return False
return c >= 1
N = 1
while not survives(N): N += 1
print(N) # 454
Extra Credit
Now each round’s group size is drawn uniformly and independently from to , and the game runs until no one survives. For some , starting with people instead of lengthens the expected game by about rounds. Which ?
Solution
Let be the expected number of remaining rounds from contestants. Conditioning on the group size , and noting (and any ) leaves the count unchanged, Evaluating bottom-up, the jump is about at exactly one place: The reason is arithmetic: is divisible by nine of the ten group sizes (all but ), so it sails through most rounds intact, whereas is prime and collapses almost at once. (The official value is paywalled; this is my own, by the recursion above.)
The computation
Build bottom-up straight from the recurrence (each depends only on strictly smaller counts), then scan for the largest one-person jump.
E = [0.0] * 501
for c in range(1, 501):
k = sum(1 for g in range(1, 11) if (c // g) * g == c)
s = sum(E[(c // g) * g] for g in range(1, 11) if (c // g) * g != c)
E[c] = (10.0 + s) / (10 - k)
print(max(range(1, 500), key=lambda N: E[N + 1] - E[N])) # 359