number of parking functions

Tags: #theorem

Statement

The number of parking functions on n cars and parking spots is

(n+1)n1

Proof 1

Consider the modified procedure where we have n cars and n+1 spots arranged on a circular road. Let f:[n][n+1] with the same parking procedure (note that a car will always find a spot, and one of the spots will be empty).

Let Pi be the set of preference functions f such that the ith spot is empty. We note the following:

Furthermore, there are (n+1)n preference functions, and so |P1|=1n+1(n+1)n=(n+1)n1

Proof 2 (biject with labelled trees)

First, we biject with labelled Dyck paths: for every up step, we label them 1 through n such that consecutive up steps have increasing labels.

Given a labelled Dyck path, we can construct a parking function:

example:
Pasted image 20260430141725.png|300

Finally, there is a bijection between labelled Dyck paths and labelled trees on n+1 vertices.