I don't know how to answer the following, so here goes.
10 people decide to exchange gifts, in the following manner:
All 10 people write down their names on pieces of paper, and along with their names go their gift preferences.
They put the names in a box and then each person randomly picks out a name from the box.
They then give their gifts to the person whose name they drew from the box. If a person draws his own name, then he gives his gift to himself.
Now, if Anne gives his gift to Bob, and Bob gives his gift to Charles, and Charles gives his gift to Anne, then Anne, Bob and Charles are said to be in a chain, with 3 members.
Now for the million-dollar question:
What is the expected length of the longest chain in the group?
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
I don't know how much you know about permutations, so I'll start from the basics. Consider the following permutation π on the set {1,2,3,…,10}: π(1)π(2)π(3)π(4)π(5)π(6)π(7)π(8)π(9)π(10)=9,=10,=8,=6,=4,=1,=7,=3,=5,=2. (This is just like assigning names to people, except we're using numbers. In other words, imagine we assign a number from 1 to 10 to everyone.) One way to work with a permutation is to write down its cycles. So for the permutations above, π takes 1 to 9, 9 to 5, 5 to 4, 4 to 6, then 6 back to 1. Similarly, it takes 2 to 10 and 10 to 2, 3 to 8 and 8 to 3, and 7 to itself. So we can write down the cycles of the permutation π this way: (1,9,5,4,6)(2,10)(3,8)(7). This representation is known as the cycle decomposition of a permutation. Your question is to determine the expected length of the longest cycle in a random permutation.
To do so, we can list all the cycle types, and how many permutations there are of each type. The cycle type refers to the length of the cycles in the permutation. For the example above, the cycle type is 1, 2, 2, 5, because there is one cycle of length 1, two cycles of length 2, and one cycle of length 5.
This is what the table would look like for permutations on the set {1,2,3,4,5}: Cycle Type1,1,1,1,11,1,1,21,1,31,2,21,42,35Number of Permutations1102015302024
So for 5 people, the expected length of the longest cycle is 1201⋅1+10⋅2+20⋅3+15⋅2+30⋅4+20⋅3+24⋅5=40137. Everything would be done similarly for 10 people; once you determine the numbers in the table, the rest is a routine calculation.
Having said all this, I doubt there is any nice, general formula for your problem, i.e. one that would generalize to n people. You could consider the expected number of cycles in a random permutation; it turns out that this question has a relatively nice answer.
Log in to reply
Oh, thanks, I understood everything you said :D
But what about the expected number of cycles? Can you please give a hint? O.o
Log in to reply
Oh, wait, I'm getting a nice formula...
E(x)=xi=1∑x−1E(i)+x ?
I got that by considering the cycle which person 1 is in. AMAZING! It's 1+21+31+⋯+x1 :D
Log in to reply
Well done!
Here is a simple counting proof. Let n be the number of people, and let 1≤k≤n. We count the number of k-cycles (cycles of length k) among all n! permutations.
First, we determine the number of different possible k-cycles. There are (kn) ways to choose the k numbers to go into the k-cycle, then (k−1)! ways to arrange them to form a k-cycle. This gives (kn)(k−1)! possible k-cycles.
Now, each particular k-cycle appears in (n−k)! different permutations (because there are n−k elements remaining), so the expected number of k-cycles is n!(kn)(k−1)!(n−k)!=k1.
Finally, summing over 1≤k≤n, we find that the expected number of cycles is 1+21+31+⋯+n1.