← All 70 questions
Question 35·Fitzwilliam College·2025·Trap question — the computation is trivial once the forcing step is seen, but it punishes formula-first reasoning; standard first-round material
Derangements and a boundary check: the exactly-(n-1) fixed-point cell is structurally empty
8–12 minutes at interview pace
Live video, shared whiteboard. Everything under BOARD is written with the pen; everything under SAY is spoken over it, at the same time. Never write a line in silence, and never say a line you have not put on the board.
There are n students and n labeled hats. If each student randomly picks one hat, what is the probability that exactly n-1 students pick their own correct hats?
Answer: 0 for every n≥1 — exactly n−1 correct hats is structurally impossible

The whiteboard, beat by beat

1 · Orient · beat 1 of 9

Name the object before touching a formula

all n! hand-outs equally likely
⟹ a uniform permutation σ of {1,…,n}
fixed point ⟺σ(i)=i
X(σ)=#{i:σ(i)=i}
target: P⁡(X=n−1)
What you say, out loud

Before any algebra, let me say what the experiment is. Handing n labeled hats back at random, one to each student, is exactly drawing a permutation of n objects uniformly from all n factorial of them.

A student who gets their own hat is what the textbooks call a fixed point of that permutation, so the number of happy students is the number of fixed points. I will call it X.

So the question is not really a story about hats; it asks for one specific column of the distribution of X, the column n minus one. Once I see that, I know I am allowed to attack it by structure or by counting, and I should try structure first.

Why this beat exists: The key-points page calls this a logic-trap question: the interviewer is listening for 'name the event before computing'. Translating hats into permutations is the naming step.
2 · Set up · beat 2 of 9

The forcing argument, stated as a falsifiable prediction

n−1 correct ⟹ n−1 hats consumed
{σ:σ(i)=i on n−1 points}
⟹σ=id
no room to miss
Prediction before counting: #{X=n−1}=0 for every n≥1
⟹ P⁡(X=n−1)=0
What you say, out loud

Here is the structural argument. Give n minus one students their own hats. That uses up n minus one specific hats, so precisely one hat remains, and the only hat left is the last student's own hat.

He has no choice in the matter: whatever he does, he is correct. So the configuration 'exactly n minus one correct' cannot be completed; it always collapses into 'all n correct'.

I want to commit to this before I compute anything: the count in the column n minus one must be zero for every n, starting at n equals one, where the question asks for zero correct and the single student is trapped into being correct. If my enumeration later shows even one arrangement in that column, my argument is wrong and I will say so.

Why this beat exists: A prediction that can be falsified by the very table used to check it — this is the move the examiner's 'boundary conflict' comment is asking for.
3 · Draw · beat 3 of 9

Draw the trap: n = 4, three correct

n=4: fix 1,2,3; h1,h2,h3 gone, only h4 left
Student 4 forced correct: X=3 unreachable, X jumps 2→4
P⁡(X=n−1)=0forced, not small
Suppose n-1 = 3 are correct (n = 4)students1234hatsh1h2h3h4forcedh1,h2,h3 are consumed: only h4 is left.h4 is student 4's own hat,so his pick cannot be wrong.X = 3 impossible: it forces X = 4.For every n: n-1 correct forces all n.
This picture proves the forcing step: once n-1 own hats are taken, the last remaining hat is the last student's own, so exactly n-1 correct can never be completed — it always ends as n correct.
What you say, out loud

Let me draw the smallest case where I can see the mechanism, n equals four with three students already holding their own hats.

Three own hats are consumed, one hat remains, one student remains, and the remaining hat is his. The dashed arrow is not a choice; it is a forced move.

Notice what the picture proves: it is not that three-correct is rare. It never happens at all. The count of happy students can jump from two to four, but it cannot stop at three.

Why this beat exists: The drawing is doing proof-work here, not decoration: it exhibits the forcing step for a concrete n so the general argument has a body.
4 · Compute · beat 4 of 9

The general cell formula, and this cell inside it

#{X=k}=(nk)Dn−k,Dm=derangements of m items
P⁡(X=k)=(nk)Dn−kn!
k=n−1: (nn−1)=n winners, leftover deranged: D1=0 ways
P⁡(X=n−1)=n⋅D1n!=n⋅0n!=0
What you say, out loud

Now the counting route, which is the route the question tempts you into. If I prescribe which k students are correct, the remaining n minus k students must all be wrong among the remaining n minus k hats: a derangement. So the count is n choose k times D of n minus k.

Feed in k equals n minus one: n ways to choose the winners, and then the one leftover student must miss his own hat, derangements of one object, which is zero. One object, one hat, no derangement exists.

