TL;DR
A sequence of random variables is exchangeable when its joint probabilities do not change if you reorder the positions. Any rearrangement of an outcome is as likely as the outcome itself. Exchangeable variables do not have to be independent, but they are almost as easy to reason about, and the common case of independent draws from one unknown source always qualifies.
Where you'll see it: in the assumption that the rows of a dataset can be shuffled, in permutation tests, and in Bayesian models, where an unknown parameter links the observations without singling out any position.
Intuition
Does the order matter?
Write the outcome of three draws as a string, such as RBR (red, blue, red). Now ask a simple question. Is RBR just as likely as BRR and RRB? If you shuffle the letters, does the chance of the pattern stay the same? If it does for every pattern, the sequence is exchangeable.
That is a question about positions, not about the values. Exchangeability means the positions carry no information of their own. Draw number 1 is not special, and neither is draw number 3. Only the contents of the pattern matter.
Why this idea exists
In many problems we have no reason to tell the positions apart. We have not labelled the patients, the coin tosses, or the survey respondents by anything that matters. The usual model says the draws are independent and identically distributed (iid). That is a strong claim: it says the draws do not influence each other at all. Real samples often do influence each other a little, for example when they come from one batch, one urn or one population of unknown mix. Exchangeability keeps the one thing we are confident about, that the order carries no information, and drops the claim of no influence.
flowchart LR A[Independent and identically distributed] --> B[Exchangeable] C[Mixture of iid draws from an unknown source] --> B B --> D[Order carries no information] B -.->|not the other way round| E[Independence]
The arrows show the logic. Every iid sequence is exchangeable. The second route is the important one: exchangeable sequences look like mixtures of iid draws, so exchangeability is the right assumption whenever a hidden shared cause is plausible.
The math
Definition
Random variables are exchangeable if, for every permutation of the positions , the vector has the same joint distribution as . For discrete variables this means
for every choice of values .
Here is a permutation, a rearrangement of the positions to . The right-hand side is the probability of the rearranged pattern. The definition says that rearranging a pattern never changes its probability. A sequence of length has to pass this test for every we care about.
Exchangeability is a property of the joint distribution, not of any single variable. Each on its own may have the same distribution as the others (an identically distributed sequence is one where every has the same marginal law), but exchangeability asks more: the way the variables move together must also be unchanged by reordering.
Iid implies exchangeable
Suppose the variables are independent and identically distributed with probability mass function (the function giving the probability of each value). Independence turns the joint probability into a product, so
- .
- A product of numbers does not change when its factors are reordered: .
- The right-hand side of step 2 is exactly the joint probability of the rearranged pattern, so the definition holds.
The converse fails. The next example gives an exchangeable sequence that is not independent.
Exchangeable is not the same as independent
Exchangeable sequences can be strongly dependent. The two statements differ in what they test. Independence asks whether knowing one variable changes the probability of another. Exchangeability asks whether reordering changes the joint probabilities. A sequence can pass the second test while failing the first, as Example 1 shows.
de Finetti's representation
The central fact about exchangeable sequences is due to de Finetti. For an infinite exchangeable sequence there is a hidden random parameter such that, given , the variables are iid. The joint probability is an average over :
Here is a conditional probability: the probability of one value when the parameter is , and is the probability density of the parameter itself (its prior, in Bayesian language). For a discrete parameter, replace the integral by a sum. In words: an exchangeable sequence is what you get when you draw a hidden setting once, then draw iid values from that setting. Because the variables are iid given , the law of large numbers says the long-run fraction of each outcome settles at its probability under . This is the reason exchangeability is so useful. It takes a general symmetry and turns it into the familiar iid model with an unknown parameter.
Worked examples
Start with one red ball (R) and one blue ball (B) in an urn. Draw a ball, note its colour, put it back, and add one more ball of the same colour. Call the first draw and the second (a draw is one Bernoulli-style yes/no outcome: red or not). This is a Pólya urn.
- . The urn now holds 2 red and 1 blue, so 3 balls in total.
- . So .
- . The urn now holds 1 red and 2 blue.
- . So .
- The two orders are equally likely, . That is exchangeability for .
- Check independence. . The marginal is . If the draws were independent, would be , not .
Interpretation: the first draw changes what the second is likely to be, since a red first draw makes red more likely again. But this influence does not depend on which position the draw occupies, so the sequence is exchangeable without being independent.
Choose one of two coins with equal chance. Coin A lands heads with probability 0.2, and coin B with probability 0.8. Flip the chosen coin twice, giving and . Both flips use the same coin, so they are linked, but no position is special.
- Given coin A, the flips are independent, so .
- Given coin B, .
- Average over the coin choice: .
- For a head then a tail, given A the probability is , and given B it is . So .
- By the same steps, , so the two orders match.
- . The four probabilities add to , as they must.
- The first flip is heads with probability . Independence would need , but the true value is .
Interpretation: once we know which coin we hold, the flips are iid, with for coin A. We do not know the coin, so the flips move together. This is de Finetti's picture in a single example: exchangeable means iid given an unknown parameter, averaged over that parameter.
A box holds 100 tickets, and 30 of them win. Draw three tickets one after another, without putting any back. Let record whether draw is a winner (W) or a loser (L).
- .
- .
- .
- . This matches step 3.
- . The four probabilities add to .
- The second draw is a winner with probability , the same as the first. Reordering the draws does not change the picture.
- An iid model would give . The true value is , so the draws are not independent. Each winning ticket removed leaves one fewer winner.
Interpretation: the order of the draws never matters, but the draws affect each other. Because the box is large compared with the number of draws, the gap is small here. When the population is much larger than the sample, people routinely treat such draws as iid.
Tradeoffs and failure modes
Exchangeability is a weaker assumption than iid, so it is the safer one to make. It is still an assumption, and the data cannot prove it on their own. The table lists the common situations.
| Situation | What goes wrong | Better choice |
|---|---|---|
| The data have a natural order, such as a time series or a drift over time | Early values carry information about later ones, so position matters | Model the order directly, with a time-series or Markov model |
| A small population is sampled without replacement | The draws are not iid, and the gap can be large | Use the exact model for drawing without replacement |
| Several hidden sources are mixed together | Treating the whole sequence as one source hides the groups | Add a group variable (a [[mixture-model |
| A [[permutation-test | permutation test]] is run | The test is valid only if shuffling leaves the null distribution unchanged |
A common mistake is to assume exchangeability because the rows happen to be listed in a random-looking order. The order of a file tells you nothing about whether the variables are exchangeable. What matters is whether the process that generated the data treats the positions alike.
History
The idea was developed by the Italian mathematician Bruno de Finetti in the late 1920s and early 1930s, as part of his work on the foundations of probability and subjective belief. He was asking how someone can reason about a sequence of events they consider interchangeable, and his representation theorem answered it: such beliefs are mixtures of iid beliefs, averaged over an unknown parameter. The Pólya urn, used in Example 1, belongs to the same period of work on urn models that was developed by George Pólya.
The idea caught on because it gave a clean justification for Bayesian models. A model that places a prior over an unknown parameter and then assumes the data are iid given that parameter is exactly an exchangeable model. Exchangeability became the standard way to say why a dataset can be modelled as repeated draws from an unknown source, even when the draws are not truly independent.
Recap
A joint distribution gives the probability of a whole pattern. Reordering the positions of that pattern leaves the probability unchanged exactly when the sequence is exchangeable. Independent identically distributed sequences are a special case, and de Finetti showed that every exchangeable sequence is a mixture of such sequences. Two ideas build on this. A permutation test shuffles labels to ask whether an observed difference could be chance, which is valid only under exchangeability. Causal inference uses the same idea when it asks whether treated and untreated groups are comparable.
Check yourself
QuestionRecall: in your own words, what does it mean for a sequence of random variables to be exchangeable?Show answer
A sequence is exchangeable when reordering its positions does not change its joint probabilities. For any pattern of values, the pattern and every rearrangement of it are equally likely. The variables may still be dependent, but the position of each variable carries no information about it.
QuestionComputation: an urn holds 3 red and 1 blue ball. Draw one ball, note its colour, put it back and add one more of the same colour. Find and . Are they equal?Show answer
, and after that draw the urn holds 4 red and 1 blue, so . Therefore . For the other order, , and the urn then holds 3 red and 2 blue, so . Therefore . They are equal, as exchangeability requires, even though the second draw clearly depends on the first.
QuestionWhy: why does sampling without replacement from a finite box give an exchangeable sequence but not an iid one?Show answer
Reordering the draws does not change the set of tickets that were drawn, so the probability of a pattern is the same for any order. This is the symmetry that exchangeability captures. Independence fails because each draw changes the box: removing a winning ticket leaves fewer winners for the next draw. Example 3 shows the gap, with rather than the iid value .
QuestionApplied: a dataset's rows are shuffled before being split into training and test sets. Is it safe to assume the rows are exchangeable? What would make that assumption fail?Show answer
Shuffling is the kind of reordering exchangeability allows, so if the rows are exchangeable, shuffling changes nothing about their joint law and the split is fair. The assumption fails when the rows come from a process with a trend, such as readings from a sensor that drifts over time, or when several sources are stacked in blocks. A quick check is to compare the first and last parts of the data for systematic differences. If they differ, a time-aware or group-aware split is needed.