# Tricky Poisson Formula Rearrangement

#### PeterRose

##### New Member
Hello,

I am currently doing some bus stop designs. I have not done statistics for a while but remember once doing poisson distributions at Uni.

The problem I have, I think, requires a specific arrangement of the poisson formula for cumulative distribution.

If I have x number of buses arrive per hour and they each stay on average y seconds how many bus stops would I require so that the number of buses at the stops exceeds the number of stops z%?
e.g. buses per hour = 30
buses wait time = 60 seconds
poisson random distribution for arrival times
probability of exceeding number of bus spaces = 5%
bus spaces = ?

I would appreciate any guidance to solving this problem. I have researched formulas but can't seem to find one that allows me to perform this calculation.

Many Thanks!

#### BGM

##### TS Contributor
Let $$X_i$$ be the arrival time of the $$i$$-th bus

and $$Y_i$$ be the amount of time that the $$i$$-th bus stay in the bus stop.

Then the number of buses stay in the bus stop at time $$t$$

$$M(t) \triangleq \sum_{i=1}^{N(t)} \mathbf{1}\{t < X_i + Y_i\}$$

where $$N(t)$$ is the number of buses arrived before time $$t$$

The key trick here is to observe that $$M(t)$$ is a symmetric functional of the arrival time, as we assume $$Y_i$$ are i.i.d.

Therefore, since the arrival time conditional on the number of arrivals is distributed like the ordered-uniform on $$(0, t]$$ , by the symmetric property they are distributed like the independent uniform on $$(0, t]$$

Therefore, $$M(t) \stackrel {d} {=} \sum_{i=1}^{N(t)} \mathbf{1}\{t < U_i + Y_i\}$$
where $$U_i$$ are i.i.d. uniform on $$(0, t]$$ and independent of $$N(t)$$

The exact distribution of $$M$$ maybe is difficult to obtain, but at least you may evaluate the desired probabilities numerically. If you want the expectations then it is already in a closed form solution.

#### PeterRose

##### New Member
Ok. Well this is interesting but pretty much over my head. I have my old stats book out to try and find the solution I am after but it doesn't seem to work. I am attempting trial and error solutions at the moment.
If the mean rate of buses using the bus stop is 30/60 per minute, and the mean stopping time is say 30 seconds and there are 2 bus spaces available how would I calculate how often the number of bus spaces is exceeded?
I think I need to use this formula: P(X < x) = ((vt)^x)/x!*exp(-vt) where x = 0, 1 2,...

#### BGM

##### TS Contributor
Yes of course you need to use the pmf of Poisson, because $$N(t)$$ is a Poisson process.

So using law of total probability, conditioning on $$N(t) = n$$, we obtain

$$\Pr\{M(t) = m\} = \sum_{n=0}^{+\infty} \Pr\{M(t) = m|N(t) = n\}\Pr\{N(t) = n \}$$

The latter part is the Poisson pmf, while the first part is the Binomial pmf, because

$$M(t)|N(t) = n \sim \text{Binomial}(n, p)$$
where $$p = \Pr\{U + Y > t\}$$

All things are ready, I think you need to specify the distribution of the staying time of
each bus as well. Otherwise at most you can give a bound for the approximation.

#### PeterRose

##### New Member
Ok so let's say the coefficient of variation for bus dwell time is 0.6 (is this too low)?

#### BGM

##### TS Contributor
I have check my text again. If you are just want to ask for the long-run distribution,

then $$M(t)$$ has a Poisson distribution with mean $$\lambda \mu$$,

where $$\lambda$$ is the mean arrival rate and $$\mu$$ is the mean staying time.

I have to correct 1 point for my previous post:

Actually you can show the unconditional distribution of $$M(t)$$ is Poisson by evaluating the above sum.

So if you can determine the $$p$$, then you know the whole distribution of $$M(t)$$

$$M(t) \sim \text{Poisson}(\lambda p t)$$

and thus you can evaluate the corresponding stops needed.