Expectation of waiting time ratios

68 Views Asked by At

Question:

At a restaurant's bathroom, men and women arrive at the same rate, on average 20 minutes. Assume the number of people who waiting in the queue is Poisson distributed. Men spend on average 60 seconds, whilst women spend on average 10 minutes. In the long run, what is the ratio of the queuing time at the women's bathroom to the queuing time at the men's bathroom?

Motivation:

We got this problem last week, and according to the questioner, my answer is not good, and I don't know where I go wrong. I don't even know if my approach is correct... So what is incorrect in the following?

My suggested solution:

Here is my solution... The following processes can model the number of people in the “system”, i.e. the number of those people who wait for the bathroom and the person using the bathroom:

$$X_{T}^{Men}=N_{In}^{Men}\left(T\right)-\chi_{X_{T}^{Men}>0}\cdot N_{Out}^{Men}\left(T\right)=N_{In}^{Men}\left(T\right)-\chi_{X_{T}^{Men} \neq 0}\cdot N_{Out}^{Men}\left(T\right),$$

$$X_{T}^{Women}=N_{In}^{Women}\left(T\right)-\chi_{X_{T}^{Women}>0}\cdot N_{Out}^{Women}\left(T\right)=N_{In}^{Women}\left(T\right)-\chi_{X_{T}^{Women} \neq 0}\cdot N_{Out}^{Women}\left(T\right)$$

where $N_{In}^{Men}\left(t\right),N_{Out}^{Men}\left(t\right), N_{In}^{Women}\left(t\right)$ and $N_{Out}^{Women}\left(t\right)$ are independent Poisson processes with $\lambda^{Men}=\lambda^{Women}=\frac{1}{20}$, $\mu^{Men}=\frac{1}{1}$ and $\mu^{Women}=\frac{1}{10}$ intensitiy parameters respectively. $\chi$ is an indicator. I assume the bathroom is only for one person.

These processes are simple birth-death processes, with $1$ server (i.e.: there is only one bathroom) and $K=\infty$ places (i.e. if there is someone in the bathroom, then there is no upper capacity limit for the length of the queue). It is well-known, that in a birth-death process the waiting time to get from $x_{i}$ state to $x_{i+1}$ state is exponentially distributed and the $X$ process goes there with $\lambda=\frac{1}{20}$ intensity. From $x_{i}$ state to $x_{i-1}$ state the $X$ process goes with $\mu^{Men}=\frac{1}{1}$ parameter in case of men, and $\mu^{Women}=\frac{1}{10}$ in case of women.

Using the notation of $p_{0j}\left(t\right)=p_{j}\left(t\right)=\mathbf{P}\left(X_{t}=j\right)$, the Kolmogorov equation suggests the following general differential equations

$$ \frac{dp_{0}\left(t\right)}{dt}=\mu_{1}p_{1}-\lambda_{0}p_{0}\left(t\right)$$ $$\frac{dp_{k}\left(t\right)}{dt}=\lambda_{k-1}p_{k-1}\left(t\right)-\left(\lambda_{k}+\mu_{k}\right)p_{k}\left(t\right)+\mu_{k+1}p_{k+1}\left(t\right)$$ $$p_{0}\left(0\right)=1, p_{k}\left(0\right)=0, k=1,2,\ldots $$

Since it is assumed that every $\mu_{k}=\mu$ and $\lambda_{k}=\lambda$ are the same constants, then the equation above gets a slightly simpler form:

$$ \frac{dp_{0}\left(t\right)}{dt}=\mu p_{1}-\lambda p_{0}\left(t\right)$$ $$\frac{dp_{k}\left(t\right)}{dt}=\lambda p_{k-1}\left(t\right)-\left(\lambda+\mu\right)p_{k}\left(t\right)+\mu p_{k+1}\left(t\right)$$ $$p_{0}\left(0\right)=1,p_{k}\left(0\right)=0,k=1,2,\ldots $$

However, we now interested in the “long-run state probabilities”, i.e. the stationary/steady state probabilities: $q_{j}\mathring{=}\lim_{t\rightarrow\infty}p_{j}\left(t\right)$. Turning the above equations to these probabilities

$$ \lambda_{0}q_{0}=\mu_{1}q_{1}$$ $$\lambda_{k-1}q_{k-1}+\mu_{k+1}q_{k+1}=\left(\lambda_{k}+\mu_{k}\right)q_{k} $$

