Maths Olympiad Prep

Library / /596 of 1394

Combinatorics Difficulty 5.2 AIME, harder Find the answer United States

Problem:
A random permutation of {1,2,,100}\{1,2, \ldots, 100\} is given. It is then sorted to obtain the sequence (1,2,,100)(1,2, \ldots, 100) as follows: at each step, two of the numbers which are not in their correct positions are selected at random, and the two numbers are swapped. If ss is the expected number of steps (i.e. swaps) required to obtain the sequence (1,2,,100)(1,2, \cdots, 100), then estimate A=sA=\lfloor s\rfloor. An estimate of EE earns max(0,2012AE)\max \left(0,\left\lfloor 20-\frac{1}{2}|A-E|\right\rfloor\right) points.

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

Solution:
Let f(n)f(n) be the expected number of steps if there are nn elements out of order. Let's consider one of these permutations and suppose that aa and bb are random elements that are out of order. The probability that swapping aa and bb sends aa to the proper place is 1n1\frac{1}{n-1}, and the probability that it sends bb to the proper place is 1n1\frac{1}{n-1}. Thus we can approximate
f(n)1+2n1f(n1)+n3n1f(n) f(n) \approx 1+\frac{2}{n-1} f(n-1)+\frac{n-3}{n-1} f(n)
(The chance that both get sent to the right place decreases the overall probability that the number of fixed points increases, but also decreases the expected number of moves after the swap. These effects largely cancel out.)
As a result, we conclude that
f(n)f(n1)+n12 f(n) \approx f(n-1)+\frac{n-1}{2}
and since f(0)=0f(0)=0 we have f(n)n(n1)4f(n) \approx \frac{n(n-1)}{4}. At the beginning, the expected number of elements that are in the right place is 1, so the answer is approximately f(99)999842425f(99) \approx \frac{99 \cdot 98}{4} \approx 2425. This is good enough for 19 points.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.