[Math] Poisson process and uniform random variable

probabilitystochastic-processes

Question:

A single-pump petrol station is running low on petrol. The total
volume of petrol remaining for sale is $100$ litres.

Suppose cars arrive to the station according to a Poisson process with
rate $\lambda$, and that each car fills independently of all other
cars and of the arrival process, an amount of petrol that is
distributed as a uniform random variable over $(0, 50)$ – assume for
example that all car tanks have a capacity of $50$ litres and drivers
decide "at random" when to refill.

We assume that service is instantaneous so that there are no queues at
the station.

(a) On average, how many cars will the petrol station fully service
(sell the full amount requested) before it runs out of petrol (and
before any refilling occurs)?

(b) How much time will it take on average before the station runs out
of petrol (and before any refilling occurs)?

Attempt:

I'm not exactly sure where to start with this question part (a). Let $U$ be uniformly distributed over $(0,50)$, then each time a car arrives at the petrol station, the total volume of petrol decreases by $U$. So define $U_1$ to be the amount of petrol that the first arrival (an "arrival" here being when a car arrives at the petrol station and refills) and $U_2$ be that of the second arrival, and so on. Then each $U_i$ is identically and independently distributed as $U$. So by the $N$-th arrival, the station will have $100-\sum_{i=1}^N U_i$ litres of petrol remaining. We stop once $100-\sum_{i=1}^N U_i=0$ and we basically need to find $E[N]$?


That's all I've got so far, if someone can provide a solution for (a) (for now), that would be good.

EDIT: PROGRESS

I don't think I need to use the assumption that cars arrive according to a Poisson process in this part. So, define $U_k$ as the random variable that denotes the amount of petrol that car $k$ fills, $k = 1, 2, 3, \cdots$. Thus, $U_k, k = 1, 2, 3, \cdots$ are independently and identically distributed as a uniform random variable over $(0,50)$.

Let $N$ be the random variable that denotes the number of cars that the petrol station can fully service.

Now I don't quite get the question. Say we have the following scenario:

Car 1 comes with 10L remaining in its tank, so it will fill up 40L, hence the amount of petrol left in the station is now 100-40 = 60L.

Car 2 comes with 10L remaining in its tank, so it will fill up 40L, hence the amount of petrol left in the station is now 60-40 = 20L.

Car 3 comes with 20L remaining in its tank, so it will fill up 30L, but the petrol station only has 20L left, so does this mean Car 3 just leaves the petrol station filling 0L? My gut feeling is that this cannot happen because each car can only fill an amount BETWEEN 0 and 50, ie, (0,50) [note that the end points are not included].

Hence in this scenario, the petrol station runs "out" of petrol at N=3 because it does not have enough to FULLY service Car 3, even though it still has 20L left in the pump. Thus, the petrol station can only service N=2 cars.

Is this interpretation correct? If so, how do I find $E[N]$?

EDIT 2: working on further…

Define $G_N = \sum_{k=1}^N U_k$, then $E[N] = \sum_{n=1}^{\infty} n P(N=n) = \sum_{n=1}^{\infty} n P(G_n \le 100)$

This equivalence comes from the fact that the event $\{N=n\}$ will only happen if $100 – G_n \ge 0$.

However, two questions remain, what is the distribution of $G_n$? (How do I derive the distribution of the sum of $n$ iid uniform random variables and second, how do I compute the infinite sum?


Furthermore, I should mention that this question can be done without the need of any computer software package or programming. It has a closed form solution with an exact answer, I am feeling that my current approach definitely won't work by hand.

Best Answer

Let $N$ denote the number of cars that will be fully served, in other words, if $N=n$, then car $n+1$ is the first one ordering more petrol than the amount left at the station.

Changing slightly the notations and using the homogeneity of the problem, $$ [N\geqslant n]=[\text{car}\ n\ \text{is fully served}]=[U_1+\cdots+U_n\leqslant2], $$ where the random variables $U_n$ are i.i.d. and uniform on $(0,1)$. The mean time elapsed between two cars are served is $1/\lambda$ hence the mean time $\mathtt t$ before some petrol order cannot be satisfied is $$ \mathtt t=\frac{E(N)+1}\lambda. $$ Now, let $N_x$ denote the number of cars that will be fully served if the initial volume of petrol at the station is $x\cdot50$ liters. Then $N=N_2$ and, for every $x\geqslant0$, conditioning on the amount of petrol the first car is served and using the identity $P(U_1\leqslant x)=\min\{x,1\}$, one gets $$ E(N_x)=\min\{x,1\}+\int_0^{\min\{x,1\}}E(N_{x-u})\,\mathrm du. $$ Thus, if $x\geqslant1$ then $$ E(N_x)=1+\int_0^1E(N_{x-u})\,\mathrm du=1+\int_{x-1}^xE(N_u)\,\mathrm du, $$ while if $x\leqslant1$ then $$ E(N_x)=x+\int_0^xE(N_{x-u})\,\mathrm du=x+\int_0^xE(N_u)\,\mathrm du. $$ Let $n(x)=E(N_x)$. If $x\leqslant1$, then $$ n'(x)=1+n(x), $$ and $n(0)=0$ hence, for every $x$ in $(0,1)$, $$ n(x)=\mathrm e^{x}-1. $$ If $1\leqslant x\leqslant2$, then $$ n'(x)=n(x)-n(x-1)=n(x)-(\mathrm e^{x-1}-1). $$ Integrating this and using the initial condition $n(1)=\mathrm e-1$ yields, for every $x$ in $(1,2)$, $$ n(x)=\mathrm e^x-1-\mathrm e^{x-1}(x-1), $$ in particular, $$ E(N)=n(2)=\mathrm e^2-1-\mathrm e, $$ which yields $$ \mathtt t=\frac{\mathrm e^2-\mathrm e}\lambda\approx\frac{4.67}\lambda. $$

Related Question