# Expectation for the number of comparisons in a randomized Quicksort

I found this link: http://theory.stanford.edu/~tim/w11/l/qsort.pdf and it kind of theoretically describes how to approach finding expectation for the number of comparisons in a Quicksort.

Using this, how would I find and prove the expectation for an array of a concrete number of items, for example 5? (see the formula in the second section of the link) Would my expectation be !https://i.imgur.com/7BIE3qj.png)! but replace the n by 5 for example (to get the expected number of comparisons for a 5 length array)

• Did you try writing down the series term-wise for $\mathbb{E}[C]$ using $n=5$(first part of second formula)? – LastIronStar Nov 13 '17 at 21:13