Lucky Cars and the Quicksort Algorithm
Pamela E. Harris, Jan Kretschmann, and J. Carlos Mart\'inez Mori

TL;DR
This paper reveals a surprising connection between the average comparisons in Quicksort and parking preferences of cars, showing that both counts follow the same recurrence relation and enumerate the same combinatorial structures.
Contribution
It establishes a novel link between Quicksort comparison counts and parking preference arrangements, providing new combinatorial insights.
Findings
Quicksort comparison counts match parking preference distributions.
Both counts satisfy the same recurrence relation.
The enumeration involves exactly one less lucky car in parking scenarios.
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 .
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Combinatorial Mathematics · graph theory and CDMA systems · Algorithms and Data Compression
