Symmetry & exchangeability
The deepest skill in probability is getting the answer without computing anything. This chapter builds the two tools that make it possible: the symmetry principle — a measure-preserving relabelling of outcomes forces two events to have equal probability — and exchangeability, the statement that a random sequence does not care about order. Together they answer questions that look like they need conditional-probability marathons (“what is the chance the 17th card is an ace?”) in one line, and they are the exact hypothesis behind permutation tests. The principle is proved once, then used relentlessly: card positions, relative orders, gaps, random permutations, rotations around a circle, and sampling without replacement.
Probability is assigned by a mechanism — a shuffle, a sequence of flips, a uniform draw. If you can exhibit a relabelling of outcomes that the mechanism is blind to (swapping two cards before a uniform shuffle changes nothing) and that relabelling carries event onto event , then — no counting required. The entire art is choosing what to ignore: to compare two cards, ignore the other fifty; to locate the first ace, ignore the identities of the non-aces; to test a trading signal, ignore the labels the null hypothesis says are arbitrary. Every result below is one application of this move, and the discipline that keeps it honest is always the same — name the map, check it preserves the measure.
The symmetry principle#
Let be a bijection of outcomes that preserves probabilities: for every event . If maps onto , then
That is the whole theorem — one line, directly from the definition. For a finite space with equally likely outcomes every bijection preserves probabilities, which is why shuffled decks are such fertile ground: any relabelling of the 52 cards, applied before a uniform shuffle, leaves the distribution over orderings untouched. The principle also delivers equalities of distributions, not just of single probabilities: if for a measure-preserving , then and have the same distribution, hence the same mean, variance, everything.
Flip a fair coin 100 times. What is the probability that flips 1–50 contain more heads than flips 51–100 contain tails? Apply the map that flips every coin in the second half only — fair independent flips make it measure-preserving, and it turns second-half tails into second-half heads. So the question equals , and the further symmetry that exchanges the two halves makes that . No binomial sums — two relabellings peeled the problem down to its genuinely asymmetric core, a tie probability.
Exchangeability: order-blindness made precise#
A finite or infinite sequence is exchangeable if every reordering has the same joint distribution: for each and every permutation of ,
Two consequences do most of the work in practice: all marginals agree (each has the distribution of ), and all pairs agree ( for , so every pair shares one covariance). Exchangeable variables need not be independent — that is the entire point:
- i.i.d. ⟹ exchangeable. The joint law of an i.i.d. vector is a product of identical factors, and products do not care about the order of their factors.
- Exchangeable ⟹̸ i.i.d. Deal cards from a shuffled deck without replacement. Every ordering of the 52 cards is equally likely, so any relabelling of positions is measure-preserving: the sequence of dealt cards is exchangeable. But it is glaringly dependent — if the first card is the ace of spades, the second cannot be.
A uniform shuffle assigns probability to every ordering. Fix a permutation of positions and consider the map sending the ordering to the ordering whose -th card is — a bijection of the equally likely outcomes, hence measure-preserving, with by construction. Equal distributions follow from the symmetry principle. ■ Nothing about card values, suits, or how many cards you deal was used: any function of a uniformly random permutation inherits this order-blindness.
Every position of a shuffled deck is a uniform draw#
The marginal-equality consequence, spelled out for cards: in a shuffled deck, the card at position is a uniform draw from the 52 cards, for every . So
The instinct that resists this — “surely it depends on what the first sixteen cards were” — confuses a conditional probability with a marginal one. Had you seencards 1–16, the probability would update (to after observing aces). But unseen cards reveal nothing: no information has arrived, so there is nothing to condition on, and position 17 is exactly as ignorant as position 1. The formal one-liner: the transposition swapping positions 1 and 17 before a uniform shuffle is measure-preserving and maps “ace at 17” onto “ace at 1.” The same argument makes the last card a uniform draw — hard enough to believe that it is worth simulating.

