Task about post office

59 Views Asked by At

There is a small town with strange post office. People use it to send letters, alright...

In this town there are $N$ people. Let's think that everybody have a letter to send according to exponential distribution. I mean that $P(T_{s} + T_{new\ letter} < t ) = 1 - e^{-t/\mu}$, where $T_s$ - time of sending the last letter and $T_{new\ letter}$ -- time to prepare a new letter.

After preparing people can go to this post office and try to send letters. But they are too lazy and if they have letter there is some probability of going to the post office $\tau$. With $\tau$ person will go to send and with $1-\tau$ will not.

Post office opens everyday at 10 hours. And $k$ not lazy persons are waiting for opening. And due to some problems everybody have probability $p$ to fail all process of sending letter. With $1-p$ everything is successful and with $p$ person goes home and next day he will be ready for the next try with $\tau$ and with $1-\tau$ will not. In case of success person goes home and rest the whole day, and next day tries to write a new letter.

Let the length of one day be $1$.

And the question is to find average delay time. From moment when person ends writing letter to the moment when person does not fail sending in post office.

My solution.

I diveded this time into two parts. idle - when person is writing, and when letter is done.

so, I try to find expected time to the end of the day when person ends letter.

I get

$$ T_{before}= \left[ (1-\mu) e^{1/\mu} +\mu \right] \frac{1}{e^{1/\mu}-1} = \frac{1}{1-e^{-1/\mu}} - \mu $$

Then I have Markov chain and try to compute $r_{lazy} * T_{lazy->wr} + r_{post} * T_{post->wr}$ where $r$ - stationary and $T_{smth->wr}$ - average time of getting wr (to the writing new letter) from post/lazy.

But something goes wrong. I receive bad result even for $N = 1$ when I try to compute chain.

enter image description here

firstly, I try to find $r$ with

$$ \begin{cases} r_{wr} = r_{wr} e^{-1/\mu} + (1-p) r_{post}\\ r_{post} = r_{wr} (1-e^{-1/\mu})\tau + r_{lazy}\tau + r_{post} p\tau. \\ r_{lazy} = r_{wr} (1-e^{-1/\mu}) (1-\tau) + r_{lazy}(1-\tau) + r_{post} p (1-\tau)\\ r_{wr} + r_{post} + r_{lazy} = 1. \end{cases} $$

Then I try to find $T_{smth->wr}$ with

$$ \begin{cases} T_{post->wr} = 1 + p (1-\tau) T_{lazy} + p \tau T_{post}. \\ T_{lazy->wr} = 1 + (1-\tau) T_{lazy} + \tau T_{post}. \end{cases} $$

And then answer is $T_{before} + r_{lazy} * T_{lazy->wr} + r_{post} * T_{post->wr}$

But it gives really unbelievable numbers.

Please, help. May be I am wrong?

Example. $\tau = 1/2, p = 0, N = 1, \mu = 3$

Correct answer is 2.52772647316

But here we get 0.723624806586.