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 , they haven't passed (including the current space). They park in that space with probability S 1 ; otherwise, they move on to the next open space.
What is the expected value for the parking spot of the 1 0 0 th person to arrive (assuming no one has left and only one car goes through the parking process at a time)?
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.
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!
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.
Let I i denote whether the 1 0 0 t h car stay at the i t h spot. Then we want to calculate E [ ∑ i = 1 1 0 0 i I i ] . Since E I i = 1 0 0 9 9 × 9 9 9 8 × ⋯ × i + 1 i × i 1 = 1 0 0 1 , E [ ∑ i = 1 1 0 0 i I i ] = ∑ i = 1 1 0 0 i E [ I i ] = 1 0 0 ( 1 + 1 0 0 ) × 1 0 0 × 2 1 = 2 1 0 1 = 5 0 . 5
Problem Loading...
Note Loading...
Set Loading...
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 0 0 1 chance of parking on space 1. Otherwise, in the remaining 1 0 0 9 9 chance, it will skip space 1. Now, among the rest, there's 9 9 1 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 1 0 0 9 9 ⋅ 9 9 1 = 1 0 0 1 .
We can generalize this. Suppose the n -th car arrives. Since we don't care about occupied spaces, rename the open spaces as 1 , 2 , 3 , … , 1 0 1 − n (there are 1 0 1 − n open spaces remaining). Choose any open space, suppose it's the k -th. The probability that it will park on space k , when the car is before space 1, is the product of
These probabilities are, in order,
Multiplying them all cancels a lot of the terms and leaves only 1 0 1 − n 1 . Note that it is independent from k ; it gives the same probability to every space.
Now, any way of parking the cars is a permutation, where the i -the element of the permutation is the number of the space of the i -th car. Given a specific permutation π , there is exactly one way to generate it: the first car must go to space π ( 1 ) , the second car must go to space π ( 2 ) , and so on. This means the probability of generating permutation π is simply 1 0 0 1 ⋅ 9 9 1 ⋅ 9 8 1 ⋅ … ⋅ 1 1 = 1 0 0 ! 1 . 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 with exactly 1 0 0 1 probability: given that the last car parks on space k , there are 9 9 ! permutations of the other cars, so the probability of the last car parking on space k is 1 0 0 ! 9 9 ! = 1 0 0 1 . Thus, the expected number of the space is
1 0 0 1 ⋅ 1 + 1 0 0 1 ⋅ 2 + 1 0 0 1 ⋅ 3 + … + 1 0 0 1 ⋅ 1 0 0 = 1 0 0 1 ⋅ ( 1 + 2 + 3 + … + 1 0 0 ) = 1 0 0 1 ⋅ 2 1 0 0 ⋅ 1 0 1 = 2 1 0 1 = 5 0 . 5