Relative order: condition on the subset, use uniformity#
Question: in a shuffled deck, what is ? Answer: , by the transposition that swaps the two cards before shuffling — it is measure-preserving and exchanges the events “first” and “first,” which are complementary. The general and far more powerful statement:
Fix any subset of cards. Condition on which positions the cards of occupy. Given those positions, every assignment of the cards to them is equally likely — any of the permutations of is a measure-preserving relabelling that fixes the positions and permutes the assignment. So the relative order of is uniform over orderings, independently of where the rest of the deck put them. ■
This is the tool that makes irrelevant clutter vanish. Is the ace of spades more likely than the ace of hearts to appear first in a deck that also contains two jokers, or a hundred? Irrelevant — restrict to the two-card subset: uniform over its orderings, so whatever else is in the deck. Probability the ace of spades precedes both red aces: uniform over orderings of those three cards, first in 2 of them: . All four aces before all four kings: of orderings, i.e. (Problem 5 works this in full). The counting techniques of counting & combinatorics still matter — but only after symmetry has shrunk the problem to the subset that actually varies.
Gaps: where is the first ace?#
The 4 aces cut the other 48 cards into 5 gaps: before the first ace, three gaps between consecutive aces, and after the last. How large is the first gap on average? Symmetry again — this time on each non-ace separately. Fix a particular non-ace card and restrict to the 5-card subset consisting of it and the four aces: its relative order among them is uniform over 5 slots, so it lands before all four aces with probability exactly . By linearity of expectation over indicator variables (expectation & linearity),
so the expected position of the first ace is . The same argument gives each of the five gaps expected size — the gaps are exchangeable, another distribution shared by relabelling. The general result, for special cards among :
Sanity checks: gives position 1; gives , the centre — a single special card is uniform over positions, as it must be. For the deck: 10.6 for the first ace, for the first heart. The continuous twin — uniform points cutting into exchangeable spacings of mean — is developed in order statistics.
import numpy as np
rng = np.random.default_rng(17)
trials = 200_000
# Only the ace / non-ace pattern matters: cards 0-3 are the aces.
ranks = np.argsort(rng.random((trials, 52)), axis=1) # each row: a uniform shuffle
is_ace = ranks < 4
# Expected position of the first ace (1-indexed): theory (n+1)/(k+1) = 53/5
first_ace = is_ace.argmax(axis=1) + 1
print(f"E[position of first ace] = {first_ace.mean():.3f} (theory 53/5 = 10.600)")
# P(17th card is an ace): theory 4/52 = 1/13
p17 = is_ace[:, 16].mean()
print(f"P(17th card is an ace) = {p17:.4f} (theory 1/13 = 0.0769)")
# Exchangeability across ALL positions: the per-position ace frequency is flat
freq = is_ace.mean(axis=0) # the deck has no memory: flat across positions
print(f"per-position ace freq: min={freq.min():.4f} max={freq.max():.4f} "
f"(all approx 0.0769)")Random permutations: positions, cycles, and Hₙ#
A uniformly random permutation of is the shuffled deck in abstract clothing, and symmetry reads off its structure:
- Each element is uniform over positions: for all — compose with a transposition of targets, exactly the ace-at-position-17 argument.
- Cycle lengths are uniform too: the cycle containing any fixed element has length with for every — a flat distribution, which few people guess.
Follow the cycle: . At the first step, is uniform over values, so the cycle closes immediately with probability . Given it did not, the next value is uniform over the remaining, closing with probability . Multiplying survival and closing probabilities telescopes:
The same telescoping pattern — survival probabilities cancelling against the next denominator — appears in the birthday-problem and hat-check calculations of counting & combinatorics.
The uniform cycle length buys the expected number of cycles for free. Each element sits in a cycle of length , and a cycle of length is counted once by each of its members if we weight each member by . So the cycle count is , and by linearity plus the flat law of :
For : cycles on average. Decompositions of this flavour are the subject of expectation & linearity; here symmetry supplied the marginal law that linearity then summed.
Rotations: the cycle lemma and round tables#
Transpositions are not the only useful symmetry. Rotations power the slickest proof of the ballot theorem. Candidate A gets votes, B gets , counted in uniformly random order; the claim is
Encode votes as (A) and (B) and bend the sequence of votes into a circle. The cycle lemma (Dvoretzky–Motzkin): for any circular arrangement with total sum , exactly of the starting points give all partial sums strictly positive — they are the steps just after each of the distinct record minima of the running sum. Now the symmetry: a uniformly random ordering makes all rotations of any circular arrangement equally likely — rotation is a measure-preserving bijection — so the probability of an always-positive count is , whichever circular arrangement you were dealt. ■ With : only — even a landslide winner usually gets caught at least once. The reflection-principle proof of the same fact lives in random walks & Brownian motion.
The everyday version of rotation symmetry is the round table. Seat people uniformly at random around a circle; what is the probability two particular friends sit together? Rotate so that friend one’s seat is fixed — rotations are measure-preserving, so this loses nothing. The other seats are now exchangeable for friend two, and 2 of them are adjacent: , i.e. at a table of 10. The “fix one person by rotation” move dissolves nearly every circular-arrangement problem — the line version appears as Problem 4.
Sampling without replacement: exchangeability at work in statistics#
Draw values without replacement from a population of numbers with mean and variance . The draws are dependent — but exchangeable, by the dealing argument above. Exchangeability alone gives:
- Unbiasedness for free: each is marginally a uniform draw from the population, so and . The sample mean is unbiased regardless of the dependence.
- Negative correlation: drawing a large value removes it from the pool, tilting later draws small. Quantitatively, for .
By exchangeability all pairs , , share one covariance — so a single clever case determines it. Take : the sample is the whole population, so is a constant with variance zero. Expanding,
Feeding into the variance of a mean of exchangeable draws gives
the finite population correction: sampling without replacement is more accurate than i.i.d. sampling, because each draw genuinely retires part of the uncertainty — at the variance hits zero, a census. The estimator-level consequences are developed in estimators & sampling.
A permutation test asks: shuffle the labels (long/short days, strategy A/B trades, regime tags) and recompute the statistic — is the observed value extreme among the shuffles? The logic is precisely this chapter’s: under the null hypothesis the labelled sequence is exchangeable, so every relabelling is measure-preserving and the observed arrangement is a uniform draw from the shuffled ensemble — making the permutation p-value exact, with no normality and no asymptotics. The licence is also the limitation: autocorrelated or volatility-clustered returns are not exchangeable, so naive shuffling destroys real structure and overstates significance — the reason block permutations exist. The machinery is built in resampling & the bootstrap: when you shuffle a backtest’s trade labels, you are asserting exchangeability — make sure the null you care about actually implies it (why backtests lie).
Every result above named an explicit measure-preserving map: a transposition, a rotation, a relabelling. That discipline is the difference between a proof and a trap. Bertrand’s paradoxis the canonical failure: “choose a random chord of a circle; what is the probability it is longer than the side of the inscribed equilateral triangle?” Three natural symmetries — random endpoints, random midpoint, random distance from the centre — give , , and . All three feel symmetric; they are symmetric under different groups, and “random chord” never specified the generating mechanism. The paradox dissolves the moment the mechanism is named — the full dissection lives in geometric probability. The working rule: a symmetry argument is complete only when you state the bijection, check it preserves the measure of the actual mechanism, and exhibit it mapping one event onto the other.
Practice problems#
Five problems that test whether the reflex is installed — each collapses under a single well-chosen symmetry, and each solution names its map.
A standard deck is shuffled. What is the probability that the last card is a spade?
Solution.The transposition swapping positions 1 and 52 before the shuffle is measure-preserving and maps “spade at 52” onto “spade at 1,” so the answer is the first-card answer: . No conditioning on the first 51 cards, because none were observed — unseen cards carry no information. The one-line insight: every unobserved position of a shuffled deck is marginally a uniform draw; position 52 is not special.
Turn cards over one at a time from a shuffled deck. What is the expected number of cards you turn over until the first heart appears (counting the heart itself)?
Solution. The 13 hearts cut the 39 non-hearts into 14 exchangeable gaps. For each non-heart, restrict to the 14-card subset of it plus the 13 hearts: its relative order is uniform, so it precedes all 13 hearts with probability . Linearity: , so the expected count including the heart is — the general with . The one-line insight: don’t track the deck card by card — drop each irrelevant card into the gaps and let uniform relative order price it.
You and an opponent each reveal one card from the same shuffled deck; higher rank wins, and equal ranks are a tie. What is the probability you win outright — and given the cut is not a tie, what is the probability it was broken in your favour?
Solution.The map that swaps the two revealed cards is measure-preserving and exchanges “you higher” with “opponent higher,” so those probabilities are equal, and given no tie your win probability is exactly — symmetry settles the conditional before any counting. Only the tie needs arithmetic: given your card, 3 of the remaining 51 cards match its rank, so and . The one-line insight: symmetry splits the non-tie mass exactly in half; computation is only ever needed for the part the symmetry doesn’t reach.
people, including your two friends, line up in uniformly random order. What is the probability your friends end up adjacent?
Solution. The pair of positions occupied by the two friends is uniform over all unordered pairs — permuting the other people is measure-preserving and washes them out. Adjacent pairs number (positions ), so
For : , slightly below the round table’s — a circle has one extra adjacency. The one-line insight: reduce to the joint law of the positions you care about — everyone else is exchangeable scenery.
In a shuffled deck, what is the probability that all four aces appear before all four kings?
Solution. Restrict to the eight-card subset of aces and kings: its relative order is uniform over orderings, wherever the other 44 cards fall. The event demands the first four of those eight be the aces (in any internal order): favourable orderings, so
Equivalently: which four of the eight relative slots the aces occupy is uniform over choices, and exactly one — the first four slots — wins. The one-line insight: the other 44 cards are noise; condition on the subset and the answer is a count over its uniform orderings.
Next: from relabelling outcomes to reshaping distributions — how densities transform under functions of a random variable, the Jacobian formula, and the universality of the uniform. Transformations of random variables.
