752 views
3 votes
3 votes
Let us a consider a series of events where a random partition procedure always picks the median element among n distinct numbers dividing the array into two equal halves ( ignore floor and ceiling). What is the probability that such a partition procedure always picks the median element in all subsequent arrays till the entire array is sorted.

1 Answer

3 votes
3 votes

The probability of selecting the median among n numbers is  1/n

The probability of selecting the median from the 2 n/2 partitions is (2/n)*(2/n) = 22/n2

In a similar way the series will appear as  (1/n) x (22/n2) x (44/n)x....x (Log nlog n/nlog n-1)

So the probability of picking median till the entire array is sorted will be    $\frac{\prod_{i=0}^{log n} (2^{i})^{2^{i}}}{(n^{2})^{\frac{(Log n-1)Log n}{2}}}$

Related questions

0 votes
0 votes
0 answers
1
0 votes
0 votes
1 answer
2
Vaishnavi01 asked Sep 21, 2018
672 views
True or False :In randomized quicksort , each key is involved in the same number of comparisons.
1 votes
1 votes
1 answer
4
dragonball asked Sep 27, 2017
615 views
Could anyone describe how the partitioning algorithm vary when the pivot is varied ?In Cormen , last element is taken as pivot . Suppose I took first element or middle e...