550 views
6 votes
6 votes

An algorithm takes a list of 2^{n} numbers [a_{1}, a_{2},a_{3},.... a_{2^{n}}] and replaces it with [b_{1}, b_{2},b_{3},.... b_{2^{n-1}}] where b_{1}= max\{a_{1},a_2\}, b_{2}= max\{a_{3},a_4\},.....

Then it performs the same operation on the resulting list (replacing each pair of consecutive elements with their maximum), and it continues doing the same until there are only two elements left in the list.

For instance, if the initial list is [3, 7, 6, 8, 2, 1, 4, 5], then after the first run, it becomes [7, 8, 2, 5] and then [8, 5]. Suppose that the elements of the initial list are the integers 1 through 64 in random order.

What is the probability that the number 63 will appear in the final two-element list?

A) 1/63

B) 1/4

C) 1

D) 32/63

1 Answer

Best answer
5 votes
5 votes
we have numbers from $1$ to $64$. in each round, $63$ has to come out from the two element comparison. for this, we should never be comparing $63$ with $64$ since in that case, $63$ will be discarded as it is smaller.

take the first round of comparisons. we can pair $63$ with any number except $64$. we have to make a pair {63,___ }  in which any of the $62$ out of $63$ numbers which are less than $63$ can come so that 63 is guaranteed to be in the next round. let this probability be $P_1$

$P_1 =Probability\ that\ 63\ goes\ to\ next\ round\ = \dfrac{62}{63}$

similarly, in next round, we have 64,63 and 30 other numbers which we don't care. we can pair any of them with 63 except 64 so that we can filter out 63 to next round. let this be $P_2$

$P_2 = \dfrac{30}{31}$

going like this, we get following probabilities for further rounds that $63$ gets propagated.

$P_3 = \dfrac{14}{15}$ , $P_4 = \dfrac{6}{7}$ and $P_5=\dfrac{2}{3}$ and we are left with $64$ and $63$ in the last round.

Total probability $P = P_1 *P_2*P_3*P_4*P_5$

$P = \dfrac{62*30*14*6*2}{63*31*15*7*3}$

$P = 0.5079$ which matches with option D's value.
selected by

Related questions

2 votes
2 votes
1 answer
2
practicalmetal asked Jan 3
220 views
8 pairs of hand gloves are on a shelf ( each of different colour). Four gloves are selected at random, the probability that there will be at least one pair is?