Misplaced Pages

Parking function

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Generalization of permutations

Parking functions are a generalization of permutations studied in combinatorics, a branch of mathematics.

Definition and applications

A parking function of length n {\displaystyle n} is a sequence of n {\displaystyle n} positive integers, each in the range from 1 to n {\displaystyle n} , with the property that, for every i {\displaystyle i} up to the sequence length, the sequence contains at least i {\displaystyle i} values that are at most i {\displaystyle i} . That is, it must contain at least one 1, at least two values that are 1 or 2, at least three values that are 1, 2, or 3, etc. Equivalently, if the sequence is sorted, then for each i {\displaystyle i} in the same range, the i {\displaystyle i} th value of the sorted sequence is at most i {\displaystyle i} .

For instance, there are 16 parking functions of length three:

(1,2,3), (2,3,1), (3,1,2),
(3,2,1), (2,1,3), (1,3,2),
(1,1,2), (1,2,1), (2,1,1),
(1,1,3), (1,3,1), (3,1,1),
(1,2,2), (2,1,2), (2,2,1),
(1,1,1).
Parking along a one-way road (Portobello Road in London)

The name is explained by the following thought experiment. A sequence of n {\displaystyle n} drivers in cars travel down a one-way street having n {\displaystyle n} parking spaces, with each driver having a preferred parking space. Each driver travels until reaching their preferred space, and then parks in the first available spot. A parking function describes preferences for which all cars can park. For instance, the parking function (2,1,2,1) describes preferences for which the first and third drivers both prefer the second space, while the other two drivers both prefer the first space. The first driver parks in space 2, the second in space 1, and the third in space 3 (because space 2 is taken). The fourth driver starts looking for a free space at space 1, but doesn't find it until space 4; all previous spaces were taken. The sequence (3,3,1,3) is not a parking function: too many drivers prefer space 3, so the last driver starts looking for a space after already passing the only free space, and will be unable to park.

Parking functions also have a more serious application in the study of hash tables based on linear probing, a strategy for placing keys into a hash table that closely resembles the one-way parking strategy for cars.

Combinatorial enumeration

The number of parking functions of length n {\displaystyle n} is exactly ( n + 1 ) n 1 . {\displaystyle (n+1)^{n-1}.} For instance for n = 3 {\displaystyle n=3} this number is 4 2 = 16 {\displaystyle 4^{2}=16} .

John Riordan credits to Henry O. Pollak the following argument for this formula. On a circular one-way road with n + 1 {\displaystyle n+1} spaces, each of n {\displaystyle n} cars will always be able to park, no matter what preference each driver has for their starting space. There are ( n + 1 ) n {\displaystyle (n+1)^{n}} choices for the preferences, each of which leaves one vacant space. All spaces are symmetric to each other, so by symmetry, there are ( n + 1 ) n 1 {\displaystyle (n+1)^{n-1}} choices for preferences that leave space n + 1 {\displaystyle n+1} as the vacant space. These choices are exactly the parking functions. The parking functions can also be placed in bijection with the spanning trees on a complete graph with n + 1 {\displaystyle n+1} vertices, one of which is designated as the root. This bijection, together with Cayley's formula for the number of spanning trees, again shows that there are ( n + 1 ) n 1 {\displaystyle (n+1)^{n-1}} parking functions.

Much research has studied the number of parking functions of a special form. As a very simple special case, the parking functions that allow each car to park in its own preferred spot are exactly the permutations, counted by the factorials. The parking functions that allow each car to park either in its preferred spot or in the next spot are counted by the ordered Bell numbers.

References

  1. ^ Yin, Mei (2023), "Parking functions: interdisciplinary connections", Advances in Applied Probability, 55 (3): 768–792, arXiv:2107.01767, doi:10.1017/apr.2022.49, MR 4624028
  2. ^ Riordan, John (1969), "Ballots and trees", Journal of Combinatorial Theory, 6 (4): 408–411, doi:10.1016/S0021-9800(69)80039-6, MR 0234843
  3. Konheim, Alan G.; Weiss, Benjamin (November 1966), "An occupancy discipline and applications", SIAM Journal on Applied Mathematics, 14 (6): 1266–1274, doi:10.1137/0114101
  4. Meyles, Lucas Chaves; Harris, Pamela E.; Jordaan, Richter; Kirby, Gordon Rojas; Sehayek, Sam; Spingarn, Ethan (2023), Unit-interval parking functions and the permutohedron, arXiv:2305.15554; Meyles et al credit the connection between parking functions and ordered Bell numbers to a 2021 bachelor's thesis by Kimberly P. Hadaway of Williams College
Category: