Generalize the induction hypothesis [00QC]

The solution—as often with recursive algorithms—is to generalize to compute something more than what is required. In particular, instead of just finding the median element, let’s write an algorithm to select the element which would be at index k if the list were sorted. If we can do this, we can get the median by selecting the element at index \lfloor n/2 \rfloor . But this ability to select any element gives us the extra flexibility we need to use recursion to find the median, since the median of the entire list will not be the median of one of the two partitions, but some other index.