Expectation · Sorting a list · difficulty 5 of 5
Comparisons in quicksort
Quicksort sorts 10 different numbers: pick a random pivot, compare everything else to it, split, and repeat on each side. How many comparisons does it make on average? Give a decimal.
Answer with an expected value. First lock in a gut guess with an 80% range, then solve it properly, then watch a simulation settle on the truth.
More expected value puzzles
- Counting up with a die · Rolling a die
- Cards between the jokers · A deck with two jokers
- Counting streaks · Coin flips
- Heads and tails both · Coin flips
- Heads, then tails · Flipping a coin
- Letters in the right envelopes · Mail
All expected value puzzles · All puzzles · Market making game