So the formula agrees with the structural argument, and it agrees for the same reason: D of one equals zero is exactly the forcing step written in the language of derangements.

Why this beat exists: The key-points page warns against blindly applying the full derangement formula. The fix is not to avoid the formula but to know what D_1 = 0 means before pushing it through.
5 · Check numerically · beat 5 of 9

Full enumeration, n = 1 to 8, the actual counts

Brute force, n=1,…,8: #{X=n−1} column
n12345678#{X=n−1}00000000#{X=n−2}−−3610152128
n=6 row, k=0 to 6: 265, 264, 135, 40, 15, 𝟎, 1 — sums to 720=n!.
n = 6: all 720 permutations by k26526526413540150k = n-110123456k = number of students with their own hatcounts from full enumeration of 6! = 720
Brute force over all 720 permutations of 6: the column k = n-1 = 5 is empty while its two neighbours hold 15 and 1 — the hole is exactly one column wide and sits at n-1 for every n, which is what the forcing argument predicts.
What you say, out loud

I will not trust my own argument until a computer has counted. For every n from one to eight I enumerated all n factorial permutations and tallied each fixed-point count.

The column n minus one is zero at every single n; that is eight zeros, exactly as predicted. The neighboring column n minus two is alive: three, six, ten, fifteen, twenty-one, twenty-eight from n equals three up to eight. So the zeros are not a bug in my code that counts everything as zero.

Look at the n equals six row: two sixty-five, two sixty-four, one thirty-five, forty, fifteen, zero, one. The bars fall smoothly and then the second-to-last one is simply missing, and the row still sums to seven hundred and twenty, so nothing leaked.

Why this beat exists: Reporting the actual counts (and a live neighbor column) is the discipline: the prediction was falsifiable and the falsification channel is visibly working.
6 · Justify · beat 6 of 9

Two independent routes to D_m, and a global formula audit

Inclusion–exclusion: Dm=m!∑j=0m(−1)jj!; recurrence: Dm=(m−1)(Dm−1+Dm−2), D0=1, D1=0.
m012345678Dm1012944265185414833
Both routes agree
k=0 column matches Dn: 0,1,2,9,44,265,1854,14833, n=1..8
Audit, all 44 cells: deviation =0
maxn≤8,k⁡|(nk)Dn−k−#{X=k}enumerated|=0
What you say, out loud

The derangement numbers deserve two independent computations before I lean on them. Route one is inclusion-exclusion: m factorial times the alternating sum of one over j factorial. Route two is the classic recurrence, D of m equals m minus one times D of m minus one plus D of m minus two, with the two initial values computed on the spot rather than quoted.

Both routes produced identical values up to m equals eight, and both match the zero-fixed-points column of my brute-force table; for instance, the two hundred and sixty-five derangements of six objects appear in all three places.

Then I ran the general formula against every cell of the enumeration, all forty-four pairs with n at most eight: the maximum deviation is exactly zero. The formula is not just fitting the answer for this question; it is right everywhere nearby.

Why this beat exists: Cross-validating the machinery (two routes + global table audit) is what makes the single-cell answer trustworthy rather than lucky.
7 · Cross-check · beat 7 of 9

Monte Carlo with a fixed seed — and an honest zero cell

Seed 20251017; N=10000 is a prefix of N=100000
nested, not independent
neventNp^psez6X=01050.3706000.3680560.001525+1.676X=11050.3648200.3666670.001524−1.218X=11040.3790000.3678570.004822+𝟐.𝟑𝟏6X=61050.0014600.0013890.000118+0.606X=5(=n−1)10500se=0undefined
Worst by max⁡|z|: n=8, X=1, N=104: z=+2.31
at N=105 same cell: z=+0.10
se ratio N→10N, single cell n=6, X=0:
0.00152509/0.00482277=0.316228=1/10: factor 10, not a halving
0.00482277 = the N=104 se of cell n=6, X=0
not the 0.004822 of row n=8, X=1
theory p vs empirical p^: 0.0015251, 0.0015273
4th digit apart
X=n−1 cell: 0 of 105 draws, n=6
0 of 105 at n=8, 2×105 in all
p=0⇒se=0, z undefined
evidence: forcing + enumeration
What you say, out loud

A simulation as a third opinion, with one trap of its own. I fixed the seed, and my ten thousand trial block is literally the first ten thousand draws of the hundred thousand trial block, so those two rows are nested samples, not independent confirmations, and I will not present them as two votes.

