Poisson process and uniform random variable

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.


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. $$


This is my answer in collaboration with my brother (75% by me and 25% by him... Okay fine, you must not believe me, this 50%-50% work! Although, he only guide me a bit and let me borrow his stat textbook). Here we go! \(^◡^)/

Let $X_i$ be a random variable that denotes the amount of petrol that is filled to the $i$-th car, $N$ be a random variable that denotes number of cars that the petrol station can fully service, and $V$ be a random variable that denotes the total volume of petrol that is used to fill the cars.


Assumptions:

  1. Conditional on $N=n$, the random variables $X_1,\cdots,X_n$ are i.i.d. random variables.
  2. Conditional on $N=n$, the common distribution of the random variables $X_1,\cdots,X_n$ does not depend on $n$.
  3. The distribution of $N$ does not depend in any way on the values of $X_1,\cdots,X_n$.

Then, we have a model \begin{align} V=X_1+X_2+\cdots+X_N,\qquad\qquad N=0,1,2,\cdots, \end{align} where $V=0$ when $N=0$. From Bayes' we have \begin{align} \text{E}[Y]=\text{E}[\text{E}(Y|X)], \end{align} then the moment generating function (MGF) of $V$ is \begin{align} \text{M}_V[t]&=\text{E}\left[e^{\Large tV}\right]\\ &=\text{E}\left[e^{\Large t(X_1+X_2+\cdots+X_N)}\right]\\ &=\text{E}\left[\text{E}\left(e^{\Large t(X_1+X_2+\cdots+X_n)}|N=n\right)\right]\\ &=\sum_{n=0}^\infty\text{E}\left(e^{\Large t(X_1+X_2+\cdots+X_n)}|N=n\right)\Pr(N=n) \end{align} The expectation value of $V$ can be calculated as follows \begin{align} \text{E}[V]&=\left.\frac{d}{dt}\text{M}_V[t]\right|_{t=0}\\ &=\left.\frac{d}{dt}\sum_{n=0}^\infty\text{E}\left(e^{\Large t(X_1+X_2+\cdots+X_n)}|N=n\right)\Pr(N=n)\right|_{t=0}\\ &=\sum_{n=0}^\infty\text{E}(X_1+X_2+\cdots+X_n|N=n)\Pr(N=n)\\ &=\sum_{n=0}^\infty\text{E}(nX_i)\Pr(N=n)\\ &=\text{E}(X_i)\sum_{n=0}^\infty n\Pr(N=n)\\ &=\text{E}(X_i)\text{E}(N)\\ \end{align} We expect that the total volume of petrol that will be used to fill the cars is $100$ liters and $X_i$ is uniformly distributed over $(0,50)$. Hence \begin{align} \text{E}[V]&=\text{E}(X_i)\text{E}(N)\\ 100&=\frac{1}{2}(0+50)\text{E}(N)\\ 100&=25\text{E}(N)\\ \text{E}(N)&=4 \end{align} Therefore, the number of cars that will be fully served is $4$ cars and if $T$ is a random variable that denotes the time taken before the station runs out of petrol, then \begin{align} \text{E}(T)&=\frac{\text{E}(N)}{\lambda}=\frac{4}{\lambda} \end{align} To be honest, I'm not quite sure about my answer since the result is too good to be true. ✌(^ₒ^)✌

P.S. You may vote down my answer, but please make sure you also make an answer to this question. Thank you. ≧◠◡◠≦✌