We can calculate $q_{2}$ from this equation...

$$ q_{1}=\frac{\lambda_{0}}{\mu_{1}}q_{0}$$ $$q_{2}=\frac{\left(\lambda_{1}+\mu_{1}\right)q_{1}-\lambda_{0}q_{0}}{\mu_{2}}=\frac{\lambda_{1}q_{1}+\overbrace{\mu_{1}q_{1}}^{\lambda_{0}q_{0}}-\lambda_{0}q_{0}}{\mu_{2}}=\frac{\lambda_{1}}{\mu_{2}}q_{1}=\frac{\lambda_{1}\lambda_{0}}{\mu_{2}\mu_{1}}q_{0} $$

With induction we can prove $q_{k}=\frac{\lambda_{k-1}\cdot\lambda_{k-2}\cdot\ldots\cdot\lambda_{1}\cdot\lambda_{0}}{\mu_{k}\cdot\mu_{k-1}\cdot\ldots\cdot\mu_{2}\cdot\mu_{1}}$, but in our case it gets a much simpler form, because every $\lambda_{k}$ and $\mu_{k}$ are $\lambda$ and $\mu$ constants respectively:

$$q_{k}\mathring{=}\lim_{t\rightarrow\infty}\mathbf{P}\left(X_{t}=k\right)=\left(\frac{\lambda}{\mu}\right)^{k}.$$

So finally, the question is

$$\lim_{T\rightarrow\infty}\mathbb{E}\left(\frac{\text{Waiting time for women}}{\text{Waiting time for men}}\right)=\lim_{T\rightarrow\infty}\mathbb{E}\left(\frac{\sum_{i=1}^{X_{T}^{Women}}\xi_{i}^{Women}}{\sum_{i=1}^{X_{T}^{Men}}\xi_{i}^{Men}}\right)?$$

Here $\xi_{i}^{Women}$ and $\xi_{i}^{Men}$ are the exponentially distributed variables, since the serving time (time of using the bathroom) is exponentially distributed with $\mu$ parameter. The $X_{T}$th person in the queue has to wait until all the people are served who came before the $X_{T}$th person, so he/she has to wait $\sum_{i=1}^{X_{T}}\xi_{i}$, where $X_{T}$ is the number of people standing in the rows. I will consider those times as waiting times, when somebody is actually in the bathroom. (So if there is only one person in the system, than he waits $0$ time to get in the bathroom, but I will consider that time as waiting time while he/she stays in the bathroom.) (Perhaps this is the reason why my answer failes...however if I calculate the series below counting only to $X_{\infty}-1$ instead of $X_{\infty}$, then I get a result where they converge to zero...)

Thanks to the independence of the numerator and denominator, and taking in the $\lim_{T\rightarrow\infty}$ behind $\mathbb{E}$ thanks to the dominated convergence theorem, using the total law of expectation and assuming $\xi_{0}=0$ (if nobody is in the system, then nobody is waiting), we get:

$$\lim_{T\rightarrow\infty}\mathbb{E}\left(\frac{\text{Waiting time for women}}{\text{Waiting time for men}}\right)=\frac{\mathbb{E}\left(\lim_{T\rightarrow\infty}\sum_{i=1}^{X_{T}^{Women}}\xi_{i}^{Women}\right)}{\mathbb{E}\left(\lim_{T\rightarrow\infty}\sum_{i=1}^{X_{T}^{Men}}\xi_{i}^{Men}\right)}=$$ $$=\frac{\mathbb{E}\left(\sum_{i=1}^{X_{\infty}^{Women}}\xi_{i}^{Women}\right)}{\mathbb{E}\left(\sum_{i=1}^{X_{\infty}^{Men}}\xi_{i}^{Men}\right)}= \frac{\sum_{M=0}^{\infty}\mathbb{E}\left(\sum_{i=1}^{M}\xi_{i}^{Women}\mid X_{\infty}^{Women}=M\right)\mathbf{P}\left(X_{\infty}^{Women}=M\right)}{\sum_{N=0}^{\infty}\mathbb{E}\left(\sum_{i=1}^{N}\xi_{i}^{Men}\mid X_{\infty}^{Men}=N\right)\mathbf{P}\left(X_{\infty}^{Men}=N\right)}=\ldots $$