Every standard error comes with its z. Most cells sit inside one or two standard errors, but the honest report is this: the worst cell, found by taking the maximum absolute z over the table, is n equals eight, exactly one fixed point, at ten thousand draws; z equals plus two point three one, beyond two. That is roughly the rate you would expect when you look at many cells, and the same cell at the larger nested sample gives z equals plus zero point one zero, so nothing is broken; but I am not going to claim everything sat inside one standard error, because it did not.

Two housekeeping points. In one named cell, n equals six, nobody correct, going from ten thousand to a hundred thousand trials divided the standard error by three point one six two two eight, which is root ten, not by two; and that division compares zero point zero zero four eight two two seven seven with zero point zero zero one five two five zero nine, both from that same cell, not from the similar-looking four point eight two two in the row where n equals eight and the fixed points equal one. And my error bars use the theory p, not the observed frequency: for the n equals six, X equals zero cell the two conventions give zero point zero zero one five two five one versus zero point zero zero one five two seven three, already different in the fourth significant digit.

And the cell this question is actually about: zero hits in a hundred thousand draws at n equals six, and zero in another hundred thousand at n equals eight, so two hundred thousand draws in all. For that cell the theoretical p is zero, so the standard error is zero and z is undefined: the simulation cannot test a zero-probability event, it can only agree with it. The real evidence there is the forcing argument and the exhaustive count, and I would say that out loud rather than write 'perfect match'.

Why this beat exists: This beat is where most candidates would quietly drop the zero cell or claim 'all within one se'. Naming the |z| = 2.31 cell, the nestedness, the sqrt(10) and the undefined z is the numerical-forensics discipline the guide demands.
8 · Conclude and generalise · beat 8 of 9

The answer, the neighbours, and where the mechanism stops

P⁡(exactly n−1 correct)=0
Neighbours (enumerated, n=2..8):
P⁡(X≥n−1)=1n!≠0, P⁡(X≤n−1)=1−1n!
P⁡(X=n−2)=12(n−2)!≠0, P⁡(X=n)=1n!
P⁡(X=0)>0 for every n≥2, P⁡(X=1)>0 only from n≥3
n=2: column k=1 forbidden, count 0
Moments: E[X]=1 all n; Var⁡X=1 for n≥2, 0 at n=1
brute force = indicators
k≠n−1 attained; X=n−1 unique gap
What you say, out loud

So the answer is zero, for every n at least one; not approximately zero, structurally zero.

The generalisation is where the insight lives. The forcing argument singles out exactly one column of the distribution. Every neighbor is fine: n minus two correct happens with probability one over twice n minus two factorial: the two leftover students just swap hats. And at least n minus one is just all n, one over n factorial.

The moments make the oddity precise. The expected number of correct hats is one for every n, no matter how large, and the variance is one from n equals two on. A distribution sitting on essentially every value from zero to n, with mean one, but with a single forbidden gap exactly one below the top.

Where does the mechanism stop? Nowhere inside this model. But it is model-specific: if hats could be shared or some student could pass, the counting stops being permutations and the forcing argument loses its grip.

For the moments, the brute-force tally and the indicator calculation give exactly the same values.

Why this beat exists: Answer, then the boundary of the argument (permutations are what make one hat left = one specific hat), then the surprise (mean one, one forbidden column) — the closing moves the guide asks for.
9 · Only if invited · beat 9 of 9

How fast the other columns approach 1/e

P⁡(X=k)=(nk)Dn−kn!⟶e−1k!(n→∞, k fixed)
k=0: .333,.375,.3667,.368056,.367857,.367882 for n=3..8 against e−1=0.367879; alternating-series error ≤1/(n+1)!.
forbidden column: invisible in limit
P⁡(X=n−1)=0 while e−1/(n−1)!→0 — consistent
hole: not a rounding artifact
What you say, out loud

If you want one more layer: for fixed k and growing n, the k-th column converges to e to the minus one over k factorial: the fixed points of a random permutation are asymptotically Poisson with mean one. My table shows it: the zero-fixed-points probability is already point three six seven eight eight two at n equals eight against one over e of point three six seven eight seven nine.

The mean-one fact and the Poisson limit are the same story: almost all the mass sits in the first few columns, which is why the forbidden column at the very top costs nothing in probability; it was empty anyway.

I would offer this as the epilogue: the trap question is really a window into the whole fixed-point distribution.

Why this beat exists: Going here unprompted reads as showing off; when invited, it shows the candidate knows the limit theorem behind the numbers they generated.

Where the interviewer pushes next

“What if the question said AT LEAST n-1 students are correct?”
What you say, out loud

Then the answer changes completely, and this is the boundary the question is testing. At least n minus one splits into exactly n minus one, which is empty, plus all n, which is the identity permutation alone.

