Lucky Cars and the Quicksort Algorithm
Combinatorics
2023-06-23 v1
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 .
Cite
@article{arxiv.2306.13065,
title = {Lucky Cars and the Quicksort Algorithm},
author = {Pamela E. Harris and Jan Kretschmann and J. Carlos Martínez Mori},
journal= {arXiv preprint arXiv:2306.13065},
year = {2023}
}
Comments
8 pages, and 2 figures, to appear in The American Mathematical Monthly