Parking functions

Parking functions and their variants (partial, weakly increasing, k-Naples, metered) and statistics on them: lucky cars, descents, displacement, and lucky statistics of Stirling permutations read as parking preferences.

DefinitionPartial parking function#✓fully proved

Let \(s, t \in \mathbb{N}\) and number the \(t\) spots \(0, \dots, t-1\). A map \(f : \{0, \dots, s-1\} \to \{0, \dots, t-1\}\), giving the preferred spot of each of \(s\) cars, is a partial parking function if for every spot \(k \in \{0, \dots, t-1\}\), at most \(t - k\) cars \(i\) satisfy \(f(i) \ge k\).

def IsPartialParkingFunction (s t : ℕ) (f : Fin s → Fin t) : Prop :=
  ∀ k : Fin t,
    (Finset.univ.filter (fun i => k ≤ f i)).card ≤ t - (k : ℕ)
Used by 29
Used byPeakless parking functions with \(n - 1\) ties · Peakless parking functions with \(n - 2\) ties · Peakless-tieless parking functions with first entry below the last · Peakless-tieless parking functions are counted by the Catalan numbers · Peakless-tieless parking functions by last entry · Valleyless-tieless parking functions are counted by the Fine numbers · Dyck words and nondecreasing parking functions · Descent generating function of parking functions · Descent sets versus reflected ascent sets of parking functions · Descent sets and ascent sets of parking functions are equidistributed · Reflection symmetry of descent sets of parking functions · Parking functions with descent set \(\{1, \dots, k\}\) · Recursion for parking functions with a given descent set · First and last entries of peakless-tieless parking functions · Nondecreasing and peakless-tieless parking functions are in bijection · Counting parking functions with a given descent set by their content · Total number of descents over parking functions · Flicking valleyless-tieless parking functions · Prepending \(1\) to valleyless-tieless parking functions · Parking function · Lower-tail characterization of parking functions · Factorial moments of the number of lucky cars · Expected number of lucky cars in weakly decreasing parking functions · Parking-function shuffles and the first entry · Classical parking functions are metered parking functions · Metered parking functions with a long meter are classical · Metered parking functions with one spot fewer than cars · Parking functions with a given first entry · Number of partial parking functions

DefinitionParking function#✓fully proved

Let \(n \in \mathbb{N}\) and number the \(n\) spots \(0, \dots, n-1\). A map \(f : \{0, \dots, n-1\} \to \{0, \dots, n-1\}\), giving the preferred spot of each of \(n\) cars, is a parking function if it is a partial parking function with \(n\) cars and \(n\) spots, that is, if for every spot \(k\), at most \(n - k\) cars \(i\) satisfy \(f(i) \ge k\).

def IsParkingFunction (n : ℕ) (f : Fin n → Fin n) : Prop :=
  IsPartialParkingFunction n n f
Uses 1 · Used by 34
Used byPeakless parking functions with \(n - 1\) ties · Peakless parking functions with \(n - 2\) ties · Peakless-tieless parking functions with first entry below the last · Peakless-tieless parking functions are counted by the Catalan numbers · Peakless-tieless parking functions by last entry · Valleyless-tieless parking functions are counted by the Fine numbers · Dyck words and nondecreasing parking functions · Every statistic encoding comes from a parking function · Descent generating function of parking functions · Descent sets versus reflected ascent sets of parking functions · Descent sets and ascent sets of parking functions are equidistributed · Reflection symmetry of descent sets of parking functions · Parking functions with descent set \(\{1, \dots, k\}\) · Recursion for parking functions with a given descent set · First and last entries of peakless-tieless parking functions · Nondecreasing and peakless-tieless parking functions are in bijection · Counting parking functions with a given descent set by their content · Total number of descents over parking functions · Statistic encodings with a unique parking function · Uniquely encoded parking functions have steps of at most one and no gaps · The sorted rearrangement of a uniquely encoded parking function · Valley plateaus of a uniquely encoded parking function equal \(1\) · Flicking valleyless-tieless parking functions · Prepending \(1\) to valleyless-tieless parking functions · Lower-tail characterization of parking functions · Parking functions with prescribed lucky and unlucky cars · Factorial moments of the number of lucky cars · Expected number of lucky cars in weakly decreasing parking functions · Generating polynomial of lucky cars · Lucky-car counts · Decreasing lucky-car counts · Increasing lucky-car counts · Metered parking functions with meter \(n - 1\) and more cars than spots · Metered parking functions with one spot fewer than cars

TheoremLower-tail characterization of parking functions#✓fully proved

Let \(n \in \mathbb{N}\), number the \(n\) spots \(0, \dots, n-1\), and let \(f : \{0, \dots, n-1\} \to \{0, \dots, n-1\}\) give the preferred spot of each of \(n\) cars. Then \(f\) is a parking function if and only if, for every spot \(k \in \{0, \dots, n-1\}\), at least \(k + 1\) cars \(i\) satisfy \(f(i) \le k\).

theorem isParkingFunction_iff_card_filter_le (n : ℕ) (f : Fin n → Fin n) :
    IsParkingFunction n f ↔
      ∀ k : Fin n,
        k.val + 1 ≤ (Finset.univ.filter (fun i : Fin n ↦ f i ≤ k)).card
Uses 2 · Used by 1

TheoremNumber of partial parking functions#✓fully proved

Let \(s\) and \(t\) be natural numbers with \(0 < s \le t\). A partial parking function with \(s\) cars and \(t\) spots is a map \(f : \{0, \dots, s - 1\} \to \{0, \dots, t - 1\}\) such that for every spot \(k \in \{0, \dots, t - 1\}\) at most \(t - k\) cars \(i\) have \(f(i) \ge k\). The number of partial parking functions with \(s\) cars and \(t\) spots is \((t + 1 - s)(t + 1)^{s - 1}\).

The proof is Pollak's circle argument.

theorem pollak_partial_parking_functions_card
    (s t : ℕ) (hs : 0 < s) (hst : s ≤ t) :
    Nat.card {f : Fin s → Fin t // IsPartialParkingFunction s t f} =
    (t + 1 - s) * (t + 1) ^ (s - 1)
Sources
  • Steve Butler, Kimberly Hadaway, Victoria Lenius, Preston Martens, and Marshall Moats, “Lucky Cars and Lucky Spots in Parking Functions”, Journal of Integer Sequences 29 (2026), Article 26.1.1, proposition at lines 330–332 of https://cs.uwaterloo.ca/journals/JIS/VOL29/Hadaway/had3.tex.
Uses 1
4 fully proved

The dependency explorer needs JavaScript and its graph data.

Download the complete graph data.