Skip to content
Vamshi Jandhyala

Books · The Fiddler: Solutions

Chapter 72

Can You Survive Squid Game (Season 2)?

In “Mingle,” NN contestants play 3838 rounds. In round kk everyone must form groups of exactly kk; anyone left over is eliminated. What is the smallest NN for which at least one contestant can survive all 3838 rounds?

The Fiddler, Zach Wissner-Gross, January 10, 2025(original post)

Solution

Playing to save as many as possible, a count cc entering round kk leaves c/kk\lfloor c/k\rfloor\cdot k survivors. Round 11 keeps everyone, so the survivors evolve as cc/kkc\mapsto\lfloor c/k\rfloor k for k=2,3,,38k=2,3,\dots,38, and we need the final count to be at least 11 (hence at least 3838, a full last group). Searching upward, the smallest starting value that never collapses is N=454,N=\boxed{454}, which finishes with exactly 3838 survivors (the trajectory ends ,170,140,108,74,38\dots,170,140,108,74,38).

The computation

Run the elimination itself: from each starting NN, apply cc/kkc\mapsto\lfloor c/k\rfloor k round by round and reject any NN whose count ever hits zero. The first survivor is 454454.

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 11 to 1010, and the game runs until no one survives. For some N<500N<500, starting with N+1N+1 people instead of NN lengthens the expected game by about 1010 rounds. Which NN?

Solution

Let E(c)E(c) be the expected number of remaining rounds from cc contestants. Conditioning on the group size gg, and noting g=1g=1 (and any gcg\mid c) leaves the count unchanged, E(c)=10+g:  c/ggcE ⁣(c/gg)10#{g:c/gg=c}.E(c)=\frac{10+\sum_{g:\;\lfloor c/g\rfloor g\neq c}E\!\bigl(\lfloor c/g\rfloor g\bigr)}{10-\#\{g:\lfloor c/g\rfloor g=c\}}. Evaluating bottom-up, the jump E(N+1)E(N)E(N{+}1)-E(N) is about 1010 at exactly one place: N=359,E(360)E(359)9.94.N=\boxed{359},\qquad E(360)-E(359)\approx 9.94. The reason is arithmetic: 360360 is divisible by nine of the ten group sizes (all but 77), so it sails through most rounds intact, whereas 359359 is prime and collapses almost at once. (The official value is paywalled; this is my own, by the recursion above.)

The computation

Build E(c)E(c) bottom-up straight from the recurrence (each cc 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