Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

A parking lot consists of an infinite row of bays. Cars arrive at random intervals (mean interval $T_a$) and stay for a random time (mean stay $T_s$). The time intervals are memoryless (negative exponential distribution). An arriving car parks in bay $n$, which is the first available bay. What is the distribution of $n$?

The question is motivated by the following annoyance: why is it that, when I meet someone at the airport, I always end up driving to the far end of the lot?

Here is a bit more information, based on simulation. The ratio of the times, rather than their actual values, determines the behaviour. Thus we can write $k=T_s/T_a$ and use $k$ as the single parameter. If $k=1$, the parking lot can be small (two bays are usually enough), and the distribution is interesting only for large values of $k$. E.g., cars arrive every 2 minutes and stay for 2 hours.

The first bay is the one most likely to be free (!). However, for large $k$, the distribution is almost flat, falling off rapidly after $k$ bays and therefore having a mean of $k/2/$. In fact, I conjecture that $\mu \rightarrow k/2$ as , as $k \rightarrow \infty$.

Thanks, Peter

share|improve this question

1 Answer 1

Let us assume that the cars are arriving with rate $\lambda$ and each car leaves with rate $\mu$. Let $\rho=\lambda / \mu$.

Now let us look at just the first parking space. Let the probability that it is empty be $P_{1,0}$ and the probability that it is filled be $P_{1,1}$. We do not care what happens to any of the cars that end up in any other parking space. So we know that the rate of cars leaving the first space is the same as the rate leaving, we get that $P_{1,0}\lambda=P_{1,1}\mu$ and since those are the only two states we know that $P_{1,0}+P_{1,1}=1$. We can solve this and get that the probability that the first space is open: $$P_{1,0}=\frac{\mu}{\lambda+\mu}=\frac{1}{1+\rho}.$$

Now let us look at the first two spaces, but just worry about how many cars are parked. There are three states corresponding to 0, 1, or 2 cars parked. We move from 0 cars to 1 car, or 1 car to 2 cars at rate $\lambda$, and from 1 car to 0 cars at rate $\mu$ and from 2 cars to one car at rate $2\mu$. Denoting the probabilities of the three states by $P_{2,0}$, $P_{2,1}$, and $P_{2,2}$, and solving as above, we get that $$P_{2,2}=\frac{\rho^2}{1+\rho+\frac{1}{2}\rho^2}$$ as the probability that the first two spots are filled. Now the probability that the second spot is the fist available is just the probability that the first spot is filled minus the probability that the first two spots are filled, or $$\text{P[second space is first avail]}=\frac{\rho}{1+\rho}-\frac{\rho^2}{1+\rho+\frac{1}{2}\rho^2}.$$

In general we find that the probability that the first $k$ spots are open is $$P_{k,k}=\frac{\rho^k}{\sum_{i=0}^k \frac{1}{i!}\rho^i}.$$ The probability that the $k$'th spot is the first open is just $P_{k-1,k-1}-P_{k,k}$

$$\text{P[$n$'th space is first avail]}=\frac{\rho^{k-1}}{\sum_{i=0}^{k-1} \frac{1}{i!}\rho^i}-\frac{\rho^k}{\sum_{i=0}^k \frac{1}{i!}\rho^i}.$$

Unfortunately, I do not see how to get the mean of this distribution.

Note that the first spot is not the most likely to be free (in fact it is the least likely to be free) but it is the most likely to be the first available parking space.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.