🚪 Part A: 100 Doors
A1.Divisors of 36: 1, 2, 3, 4, 6, 9, 12, 18, 36 → 9 divisors
A2.Door 36 will be open. It has 9 divisors (odd number), so it is toggled 9 times — starting closed, it ends open. 36 is a perfect square (6²), so its square root (6) pairs with itself.
A3.Door 20 has pairs (1,20), (2,10), (4,5) — each pair produces 2 toggles (open then closed). With 3 pairs = 6 toggles total (even), the door returns to its original closed state.
A4.9 is a perfect square. Its square root (3) is its own divisor pair because 3×3=9. This "unpaired" divisor makes the total count odd (3 divisors), so the door is toggled an odd number of times and ends open.
A5.1, 4, 9, 16, 25, 36, 49, 64, 81, 100 — the perfect squares from 1² to 10².
A6.With 200 doors, the open doors are perfect squares up to 200. Since √200 ≈ 14.14, there are 14 open doors (1², 2², …, 14²). The rule is: the number of open doors = ⌊√n⌋ where n is the total number of doors.
🔢 Part B: 100 Prisoners
B1.Each prisoner opens 50 out of 100 boxes → P(success) = 50/100 = 1/2 = 50%
B2.P(all 100 succeed) = (1/2)¹⁰⁰ ≈ 7.9 × 10⁻³¹. This is effectively zero because 100 independent events each with 50% probability compound: the joint probability decreases exponentially with each additional prisoner.
B3.Prisoner 4: Box 4 → reads 6 → Box 6 → reads 2 → Box 2 → reads 7 → Box 7 → reads 4 ✓. Cycle: 4→6→2→7→4 (length 4). Found in 4 steps (well within 50).
B4.If a cycle has length 51+, all prisoners in that cycle need to traverse the full cycle to find their number — but they only have 50 turns. No prisoner in that cycle can succeed regardless of what they try. Switching to random search doesn't help because the cycle-following strategy is already optimal; random search could accidentally miss the slip even if it lands in a shorter chain.
B5.31.18% of 10,000 groups = approximately 3,118 groups would go free.
B6.Verification: 1 − Σ(1/k for k=51 to 100) ≈ 1 − 0.6882 ≈ 0.3118 ✓. Each term 1/k gives the probability that a specific element (say prisoner 1) belongs to a cycle of exactly length k — there are C(99, k−1) ways to choose the other k−1 members, but the probability a particular labelled cycle of length k exists in a random permutation of 100 is exactly 1/k. Summing over all "fatal" lengths (51–100) gives the failure probability.