Lucky Cars and the Quicksort Algorithm
arXiv:2306.13065
Abstract
Quicksort is a classical divide-and-conquer sorting algorithm. It is a comparison sort that makes an average of comparisons on an array of size ordered uniformly at random, where is the th harmonic number. Therefore, it makes comparisons to sort all possible orderings of the array. In this article, we prove that this count also enumerates the parking preference lists of cars parking on a one-way street with parking spots resulting in exactly lucky cars (i.e., cars that park in their preferred spot). For , both counts satisfy the second order recurrence relation with .
8 pages, and 2 figures, to appear in The American Mathematical Monthly