Avoid common mistakes on your manuscript.
Let us suppose that n cars enter a one-way street with n parking spaces marked \(1,2,\ldots ,n\), in that order, and each driver intends to park in a particular spot. Say, the ith driver wishes to park in the spot marked \(p(i)\in [n]\), where [n] denotes the set \(\{1,2,\ldots ,n\}\).
Suppose that if driver i finds his favorite spot free, he parks there, but if he finds it occupied by any of the previous \(i-1\) drivers, he looks for the next free space after spot p(i) for parking, and if none exists, he leaves without parking. For which functions \({\textbf{p}}:[n]\rightarrow [n]\) is it possible for all the drivers to park? Let us call such functions parking functions of length n.Footnote 1
The answer to this question was given by Konheim and Weiss [3] as follows: Let
denote the nondecreasing rearrangementFootnote 2 of
If we set
then the parking functions are those for which
In this article, we are mainly interested in the subclass of prime parking functions, which are those \({\textbf{p}}\) such thatFootnote 3
For an example of a parking function, suppose that \(n=15\) and take
which takes \(1\mapsto 3\), \(2\mapsto 13\), etc. Then all cars can park in the previously described sense. In fact, the parking goes as follows:
![figure a](http://media.springernature.com/lw685/springer-static/image/art%3A10.1007%2Fs00283-023-10275-5/MediaObjects/283_2023_10275_Figa_HTML.png)
And indeed,
which is componentwise less than or equal to \((1,2,\ldots ,15)\).
Parking functions occur when we consider the set of hyperplanes in \({\mathbb {R}}^n\) defined by the equations \(x_i =x_j + k\), where \(1\le i<j\le n\) and \(k=0,1\), all of which contain a line parallel to the line \(\ell \) with equation \(x_1=x_2=\cdots =x_n\). Hence, we may represent each hyperplane by its intersection with a given hyperplane orthogonal to \(\ell \), for example, the hyperplane with equation \(x_1+x_2+\cdots +x_n=0\) (Figure 1).
Label the region \(R_0\) defined by \( x_1>x_2>\cdots>x_n>x_1+1 \) with \( (1,1,\ldots ,1)\in {\mathbb {Z}}^n\). Given regions R and \(R'\) separated by the unique hyperplane H such that R and \(R_0\) are on the same side of H, give to \(R'\) the label of R but add 1 to one coordinate: the ith coordinate if H is defined by an equation of the form \( x_i=x_j \), \(i<j\), and the jth coordinate if H is defined by an equation of the form \( x_i=x_j+1 \).
Pak and Stanley showed [4] that the labels thus defined are exactly the parking functions of length n. We proved [1] that the prime parking functions are the Pak–Stanley labels of the relatively bounded regions (shaded in Figure 1, where the cases \(n=2\) and \(n=3\) are represented, the first one directly, and both by projecting, as explained above).
Our Main Theorem
Let \(\text {PF}_{n}\) be the set of parking functions of length n, and \(\text {PF}'_{n}\subseteq \text {PF}_{n}\) the set of prime parking functions of length n. We know that
The goal of this paper is to prove (4) in a simple and original manner, as a direct consequence of Theorem 1 below.
Prime parking functions were introduced by Gessel, who proved (4) through generating functions (cf. [5, Exercise 5.49f]). Soon thereafter, Kalikow [2, p. 37] gave a direct proof, which inspired ours.
Theorem 1.
For every \({\textbf{a}}=(a_1,\ldots ,a_n):[n]\rightarrow [n-1]\), there exist a unique \(k\in [n-1]\) and a unique prime parking function \({\textbf{b}}=(b_1,\ldots ,b_n)\) such that
Conversely, given \(k\in [n-1]\) and the parking function \({\textbf{b}}=(b_1,\ldots ,b_n)\), (5) defines the function \({\textbf{a}}=(a_1,\ldots ,a_n)\) uniquely.
Proof.
Without loss of generality, suppose that \({\textbf{a}}^\uparrow ={\textbf{a}}\), and define, for every \(i\in [n-1]\),
and let \(d\in [n]\) be such that \(s_d=\min \{s_i\mid i\in [n]\}\). Let \(k=a_d\), and
Since for \(i\ne d\), we have
it follows that
Therefore, \({\textbf{b}}\) is a prime parking function, for it is componentwise less than or equal to
For proving the uniqueness, suppose, contrary to our assumptions, that both \({\textbf{b}}=(b_1,\ldots ,b_n)\) and \({\textbf{c}}=(c_1,\ldots ,c_n)\) were prime parking functions and that they satisfied the hypothesis of our theorem. Then there would exist \(\ell \in {\mathbb {N}}\) such that \(c_i\equiv b_i+\ell \pmod {n-1}\) for every \(i\in [n]\). Without loss of generality, we suppose that \({\textbf{b}}^\uparrow ={\textbf{b}}\). If \(b_n+\ell <n\), then \(c_1=1+\ell =1\), and \(\ell =0\) and \({\textbf{b}}={\textbf{c}}\). Otherwise, let \(b_{i-1}<n-\ell \le b_i\). Then
Hence, \(b_i=n-\ell <i\) and \(\ell +1\le n-i+1\). This contradiction concludes the proof. \(\square \)
For example, as before, let
Then if \(k=10\) and \(a_i\equiv b_i+k-1\pmod {n-1}\) for every \(i\in [n]\), it follows that
Note that Theorem 1 shows that \((n-1)^n = (n-1) |\text {PF}'_{n}|\), whence the number of prime parking functions is indeed \((n-1)^{n-1}\).
The Parking Point of View
Note that by (1) and (2), a prime parking function of length n is a parking function of length \(n-1\) with an extra 1. More precisely, if \({\textbf{a}}=(a_1,\ldots ,a_n):[n]\rightarrow [n-1]\), \(a_i=1\) for some \(i\in [n]\), and
then \({\textbf{a}}\in \text {PF}'_{n}\) if and only if \({\textbf{b}}\in \text {PF}_{n-1}\). Hence \({\textbf{a}}:[n]\rightarrow [n-1]\) is a prime parking function if all cars can park in a one-way street with n spots labeled 1, 1, 2, . . . , \(n-1\). For instance,
parks as follows:
![figure b](http://media.springernature.com/lw685/springer-static/image/art%3A10.1007%2Fs00283-023-10275-5/MediaObjects/283_2023_10275_Figb_HTML.png)
In fact, if all elements of \({\textbf{a}}\) park as described, the element of \({\textbf{a}}\) that parks in the first spot labeled 1 must be \(a_i=1\), so that \(a_j>1\) for every \(j<i\). Then let \({\textbf{b}}\) be as defined above.
Since \({\textbf{b}}\) is \({\textbf{a}}\) with ith coordinate (equal to 1) deleted, and by hypothesis, \({\textbf{a}}\) parks where the n spots are labeled \(1,1,2,\ldots ,n-1\), then \({\textbf{a}}\) parks the ith element in the first spot labeled 1, and afterward, it parks the elements of \({\textbf{b}}\) in the subsequent spots (labeled \(1,2,\ldots ,n-1\)). So \({\textbf{b}}\) is a parking function.
On the other hand, if again, \(a_i=1\) for some \(i\in [n]\) such that \(a_j>1\) for every \(j\in [i-1]\), then the parking procedure parks \(a_i\) in the first spot labeled 1 and parks the remaining elements of \({\textbf{a}}\) in the next positions, since they are the elements of \({\textbf{b}}\).
An immediate consequence of Theorem 1 is the following addendum to Konheim and Weiss’s result.
Proposition 2.
Let n cars enter a one-way street with n spots, and suppose driver i wants to park in position \(p(i)\le n-1\) . Then there is a unique \(k\in [n-1]\) such that all cars can park in the previous sense, provided the spots are labeled consecutively
![figure c](http://media.springernature.com/lw685/springer-static/image/art%3A10.1007%2Fs00283-023-10275-5/MediaObjects/283_2023_10275_Figc_HTML.png)
For example, for
we have
![figure d](http://media.springernature.com/lw685/springer-static/image/art%3A10.1007%2Fs00283-023-10275-5/MediaObjects/283_2023_10275_Figd_HTML.png)
Notes
Parking functions have attracted much attention since their definition by Konheim and Weiss. For a recent survey, see [6].
That is, \(q_i=p_{\pi _i}\) for some permutation \(\pi \in {\mathfrak {S}}_n\) such that \(q_1\le q_2\le \cdots \le q_n\).
By definition, we may consider a length-n prime parking function as a function \(p:[n]\rightarrow [n-1]\).
References
R. Duarte, and A. Guedes de Oliveira. The braid and the Shi arrangements and the Pak–Stanley labelling. Europ. J. Combin. 50 (2015), 72–86. https://doi.org/10.1016/j.ejc.2015.03.017.
L. Kalikow. Enumeration of parking functions, allowable permutation pairs, and labeled trees. Ph.D. thesis, Brandeis University, 1999.
A. G. Konheim and B. Weiss. An occupancy discipline and applications. SIAM J. Appl. Math. 14 (1966), 1266–1274. https://doi.org/10.1137/0114101.
R. P. Stanley. Hyperplane arrangements, interval orders and trees. Proc. Nat. Acad. Sci. 93 (1996), 2620–2625. https://doi.org/10.1073/pnas.93.6.2620.
R. P. Stanley. Enumerative Combinatorics, volume 2. Cambridge University Press, 1999. https://doi.org/10.1017/CBO9780511609589.
C. Yan. Parking Functions. In Handbook of Enumerative Combinatorics, edited by M. Bóna, pp. 589–678. CRC Press, 2015 https://doi.org/10.1201/b18255-19.
Acknowledgments
The authors thank the referee and the editor for a very thorough reading. The authors were partially supported by CIDMA and CMUP, respectively, which are financed by national funds through Fundação para a Ciência e a Tecnologia (FCT) within projects UIDB/04106/2020 (CIDMA) and UIDB/00144/2020 (CMUP).
Funding
Open access funding provided by FCT|FCCN (b-on).
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
The original online version of this article was revised to correct the author’s name.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Duarte, R., Guedes de Oliveira, A. The Number of Prime Parking Functions. Math Intelligencer (2023). https://doi.org/10.1007/s00283-023-10275-5
Accepted:
Published:
DOI: https://doi.org/10.1007/s00283-023-10275-5