VISUAL LESSON · 15 PICTURES

Derangements: Counting Arrangements With No Fixed Points

How can we count or model shuffles in which nobody receives their own item?

MODULE 3 / 6LESSON 7 / 50PICTURE 1 / 15
Progress stays on this device · no login
BEFORE THE FIRST PICTURE

How this lesson unfolds.

Begin with What does a random hat return look like? The sequence then connects Start with the full universe and builds toward Exactly k correct means derange everyone else.

Picture 1 of 15 · tap to inspect in full resolution
01

What does a random hat return look like?

INTUITION

A permutation assigns every person exactly one hat; a fixed point occurs when a person receives their own hat.

  • Learning goalExplain story setup in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionStart with the full universe
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 2 of 15 · tap to inspect in full resolution
02

How many possible returns are there?

INTUITION

Six distinct hats can be assigned to six people in 6 factorial equals 720 equally likely permutations.

MATHEMATICAL STATEMENT
  1. Six distinct hats can be assigned to six people in 6 factorial equals 720 equally likely permutations.
  • Learning goalExplain sample space in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionA derangement has no fixed point
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 3 of 15 · tap to inspect in full resolution
03

When does nobody receive their own hat?

INTUITION

A derangement is a permutation pi with pi(i) not equal to i for every position i.

MATHEMATICAL STATEMENT
  1. A derangement is a permutation pi with pi(i) not equal to i for every position i.
  • Learning goalExplain definition in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionBuild the global count from local indicators
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 4 of 15 · tap to inspect in full resolution
04

How do we count correct hats in one shuffle?

INTUITION

Let I_i indicate that person i receives hat i; then X equals the sum of the six fixed-point indicators.

MATHEMATICAL STATEMENT
  1. Let I_i indicate that person i receives hat i; then X equals the sum of the six fixed-point indicators.
  • Learning goalExplain indicator count in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionFix one person and count locally
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 5 of 15 · tap to inspect in full resolution
05

What is the chance one chosen person is correct?

INTUITION

For a chosen person, fixing their own hat leaves five factorial arrangements, so P(I_j=1)=5!/6!=1/6.

MATHEMATICAL STATEMENT
  1. For a chosen person, fixing their own hat leaves five factorial arrangements, so P(I_j=1)=5!/6!=1/6.
  • Learning goalExplain one fixed point in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionThe expected number correct is one
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 6 of 15 · tap to inspect in full resolution
06

What is the average number of correct hats?

INTUITION

Linearity gives E[X]=sum P(I_i=1)=6 times one-sixth equals one, without requiring independence.

MATHEMATICAL STATEMENT
  1. Linearity gives E[X]=sum P(I_i=1)=6 times one-sixth equals one, without requiring independence.
  • Learning goalExplain expectation in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionOne experiment supports two questions
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 7 of 15 · tap to inspect in full resolution
07

Why is expectation not the whole distribution?

INTUITION

E[X]=1 is a long-run average; the PMF asks the probability of every possible fixed-point count k.

MATHEMATICAL STATEMENT
  1. E[X]=1 is a long-run average; the PMF asks the probability of every possible fixed-point count k.
  • Learning goalExplain expectation versus pmf in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionThe exact PMF uses derangements
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 8 of 15 · tap to inspect in full resolution
08

What is the probability of exactly k correct hats?

INTUITION

Choose the k fixed people, then derange the other n-k: P(X=k)=C(n,k)D_(n-k)/n factorial.

MATHEMATICAL STATEMENT
  1. Choose the k fixed people, then derange the other n-k: P(X=k)=C(n,k)D_(n-k)/n factorial.
  • Learning goalExplain fixed point pmf in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionEach person creates one unwanted set
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 9 of 15 · tap to inspect in full resolution
09

How does inclusion-exclusion begin?

INTUITION

Let A_i be the set of complete arrangements fixing person i; each set has size (n-1) factorial.

  • Learning goalExplain bad sets in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionSubtracting bad sets removes overlaps twice
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 10 of 15 · tap to inspect in full resolution
10

What counting mistake forces a correction?

INTUITION

An arrangement fixing persons 1 and 2 lies in both A_1 and A_2, so subtracting all single sets removes it twice.

  • Learning goalExplain double subtraction in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionPair intersections repair double subtraction
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 11 of 15 · tap to inspect in full resolution
11

Why add overlaps back?

INTUITION

For a chosen pair of fixed people, the remaining n-2 hats can be assigned in (n-2) factorial ways.

  • Learning goalExplain pair intersections in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionThree fixed people create three pair overlaps
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 12 of 15 · tap to inspect in full resolution
12

Why must inclusion-exclusion keep alternating?

INTUITION

An arrangement in a triple intersection belongs to three pair intersections, so pair corrections over-add it and a triple correction is required.

  • Learning goalExplain triple intersections in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionEvery correction creates the next correction
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 13 of 15 · tap to inspect in full resolution
13

What pattern does the bookkeeping follow?

INTUITION

Inclusion-exclusion alternates subtraction and addition through intersections of every size until each arrangement has the correct net weight.

  • Learning goalExplain inclusion exclusion pattern in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionThe derangement formula completes the count
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 14 of 15 · tap to inspect in full resolution
14

How many six-person derangements are there?

INTUITION

D_n=n! times the alternating reciprocal-factorial sum; D_6=265, so the probability of no fixed points is 265/720.

MATHEMATICAL STATEMENTS
  1. D_n=n!
  2. times the alternating reciprocal-factorial sum; D_6=265, so the probability of no fixed points is 265/720.
  • Learning goalExplain derangement formula in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionExactly k correct means derange everyone else
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.

Picture 15 of 15 · tap to inspect in full resolution
15

How does the full fixed-point distribution fit together?

INTUITION

For each k, choose the fixed positions and derange the rest; k=n-1 is impossible because one remaining person must also be fixed.

MATHEMATICAL STATEMENT
  1. For each k, choose the fixed positions and derange the rest; k=n-1 is impossible because one remaining person must also be fixed.
  • Learning goalExplain distribution synthesis in the fixed-point model.
  • Helpful foundationspermutations · factorials · indicator variables
  • Common trapE[X]=1 is an average, not a claim that every shuffle has exactly one fixed point; inclusion-exclusion is needed because bad sets overlap.
  • Next connectionUse inclusion-exclusion on a new forbidden-position problem
More context

The portrait diagram moves from an exact formula through three checks, a six-person visual, and one conclusion.