The Prisoners and the Swap: Less than Half is Enough

Abstract

We improve the solution of the classical prisoners and drawers riddle, where all prisoners can find their number using the pointer-following strategy, provided that the prisoners can send a spy to inspect all drawers and swap one pair of numbers. In the traditional approach, each prisoner may need to open up to half of the drawers. We show that this strategy is sub-optimal. Remarkably, a single swap allows all n prisoners to find their number by opening only n n n (1 + o(1)) drawers in the worst case. We show that no strategy can do better than that by a factor larger than two. Efficiently constructing such a strategy is harder, but we provide an explicit efficient strategy that requires opening only O(n n n) drawers by each prisoner in the worst case.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…