Problem 10.33 Medium Free 1 variation

Cycles of a Random Permutation

Fifty guests at a party each write their name on a slip of paper and drop it into a hat; then, one by one, each guest draws a random slip (without replacement). Two guests are placed in the same group if there is a chain of draws linking them: for instance if A draws B’s name, B draws C’s name, and C draws A’s name, then A, B and C form one group, and such a cycle can never be joined by anyone else. Equivalently, the groups are exactly the cycles of the random permutation sending each guest to the guest whose name they drew. Find the expected number of groups, rounded to the nearest tenth.

Work it out, then compare with the answer.

SolutionShow the worked solution

Key idea. Reveal the permutation one cycle at a time. At each step exactly one of the remaining names closes the current cycle.

Let σ\sigma be the uniformly random permutation of the n=50n=50 guests, where σ(i)\sigma(i) is the guest whose name ii drew. Reveal σ\sigma as follows.

  • Start at guest 11 and reveal σ(1)\sigma(1), then σ(σ(1))\sigma(\sigma(1)), and so on.
  • When the chain returns to its starting guest, the current cycle is complete.
  • Then restart from the lowest-numbered guest not yet visited.

There are nn reveals in total. Suppose kk names have not yet been revealed as images when a reveal is made. By symmetry, the next image is uniform over those kk names. Exactly one of them is the name of the guest who started the current cycle, since that name cannot yet have been used. So this reveal closes a cycle with probability 1/k1/k, whatever happened before.

As the reveals proceed, kk runs through n,n−1,…,1n, n-1, \dots, 1. The number of groups CC is the number of reveals that close a cycle. By linearity of expectation,

E[C]=∑k=1n1k=Hn.\mathbb{E}[C]=\sum_{k=1}^{n}\frac1k = H_n .

Alternative. Count kk-cycles directly. A given set of kk guests can be arranged in a cycle in (k−1)!(k-1)! ways. Each such cycle occurs in σ\sigma with probability (n−k)!/n!(n-k)!/n!. Hence

E[# k-cycles]=(nk)(k−1)! (n−k)!n!=1k.\mathbb{E}[\#\,k\text{-cycles}]=\binom{n}{k}(k-1)!\,\frac{(n-k)!}{n!}=\frac1k .

Summing over kk again gives HnH_n.

For n=50n=50, H50≈4.4992H_{50}\approx 4.4992, which rounds to 4.54.5.

E[C]=H50=∑k=1501k≈4.5\boxed{\mathbb{E}[C]=H_{50}=\sum_{k=1}^{50}\frac1k\approx 4.5}

Variations

The same idea with a twist. Each solution gives only the changed step.

Variation 10.33a

Fifty guests at a party each write their name on a slip of paper and drop it into a hat; then, one by one, each guest draws a random slip (without replacement). Two guests are placed in the same group if there is a chain of draws linking them (so the groups are exactly the cycles of the resulting random permutation). Find the average size of a group, rounded to the nearest tenth.

Work it out, then compare with the answer.

Solution

We interpret “average size of a group” as the mean size of a group chosen uniformly from all groups occurring across all n!n! equally likely draws.

From the alternative above, the expected number of kk-cycles is 1/k1/k. So the n!n! permutations together contain n!/kn!/k cycles of length kk, and n! Hnn!\,H_n cycles in total. A uniformly chosen cycle therefore has length kk with probability

n!/kn! Hn=1kHn.\frac{n!/k}{n!\,H_n}=\frac{1}{kH_n}.

Its expected length is

∑k=1nk⋅1kHn=nHn.\sum_{k=1}^{n}k\cdot\frac1{kH_n}=\frac{n}{H_n}.

This equals the total number of guests divided by the expected number of groups. Other readings of “average” give different answers:

  • E[50/C]≈13.3\mathbb{E}[50/C]\approx 13.3;
  • the group containing a fixed guest has size uniform on {1,…,n}\{1,\dots,n\}, so its mean is n+12=25.5\frac{n+1}{2}=25.5.

For n=50n=50, 50/H50≈11.1150/H_{50}\approx 11.11.

50H50≈11.1\boxed{\frac{50}{H_{50}}\approx 11.1}