Knowing the conditioned part is Gamma distributed

$$\left(\sum_{i=1}^{M}\xi_{i}\mid X_{\infty}=M\right)\sim\Gamma\left(M,\mu\right),$$

since it is the sum of $M$ independent exponential distributed variables with a common $\mu$ parameter, we can continue the calculation above as

$$\ldots=\frac{\sum_{M=0}^{\infty}\left(\int_{0}^{\infty}x\frac{\left(\frac{1}{10}\right)^{M}}{\Gamma\left(M\right)}x^{M-1}e^{-\frac{1}{10}x}dx\cdot\left(\frac{\frac{1}{20}}{\frac{1}{10}}\right)^{M}\right)}{\sum_{N=0}^{\infty}\left(\int_{0}^{\infty}x\frac{\left(\frac{1}{1}\right)^{N}}{\Gamma\left(N\right)}x^{N-1}e^{-\frac{1}{1}x}dx\cdot\left(\frac{\frac{1}{20}}{\frac{1}{1}}\right)^{N}\right)}=\ldots$$

The numerator of equation above is $$\sum_{M=0}^{\infty}\left(\int_{0}^{\infty}x\frac{\left(\frac{1}{10}\right)^{M}}{\Gamma\left(M\right)}x^{M-1}e^{-\frac{1}{10}x}dx\cdot\left(\frac{\frac{1}{20}}{\frac{1}{10}}\right)^{M}\right) =\sum_{M=0}^{\infty}\left(\frac{\left(\frac{1}{10}\right)^{M}}{\Gamma\left(M\right)}\left(\frac{\frac{1}{20}}{\frac{1}{10}}\right)^{M}\int_{0}^{\infty}x^{M}e^{-\frac{1}{10}x}dx\right) =\sum_{M=0}^{\infty}\left(\frac{1}{\Gamma\left(M\right)}\left(\frac{1}{20}\right)^{M}\frac{\Gamma\left(M+1\right)}{\left(\frac{1}{10}\right)^{M+1}}\right) =10\cdot\sum_{M=0}^{\infty}M\left(\frac{1}{2}\right)^{M}=10\cdot2=20.$$

Similarly the denominator $$\sum_{N=0}^{\infty}\left(\int_{0}^{\infty}x\frac{\left(\frac{1}{1}\right)^{N}}{\Gamma\left(N\right)}x^{N-1}e^{-\frac{1}{1}x}dx\cdot\left(\frac{\frac{1}{20}}{\frac{1}{1}}\right)^{N}\right) =\sum_{N=0}^{\infty}\left(\frac{1}{\Gamma\left(N\right)}\left(\frac{1}{20}\right)^{N}\int_{0}^{\infty}x^{N}e^{-x}dx\right) =\sum_{N=0}^{\infty}\left(\frac{1}{\Gamma\left(N\right)}\left(\frac{1}{20}\right)^{N}\Gamma\left(N+1\right)\right) =\sum_{N=0}^{\infty}N\left(\frac{1}{20}\right)^{N}=\frac{20}{361}.$$

So the asked ratio is $$\ldots=\frac{20}{\frac{20}{361}}=361.$$

1

There are 1 best solutions below

0
On

Ok, I found myself what the problem was...

When I defined $q_{k}$, I missed a $q_{0}$ factor, so $$q_{k}=\left(\frac{\lambda}{\mu}\right)^{k}q_{0},$$ where $\sum_{k=0}^{\infty}q_{k}=q_{0}\sum_{k=0}^{\infty}\left(\frac{\lambda}{\mu}\right)^{k}=1$, so $q_{0}=\frac{1}{\sum_{k=0}^{\infty}\left(\frac{\lambda}{\mu}\right)^{k}}$. In our case, for women $q_{0}=\frac{1}{\sum_{k=0}^{\infty}\left(\frac{\frac{1}{20}}{\frac{1}{10}}\right)^{k}}=\frac{1}{2}$ and for men $q_{0}=\frac{1}{\sum_{k=0}^{\infty}\left(\frac{\frac{1}{20}}{\frac{1}{1}}\right)^{k}}=\frac{19}{20}.$ Multiplying the numerator with $\frac{1}{2}$, and multiplying the denominator with $\frac{19}{20}$, we got the proper ratio, which is $190$.