Considering the Randomized Quicksort algorithm, if we fix an input array A of length n and, for i < j, let Xij be the random variable that counts how many times the lowest i-th element in A is compared to the lowest j-th element in B, how do we prove rigorously (from start to finish, with, say, the sample space explicitly mentioned) that E[Xij] is precisely 2 / (j - i + 1)?
The closest thing to what I want I've been able to find is the last slide on page 3 here, where a new event A_k is introduced. What I can't follow here is how do we show P[Xij = 1 | A_k] is precisely 2 / (j - i + 1), even though it looks true (since exactly 2 out of the Ai, .. , Aj (j - i + 1 elements) guarantee Xij = 1, namely Ai and Aj).
Aucun commentaire:
Enregistrer un commentaire