1987 AIME Problem 13

Attempt Problem 13 of the 1987 AIME below, then check your answer against the professionally curated solution from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 1987 AIME solutions, or check the answer key.

All problems are used with official legal permission of the Mathematical Association of America (MAA).

13.

A given sequence r1,r_1, r2,r_2, ,\ldots, rnr_n of distinct real numbers can be put in ascending order by means of one or more “bubble passes.” A bubble pass through a given sequence consists of comparing the second term with the first term, and exchanging them if and only if the second term is smaller, then comparing the third term with the second term and exchanging them if and only if the third term is smaller, and so on in order, through comparing the last term, rn,r_n, with its current predecessor and exchanging them if and only if the last term is smaller.

The example below shows how the sequence 1,1, 9,9, 8,8, 77 is transformed into the sequence 1,1, 8,8, 7,7, 99 by one bubble pass. The numbers compared at each step are underlined.

1987198718971879\begin{aligned} \underline{1}\quad\underline{9}\quad8\quad7\\ 1\quad\underline{9}\quad\underline{8}\quad7\\ 1\quad8\quad\underline{9}\quad\underline{7}\\ 1\quad8\quad7\quad9 \end{aligned}

Suppose that n=40,n=40, and that the terms of the initial sequence r1,r_1, r2,r_2, ,\ldots, r40r_{40} are distinct from one another and are in random order. Let pq,\frac{p}{q}, in lowest terms, be the probability that the number that begins as r20r_{20} will end up, after one bubble pass, in the 3030th place. Find p+q.p+q.

Answer: 931
Concepts:basic probabilitypermutationsprocess simulation
Difficulty rating: 2450
Small Hint:

After the comparison reaching position j,j, that position holds the maximum of the first jj original terms

Big Hint:

Characterize the relative ranks of r20r_{20} and r31r_{31} among the first 3131 terms

Solution:

For r20r_{20} to move right to position 30,30, it must exceed every other term among r1,,r30.r_1,\ldots,r_{30}. It stops at position 3030 exactly when r31>r20.r_{31}>r_{20}. Thus among the first 3131 terms, r31r_{31} must be greatest and r20r_{20} second greatest. These two ordered rank assignments have probability 131130=1930.\frac1{31}\cdot\frac1{30}=\frac1{930}. Therefore p+q=1+930=931.p+q=1+930=931.

← Problem 12#12
Full Exam

Problem 13 in Other Years