medium · Information, deduction and strategy puzzles
One hundred prisoners are numbered . In a room stand opaque boxes, also numbered . Slips bearing the numbers are placed one per box according to a permutation drawn uniformly at random from all arrangements; slip sits in box , i.e. box contains slip .
The prisoners are led in one at a time. Each may open at most boxes, look inside, and must then leave the room exactly as he found it, communicating nothing to those who follow. If every prisoner opens the box containing his own number, the whole group is freed; if even one fails, all are executed.
Before the first prisoner enters, the group may agree on a strategy. During the trial there is no communication and no observation of who has gone before. Assume each prisoner can condition his choices only on his own number and on what he sees in the boxes he opens.
Every prisoner uses the same rule, keyed to his own number. Prisoner opens box first. He reads the slip inside; if it is his own number he is done, otherwise he opens box next, reads , opens that box, and so on. He follows the chain for up to steps.
The naive alternative — each prisoner opens boxes at random — gives success probability , and it is tempting to conclude the situation is hopeless. The whole point is that a fixed random search treats the prisoners' fates as independent, whereas the cycle-following rule couples them to a single global event.
Under this rule the sequence of boxes prisoner opens is exactly the forward orbit of under . Since is a permutation of a finite set, that orbit is the cycle of containing , and the box holding slip is the box — the element that maps to , i.e. the predecessor of on its own cycle. Following eventually returns to , and the step just before returning lands on box , which contains slip .
Hence prisoner finds his slip on some step, and he reaches it within openings iff the cycle containing has length at most . This is the step a candidate misses: the individual success events, one per prisoner, all reduce to statements about the same object, the cycle lengths of .
Therefore
A permutation of elements can have at most one cycle of length exceeding , since two such would need more than elements. So the failure event is a disjoint union over of " has a cycle of length exactly ."
Count permutations of with a distinguished cycle of length : choose the members in ways, arrange them in a cycle in ways, and permute the remaining arbitrarily in ways: With , the probability of having a cycle of length exactly is . Summing the disjoint cases, where . Thus Numerically , so the group survives with probability
For prisoners each opening boxes, the same argument gives Since (a Riemann sum for ),
Remarks. The success probability stays bounded away from no matter how many prisoners there are — the striking feature of the puzzle. It is also a theorem (Curtin–Warshauer) that no strategy beats the cycle-following one, so is the optimal survival probability, not merely one achievable value.
Final answers. (1) Follow the cycle from your own box; the group is freed iff has no cycle longer than . (2) . (3) .
hard · High-dimensional regression, the lasso and sparse recovery
Consider the linear model with deterministic design whose columns are normalized so that for all , and noise . Fix and let Write , , , and assume .
(a) State the subgradient stationarity (KKT) conditions. Construct the primal-dual witness (PDW) candidate that is forced to be supported on . Prove that if the induced dual vector satisfies the strict feasibility condition , then every optimal solution of the lasso is supported in and equals the constructed candidate (i.e. the solution is unique). Point out precisely where is used.
(b) Derive the explicit expression for in terms of and the blocks of . Assuming the irrepresentable (mutual incoherence) condition give a sufficient condition on (and the required lower bound on for the signs to be preserved) guaranteeing exact sign recovery with high probability, and show that suffices.
(c) Now take , , the noiseless case , , and (i) For which is ? (ii) Determine the exact set of pairs with for which the lasso recovers exactly. (iii) Show that if the nonzero signs had been instead of , the admissible range of would be strictly larger, and explain the mechanism.
Since the objective is convex, is optimal iff there is a subgradient with where if and if . Substituting and writing , stationarity becomes
The witness. We impose (so ) and , then solve block-wise and finally check that the solution is genuinely feasible. The -block of gives which uses invertibility of . The -block defines the remaining dual coordinates, The construction succeeds if (i) (so that was a valid subgradient) and (ii) .
The uniqueness step (the one candidates skip). Suppose strictly, and let be any optimum with subgradient . The map is strictly convex in the fitted value , and is convex; hence over the (convex) optimal set the fitted vector is constant. Therefore is constant across optima, so by the subgradient is the same for every optimum — in particular , our constructed dual vector. Now use complementary slackness: at optimum , i.e. . Each summand is , and for we have , forcing . Thus every optimum is supported in . Finally, and has full column rank (again because ), so . The optimum is unique and equals the witness.
Thus enters twice: once to solve for , once to pass from equal fitted values to equal coefficients.
Substituting into the formula for , The incoherence term is bounded by by hypothesis. So strict feasibility holds provided the noise term satisfies (then , and one takes for strictness).
Each coordinate of is a mean-zero Gaussian. Its variance is bounded by the variance of (projection reduces variance), which is by the normalization. A maximum over Gaussians of variance obeys, with probability , Hence it suffices to choose For the signs to be preserved we need small in sup-norm relative to the signal; a sufficient condition is the -min condition. Under both, part (a) gives exact sign recovery with probability .
(i) Positive definiteness. Leading minors of are , , and . So .
(ii) Exact recovery region. Here , so , , and . Noiseless, so .
Both requirements are strict, and already guarantees . Therefore At the boundaries recovery fails: gives (non-strict, solution can be non-unique with a spurious third coordinate), and kills the second coordinate.
(iii) The sign mechanism. With signs the incoherence term becomes which is strictly feasible for every in the PD range . So the same design recovers the support for , strictly larger than the of the pattern. The reason: the off-support column correlates equally () with and ; when the two active coordinates carry opposite signs their pulls on the dual coordinate cancel, whereas equal signs add. Irrepresentability is genuinely a property of the signed support, not just the support.
Closing note. The textbook mutual-incoherence constant takes the worst case over signs; here that worst case is , giving the pessimistic threshold . The tempting error is to treat that worst-case number as the recovery threshold for a given . For a fixed signed support only the actual sign vector matters, and — as shows — the true threshold can be much more generous.
Two new problems every morning at 8am · every day so far