So the probability is one over n factorial: at n equals six, one over seven hundred twenty, point zero zero one three eight nine. The enumeration gives the same: my n equals six row has a single permutation at k equals six and none at k equals five.

P⁡(X≥n−1)=P⁡(X=n−1)+P⁡(X=n)=0+1n!=1n!
“And exactly n-2?”
What you say, out loud

Nonzero, and I can name the mechanism: choose the two students who miss, then they must swap hats; that is one derangement of two objects. So the count is n choose two times D of two, and D of two is one.

The probability is one over two times n minus two factorial: at n equals four that's six over twenty-four, a quarter; at n equals six, fifteen over seven hundred twenty, point zero two zero eight three. Both match my enumeration column by column.

P⁡(X=n−2)=(n2)D2n!=(n2)n!=12(n−2)!
n=4..8: 0.25, 0.08333, 0.020833, 0.004167, 0.000694
“Why should the expected number of correct hats be 1 for every n?”
What you say, out loud

Indicator variables. For each student, the chance their own hat comes back to them is one in n by symmetry, so the expectation of the total is n times one over n, which is one; no independence needed, and that matters because these indicators are badly dependent.

The second moment takes one more step: the chance two named students are both correct is one over n times n minus one, so the expected number of ordered correct pairs is n times n minus one times that, which is one. Then the variance is one plus one minus one squared, which is one, for n at least two.

I checked both against the enumeration for n up to eight: mean exactly one everywhere, variance exactly one from n equals two on, and zero at n equals one, where the single student is always correct.

E[X]=∑iP(σ(i)=i)=n⋅1n=1
E[X(X−1)]=n(n−1)⋅1n(n−1)=1 ⟹ Var⁡X=E[X2]−1=(1+1)−1=1 (n≥2)
“What is the probability nobody gets their own hat?”
What you say, out loud

That is the genuine derangement question, D of n over n factorial, and it is the only column where the full formula earns its keep. Inclusion-exclusion gives one minus one plus one over two minus one over six and so on, which converges to one over e, about point three six seven eight seven nine.

My numbers: n equals four gives nine over twenty-four, three eighths, not a quarter; n equals six, two hundred sixty-five over seven hundred twenty; n equals eight, fourteen thousand eight hundred thirty-three over forty thousand three hundred twenty, point three six seven eight eight two. Already within three millionths of one over e at n equals eight.

Note the contrast with today's question: here the formula does real work; there it collapses to zero through D of one. Knowing which situation you are in is the whole point of the trap.

Dnn!=∑j=0n(−1)jj!⟶e−1
n=4,6,8: 0.375000, 0.368056, 0.367882 against e−1=0.367879

Traps on this question

  • Plowing into the full derangement formula for the n-1 column without noticing D_1 = 0 — the machinery gives the right answer but teaches you nothing, and one slip (taking D_1 = 1) produces the wrong nonzero n/n!.
  • Reasoning that the last student 'randomly picks from one hat, so there is a 1/n chance he is wrong' — once n-1 own hats are consumed the remaining hat is not random at all; it is pinned to the last student.
  • Confusing exactly n-1 with at least n-1: the first has probability 0, the second has probability 1/n! — the whole discrimination of the question lives in that boundary.
  • Reporting the simulation's zero hits on the X=n-1 cell as a 'perfect match' or as statistical evidence: p = 0 forces se = 0 and z undefined; the evidence is the forcing argument and the exhaustive count, not the Monte Carlo.
  • Assuming every count from 0 to n is an attainable number of correct hats — X = n-1 is the unique forbidden interior value, and claiming 'all |z| < 1' or 'the se halves' in the same breath as a 2.31 cell is exactly the sloppiness the numbers punish.

What gets written on the assessor’s form

  • The candidate translated the hat story into a permutation and named the target event (the k = n-1 column) before computing anything.
  • They produced the forcing argument as a falsifiable prediction, then checked it against a full enumeration of n! for n up to 8 and reported the actual zero counts.
  • They validated the derangement machinery by two independent routes (inclusion-exclusion and recurrence) and audited the general formula against all 44 enumerated cells (max deviation 0).
  • Their numerical check was honest: they named the worst simulation cell (|z| = 2.31), the nested-prefix structure of the samples, the sqrt(10) se scaling, and refused to treat the zero-probability cell as statistical evidence.
  • They closed by distinguishing the neighbours (at least n-1 has probability 1/n!, exactly n-2 has 1/(2(n-2)!)) and stating E[X] = 1, Var(X) = 1 — generalising past the trap.