MathDB
Problems
Contests
National and Regional Contests
USA Contests
MAA AMC
AIME Problems
1987 AIME Problems
13
13
Part of
1987 AIME Problems
Problems
(1)
Bubble passes
Source:
3/16/2006
A given sequence
r
1
,
r
2
,
…
,
r
n
r_1, r_2, \dots, r_n
r
1
,
r
2
,
…
,
r
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,
r
n
r_n
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, 9, 8, 7 is transformed into the sequence 1, 8, 7, 9 by one bubble pass. The numbers compared at each step are underlined. \begin{array}{c} \underline{1 9} 8 7 \\ 1 \underline{9 8} 7 \\ 1 8 \underline{9 7} \\ 1 8 7 9 \end{array} Suppose that
n
=
40
n = 40
n
=
40
, and that the terms of the initial sequence
r
1
,
r
2
,
…
,
r
40
r_1, r_2, \dots, r_{40}
r
1
,
r
2
,
…
,
r
40
are distinct from one another and are in random order. Let
p
/
q
p/q
p
/
q
, in lowest terms, be the probability that the number that begins as
r
20
r_{20}
r
20
will end up, after one bubble pass, in the
3
0
th
30^{\text{th}}
3
0
th
place. Find
p
+
q
p + q
p
+
q
.
probability