Cars parked at random fill three quarters of the kerb
Worth reading first: The last passenger gets one of two seats · A stick broken in three.
A street has a kerb of some length, and cars of length one arrive one at a time. Each driver picks a place uniformly at random among all the places where a car still fits, and parks there. Nobody moves up to make room, and nobody squeezes in with a bumper overhanging a driveway. Eventually every gap between parked cars is shorter than a car, and the street is full. How much of the kerb is covered?
A careful attendant could cover all of it, or all but a fraction of a car. Random parking wastes space in every gap that ends up a little too short, and the question is how much. Alfréd Rényi answered it in 1958: on a long kerb, the cars cover a share that tends to
just under three quarters. The number has no simpler name and is not known to be expressible in terms of more familiar constants. It is not the parking problem of cars on a one-way street that each take the first free space, where every car eventually parks and the question is whether anyone is left over; here nobody has an assigned place, and the question is how much room is wasted. Rényi’s constant is the continuous ancestor of a whole family of questions — called random sequential adsorption by the chemists and physicists who met it in molecules settling on a surface — and it is one of the very few members of that family whose answer is known exactly.
This essay derives the constant from one observation about the first car, computes the expected number of cars for every length of kerb, checks every curve against seeded simulations, and then cuts the kerb into whole sites, where the answer turns into .
Three kerbs, and the gaps nobody can use
The figure fills three kerbs of length 24, with the cars numbered in the order they arrived. The rule is easy to simulate exactly. At any moment the parked cars leave a set of free stretches, and a stretch of length offers units of possible positions for a new car’s front bumper if and none otherwise; the next car’s position is uniform over the union of those possibilities, so it lands in a stretch with probability proportional to that stretch’s spare room and then uniformly inside it.
The three kerbs take 17, 17 and 15 cars. Each would have taken 24 under an attendant, so random parking has thrown away between seven and nine car lengths, scattered through the street in pieces too small to use. That waste is the whole subject. On the top kerb, cars 1 and 15 are packed almost bumper to bumper, while between cars 6 and 14 there is a gap of nearly a full car length — a gap that would have taken a car if it had been a few centimetres longer. Nothing about the rule pushes cars together or spreads them evenly; it only refuses to place a car where it does not fit.
The order of arrival tells a story of its own. Car 1 landed near the left end; car 3, near the right; most of the first ten cars arrived while there was still plenty of room and could have gone almost anywhere. The last few cars all landed in gaps between one and two car lengths, the only places left, and each of them left two smaller gaps behind it that nothing could ever fill. A kerb fills quickly at first and then slowly, because the late arrivals have fewer and fewer places to go, and the end comes when the last gap of length at least one has been used.
The mean of 17.69 under the figure is not an average of simulations. It comes from an exact equation, and the next section is where the equation comes from.
The first car splits the problem in two
Look at the first car only. It lands at a position chosen uniformly from to , and it divides the kerb into a stretch of length on its left and a stretch of length on its right. From then on, the two stretches never interact. A car arriving later lands in one or the other, with probability proportional to the spare room in each, but the final arrangement in each stretch depends only on the stretch, not on when cars arrived there relative to the other side. So the final configuration of a kerb of length is the first car plus two independent random parkings of kerbs of lengths and .
The figure draws one parking that way, as a tree of splits. The first car sits in the top row. The next row shows the cars that landed first in each of the two kerbs it created, and so on downwards, each row greying the cars already placed. This is the same recursion that splits a stick at a random point and then breaks each piece again, and it is the same device that made the lost boarding pass tractable: a random process that, after one step, becomes two smaller copies of itself.
Write for the expected number of cars on a kerb of length . A kerb shorter than one takes none. On a longer kerb, the first car counts one, and the two sides contribute their own expectations, averaged over the uniform position:
The two integrals are equal because and run over the same range. This single equation contains the whole answer, and it can be solved step by step along the kerb, since on the right is only ever needed at lengths shorter than .
A share that settles just below three quarters
The first few lengths can be done by hand. A kerb between one and two takes exactly one car, because after the first car neither side has room, so there and falls from 1 to . Between two and three, a second car fits only if the first left a side at least one long, and the integral gives , which is 2 exactly at : a kerb of three takes two cars with probability one, since a third would need the first car exactly at an end or exactly in the middle. After that the algebra becomes unpleasant and the equation is solved on a grid of step . The figure draws the result, , together with the average of four thousand seeded parkings at every whole length from 1 to 30, and the dots sit on the curve.
The curve oscillates for short kerbs, where whether a second or third car fits is a matter of where the first one landed, and then flattens. Rényi proved that it tends to , and more: that plus an error that falls off faster than any power of . The dashed curve in the figure is . Computed from the equation, the error is 0.0045 cars at length 4, 0.0005 at length 5, and below a hundred-thousandth of a car from length 6 onwards, the limit of the grid. A street of length thirty takes, on average, cars, and the equation agrees to the last digit shown.
Rényi’s route to the constant was to differentiate. Multiplying the equation through by and differentiating gives a delay differential equation, , in which the rate of change at depends on the value one car length back. A Laplace transform turns the delay into a multiplication by , the transformed equation can be solved in closed form, and reading off the coefficient of the linear growth gives the integral at the top of this essay.
Euler’s constant at the far end of the integrand
The integral for hides a familiar constant. The inner integral grows like — for large the integrand is essentially — and the exact statement is
where is Euler’s constant, the same number by which the harmonic series outruns the logarithm, and is an exponentially small correction. So for large the integrand of is , and the tail of the integral from 60 to infinity, which a numerical integration would otherwise have to chase for ever, is to within a negligible error.
That is how the constant above was computed: Simpson’s rule on the inner integral, the trapezoid rule on the outer one up to 60, and Euler’s constant for the rest. Leaving out the tail gives 0.7423, wrong in the third decimal place, because ; including it gives 0.7475979, matching Rényi’s value to the seventh place. The appearance of is not an artefact of the method. Read the outer variable as time, with cars arriving at a steady rate along an endless kerb, and the integrand is the probability that a given spot is still available to receive a car at that time; the inner integral is the accumulated pressure of arrivals that could have blocked it, and it grows like a logarithm, which is where a logarithm’s companion constant enters. The same constant measures the gap between a harmonic sum and its logarithm in how long it takes to collect every coupon, another question about waiting for the last of many small targets.
Whole sites, and the number e
The discrete version of the problem is older than Rényi’s. Paul Flory asked it in 1939 about a long polymer chain whose neighbouring units react in pairs, irreversibly and at random: a row of sites, and pairs of adjacent empty sites filled one at a time, uniformly among the pairs still available. The same first-car argument works. If is the expected number of pairs placed, the first pair lands at one of positions and leaves two independent rows, so
and the recursion runs in exact rational arithmetic: four sites take pairs on average, six take , ten take . The share of sites covered, , tends to , with the number that names the area under the hyperbola. Dimers waste of the row — about one site in seven and a half — and the figure’s simulation of four hundred rows of a thousand sites gives 0.8645.
The is the same one that counts the permutations with no fixed point, and the resemblance is closer than a shared constant. Solving the recursion exactly, the expected number of empty sites on a row of is
which gives for four sites and for three, and agrees with the recursion’s fractions for every up to forty. Divided by it is a truncated series for , exactly as the share of derangements is a truncated series for . In both cases an inclusion–exclusion over the ways things can go wrong is what produces the alternating factorials.
Now let the cars cover whole sites instead of two. The general answer is a one-dimensional integral, , which the figure evaluates for from 1 to 50. One-site cars fill everything. As the cars grow, the row looks more and more like a continuous kerb measured in units of a car, and the share covered falls: 0.8237 for three sites, 0.7696 for ten, 0.7519 for fifty. The sum is a Riemann sum for Rényi’s inner integral, so the limit as is exactly , and the discrete answers approach it from above. A finer grid always helps: on a row of sites a car can only be misplaced by whole sites, and the continuous kerb is the worst case of all.
The gaps a full kerb leaves
The waste is the sum of the gaps, and the gaps have a shape. The figure collects every gap between neighbouring cars on three hundred long kerbs — nearly ninety thousand of them — and draws the density of their lengths. By definition every gap is shorter than one car length, since a longer one would have taken another car. Within that range the gaps are far from uniform: lengths near zero are about seven and a half times as common as lengths near one.
The reason is visible in the first figure. A gap between one and two car lengths, late in the process, is likely to receive a car, and the car lands uniformly inside it, leaving two pieces that together add up to less than one car length. So a gap near the top of the range is most often the survivor of a stretch that was just under one car length to begin with, while gaps near zero are produced every time a car lands close to a neighbour. Each late arrival manufactures two small gaps, and small gaps accumulate.
The mean gap is 0.3377, and this one number is not independent information. With a density of cars a unit of length there is, on average, one gap per car and of uncovered kerb per unit, so the mean gap is . The distribution has a closed form too, through the same transform that produced , but the shape in the figure is a simulation, and the exact curve is not drawn here.
The gaps are what a careful attendant would recover. Pushing every car to the left closes them all and frees of the kerb, a third of a car length for every car parked — room for one more car for every three already there.
How much one kerb differs from another
The integral equation gives the mean; real streets give single parkings, and those vary. The figure parks a kerb of length 100 twenty thousand times. The count was never below 67 or above 83, its mean was 74.50 against the exact 74.52, and its histogram is close to the normal curve with the same mean and variance. Ninety-six per cent of the parkings put between 71 and 78 cars on the street.
Two facts are behind the shape, and both come from the splitting. The count on a long kerb is the first car plus two independent counts on shorter kerbs, so it is a sum of many nearly independent contributions from different stretches of street — a sum whose fluctuations behave like a bell curve assembled out of coin flips. And the variance grows in proportion to the length, just as the mean does: the simulation gives 0.038 a unit of kerb. Aryeh Dvoretzky and Herbert Robbins proved in 1964 that the count, centred and divided by the square root of the length, tends to a normal distribution, so the figure’s agreement is not an accident of length 100.
The variance is small. A standard deviation of two cars on a street of seventy-five means that random parking is wasteful in a very predictable way: the city that counts on three quarters of the kerb is never far wrong, even though no two streets fill alike. That predictability is the useful half of the result. The waste, a quarter of the kerb, cannot be engineered away by any rule that lets drivers choose where to stop at random, and the variability, two cars in a hundred, is too small to matter to anybody planning a street.
The contrast with arcs that cover a circle is worth making precise. There, arcs land at random and may overlap, and the question is when they cover everything; fourteen arcs of a fifth of the circle, nearly three times its length, still leave a bare stretch a third of the time, because overlaps waste effort. Here the cars may not overlap at all, and the waste appears as gaps instead of overlaps. Covering and packing are the two ways randomness falls short of an arrangement, and both shortfalls are computed exactly by following the first object placed.
What the curves cannot establish
The simulations in these figures show that the exact answers describe what actually happens, and the exact answers come from an equation; neither is a proof that the equation is right. The proof is the splitting argument — that the two sides of the first car fill independently and each in the same way as a fresh kerb — and it depends on the rule being uniform over the free positions. Any rule that makes a driver’s choice depend on the whole street, such as preferring spaces near a shop, or aiming for the middle of a gap, breaks the independence and with it the equation.
The figures also cannot show that is irrational, or transcendental, or related to any other constant. Its digits have been computed to great length, and appears in its tail, but no closed form is known, and no one has shown that one does not exist. Simulation alone would have pinned it down to about three decimal places; the integral pins it to as many as anyone cares to compute, but only because the problem in one dimension happens to reduce to a single integral equation.
Finally, the gap density is drawn from simulation, and the claim that it has a closed form rests on the literature rather than on anything computed here. The picture shows that short gaps dominate; it does not show the formula that says by how much.
Still open: parking in a plane
Raise the dimension by one and almost everything stops being exact. Drop unit squares, aligned with the axes, at uniformly random free positions in a large square until none fits, and ask what share of the area is covered. Ilona Palásti conjectured in 1960 that the answer is , the one-dimensional constant squared, which would be true if the two directions filled independently. They do not. Simulations put the jamming density for aligned squares near 0.562, slightly above Palásti’s value, and the conjecture is now believed false for that reason — but no exact value is known, no integral equation has been found, and the first-car argument fails because one square does not split a plane into independent pieces. For discs dropped on a plane the simulated answer is about 0.547, and there is no proof of any of its digits.
Even in one dimension there are open variations. If cars have random lengths, the answer depends on the length distribution in ways only partly understood; if a car may leave after a while and its place be taken, the street never jams, and the long-run density depends on how fast cars come and go in a way that physicists measure and mathematicians mostly cannot prove. The exact solution for the plain kerb is a small island: the one random packing problem in which the first object placed breaks the problem into copies of itself.
The first car decides the method
Cars of length one parking uniformly at random on a long kerb cover a share of it, and on a kerb of length the expected number of cars is to within a hundred-thousandth from length six on. The method is one observation: the first car splits the kerb into two shorter kerbs that fill independently, which turns the question into the integral equation , solved here on a grid and checked against seeded simulations at every length from 1 to 30. Euler’s constant appears in the tail of Rényi’s integral, ; cut the kerb into sites and park two-site cars, and the waste is exactly ; longer cars on the same sites waste more, approaching the continuous kerb’s quarter from below. The count on a long kerb is normal with a small variance, so random parking is wasteful and predictable at once — and in two dimensions, where nothing splits, even the first digit of the analogous constant has never been proved.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- An average that never settles — both name expectation, independence, variance
- Counting a population by its repeats — both name expectation, simulation, variance
- Fair bits from an unfair coin — both name expectation, independence, recursion
- Regression is a square completed halfway — both name expectation, simulation, variance
- Sampling where the answer lives — both name expectation, independence, variance
- The average settles and the wobble does not — both name expectation, independence, variance
Named objects
A dashed tag is an object no other essay names yet.
e, the numberExpectationIndependenceRandom sequential adsorptionRecursionSimulationVariance