Advanced Combinatorics
Permutation Statistics: Records & Fixed Points
Overview
Permutation statistics are among the most beautiful results in combinatorics. Three key facts: (1) the expected number of records equals Hₙ, provable by a one-line indicator argument, (2) the expected number of fixed points equals exactly 1 regardless of n, and (3) the probability of no fixed point (derangement) converges rapidly to 1/e. These results appear directly in trading interviews — records are related to optimal stopping (secretary problem), cycles appear in the 100-prisoners problem, and derangements appear whenever you ask 'what's the probability that no pairing is correct?'
How to Recognize
- →'How many left-to-right maxima (records) in a random permutation?'
- →'P(no element is in its original position)' — derangements
- →'Expected number of cycles in a random permutation'
- →Any question about structure of a uniformly random permutation
- →Interviewers asking about permutation-based probability
Step-by-Step Approach
- 1.Use indicator variables: Iₖ = 1 if position k is a record → P(Iₖ=1) = 1/k by symmetry
- 2.E[# records] = Σ 1/k = Hₙ (harmonic number)
- 3.E[# fixed points] = 1 (regardless of n!)
- 4.E[# cycles] = Hₙ (same as records — surprising connection)
- 5.P(derangement) → 1/e via inclusion-exclusion or Poisson approximation
Key Formulas
Worked Examples
Problem
A uniformly random permutation of n elements is chosen. How many cycles does it have, in expectation? Prove it.
Solution
Let = indicator that element k starts a new cycle (i.e., k is the minimum element of its cycle).
E[# cycles] = Σₖ₌₁ⁿ P(k is cycle minimum).
In the cycle containing k, k is the minimum iff k comes 'first' in the cycle. By symmetry among the elements in the cycle, P(k is minimum of its cycle) = 1/(cycle length).
But E[1/(cycle length containing k)] averaged over all permutations equals... let's use another approach.
Bijection with records: there's a bijection (Foata's correspondence) between permutations of [n] and themselves that maps 'cycle minima' to 'left-to-right minima' (records of the INVERSE). So E[cycles] = E[records] = Hₙ.
Direct proof: P(element k is a cycle minimum) = P(k is smallest of {k, next, next...}) = 1/k if we think of elements in cycle order. Summing: E[cycles] = Σ 1/k = Hₙ.
Answer
. For n=100: ≈5.19 cycles on average.
Common Mistakes
- !
Confusing records and records from the LEFT. 'Record' typically means left-to-right maximum (each element is larger than ALL previous). A different count is records from the right.
- !
Thinking P(position k is a record) depends on the distribution — it only requires the permutation to be UNIFORM. Any uniform shuffle gives P(position k is record) = 1/k.
- !
Derangements and fixed-point Poisson approximation. For large n, the number of fixed points is approximately Poisson(1). P(k fixed points) ≈ e⁻¹/k!.
Practice Problems
Click "Show Answer" to reveal20 people exchange Secret Santa gifts randomly (uniform random permutation, no self-gifting — a derangement). E[people who correctly 'match' with their original intended recipient] = ?
In the 100-prisoners problem, what strategy should prisoners use if only 40 of them (not 50) are allowed to look in boxes? What is P(all survive)?