Probabilistic Parking Spaces

A row of street parking has spaces numbered 1 through 100, in that order. Each person trying to park drives by the spaces one-by-one starting at number 1.

At each open space, they are told how many open spaces, S , S, they haven't passed (including the current space). They park in that space with probability 1 S ; \frac{1}{S}; otherwise, they move on to the next open space.

What is the expected value for the parking spot of the 10 0 th 100^\text{th} person to arrive (assuming no one has left and only one car goes through the parking process at a time)?


The answer is 50.5.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Ivan Koswara
Nov 1, 2016

We claim that every possible way of parking will occur with the same probability.

The trick is that the convoluted way of parking as presented in the problem is actually simply "pick any available space with equal probability".

To get an intuition about this, consider the first car. It has 1 100 \frac{1}{100} chance of parking on space 1. Otherwise, in the remaining 99 100 \frac{99}{100} chance, it will skip space 1. Now, among the rest, there's 1 99 \frac{1}{99} chance of parking on space 2. But note that in order to park on space 2, it must also skip space 1, so in total, the probability of actually parking on space 2 (from the state of before skipping any space) is 99 100 1 99 = 1 100 \frac{99}{100} \cdot \frac{1}{99} = \frac{1}{100} .

We can generalize this. Suppose the n n -th car arrives. Since we don't care about occupied spaces, rename the open spaces as 1 , 2 , 3 , , 101 n 1, 2, 3, \ldots, 101-n (there are 101 n 101-n open spaces remaining). Choose any open space, suppose it's the k k -th. The probability that it will park on space k k , when the car is before space 1, is the product of

  • The probability that it skips space 1, when the car is just before space 1,
  • The probability that it skips space 2, when the car is just before space 2,
  • ...
  • The probability that it skips space k 1 k-1 , when the car is just before space k 1 k-1 ,
  • The probability that it parks on space k k , when the car is just before space k k .

These probabilities are, in order,

  • 100 n 101 n \frac{100-n}{101-n}
  • 99 n 100 n \frac{99-n}{100-n}
  • ...
  • 101 n k 102 n k \frac{101-n-k}{102-n-k}
  • 1 101 n k \frac{1}{101-n-k}

Multiplying them all cancels a lot of the terms and leaves only 1 101 n \frac{1}{101-n} . Note that it is independent from k k ; it gives the same probability to every space.

Now, any way of parking the cars is a permutation, where the i i -the element of the permutation is the number of the space of the i i -th car. Given a specific permutation π \pi , there is exactly one way to generate it: the first car must go to space π ( 1 ) \pi(1) , the second car must go to space π ( 2 ) \pi(2) , and so on. This means the probability of generating permutation π \pi is simply 1 100 1 99 1 98 1 1 = 1 100 ! \frac{1}{100} \cdot \frac{1}{99} \cdot \frac{1}{98} \cdot \ldots \cdot \frac{1}{1} = \frac{1}{100!} . Every permutation has the same probability of being generated, so every possible way of parking occurs with the same probability.

Now, consider the last car. No matter what happens to the rest of the cars, the last car parks on any specific space k k with exactly 1 100 \frac{1}{100} probability: given that the last car parks on space k k , there are 99 ! 99! permutations of the other cars, so the probability of the last car parking on space k k is 99 ! 100 ! = 1 100 \frac{99!}{100!} = \frac{1}{100} . Thus, the expected number of the space is

1 100 1 + 1 100 2 + 1 100 3 + + 1 100 100 = 1 100 ( 1 + 2 + 3 + + 100 ) = 1 100 100 101 2 = 101 2 = 50.5 \begin{aligned} \frac{1}{100} \cdot 1 + \frac{1}{100} \cdot 2 + \frac{1}{100} \cdot 3 + \ldots + \frac{1}{100} \cdot 100 &= \frac{1}{100} \cdot (1 + 2 + 3 + \ldots + 100) \\ &= \frac{1}{100} \cdot \frac{100 \cdot 101}{2} \\ &= \frac{101}{2} \\ &= \boxed{50.5} \end{aligned}

Very nicely done!

The trick is that the convoluted way of parking as presented in the problem is actually simply "pick any available space with equal probability".

Great observation!

Calvin Lin Staff - 4 years, 7 months ago

Solved the problem in the same way. The problem could've been much difficult if the parking probabilities depended on the ordering of the open parking spots.

Samrat Mukhopadhyay - 4 years, 5 months ago
Zhizhong Lin
May 26, 2020

Let I i I_{i} denote whether the 10 0 t h 100^{th} car stay at the i t h i^{th} spot. Then we want to calculate E [ i = 1 100 i I i ] E[\sum_{i=1}^{100}iI_{i}] . Since E I i = 99 100 × 98 99 × × i i + 1 × 1 i = 1 100 EI_{i} = \frac{99}{100}\times \frac{98}{99}\times \cdots \times \frac{i}{i+1}\times \frac{1}{i} = \frac{1}{100} , E [ i = 1 100 i I i ] = i = 1 100 i E [ I i ] = ( 1 + 100 ) × 100 × 1 2 100 = 101 2 = 50.5 E[\sum_{i=1}^{100}iI_{i}] = \sum_{i=1}^{100}iE[I_{i}] = \frac{(1+100)\times 100\times \frac{1}{2}}{100} = \frac{101}{2} = 50.5

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...