# M/G/1/K - evalutate birth and death rates

Within a queue with capacity = K and exponential interarrival times, death rate is μ and birth rate λ.

A packet is discarded when the queue is full.

When the source is active there's a probability p1 > 0 that a packet is discarded at arrival. Moreover there's a probability p2 > 0 that all packets are discarded at arrival.

(so, a packet enters the queue with P=(1-p1-p2 | source is active))

The source that sends the packets with λ (birth rate) is idle for exponentially distributed times with rate ℬ (and active with rate ℒ)

Model the process with a Markov chain.

This is an extension to this excercise: variable death / birth rate in stochastic process

My thoughts follow:

I suppose, without considering idle periods, arrival times are poissonian with a birth rate of λ(1-p1-p2)

Now consider the source idle time. It is a poissonian process itself with only two states (active and idle). So we have a "random" selection of poissonian arrivals with probability P$_a$ = P(source is active) which we know has an exponential distribution with parameter ℒ. Birth rate becomes $λ(1-p1-p2)ℒ\Delta te^{-ℒ\Delta t}$ (not really sure about this).

Death rate changes according to probability p2: - $S_{n,n-1} = μ(1-p2)$ - $S_{n,0} = \frac{n p2}{\Delta t}$

So having poissionian arrivals but non-poissonian departures we are in a M/G/1/K queue with transition rates when the source is active (EDITED, see comments)

I've drawn a state transition diagram welcoming @D.Thomine suggestions in comments.

(not sure about it yet, I suspect I've to substract rate ℬ...)

-

With good reason. The active/idle distinction for the source does select some arrivals: if there would be an arrival while the source is idle, then this arrival is cancelled. However, to get a Poissonnian process, you should select each arrival independently. This is not the case here: for instance, if two arrivals are very close and the first one is cancelled, then the odds are the second one is also cancelled (the source is idle for the first arrival, and is unlikely to transition to active before the second arrival).

You could have remarked this error with the units. A rate has the dimension of the inverse of a time, let us say $s^{-1}$. You multiply to rates to get $\lambda (1-p_1-p_2) \mathcal{L}$, so the dimension of this object is $s^{-2}$... This is not homogenous, and I don't really see what it means to multiply rates.

My advice: extend the state space. Try to build a Markov process on $\{0,\cdots,K\} \times \{\text{active}, \text{idle}\}$ (of course, you can replace $\{\text{active}, \text{idle}\}$ with $\{0, 1\}$ if you wish). In other words, keep track of the number of packets in the queue, and of the status of the source.

Edit: in addition, I don't understand what you mean by "Death rate changes according to p2". Keep it simple: write down the rate at which you go from $n$ to $n-1$, and the rate at which you go from $n$ to $0$.

-
i get the point about unit measure (i guess at least i should have use the probability $p_s = -{\alpha}{\Delta}te^{-{\alpha}{\Delta}t}$ instead). do you mean that this cannot be treated as a poisson split process because the probability the source is active $p_s$ depends from the time t so is not independent from the arrival birth rate / transition probability ? about death rate my guesses are $μ(1−p2)$ and $np2$ as states above (not sure about this as well), as with probability p2 all $n$ packets are discarded when in $S_n$ –  gpilotino Feb 29 '12 at 19:37
There are two essentially identical ways to see the problem. The first is that a source sends you packets at some rate, except when it is idle. The second is that the source always send packets at the same rate, but there is a "mask" which cancel those packets when it is on (equivalent to the idle source) and let them pass when it is off (equivalent to the active source). I used the second interpretation, which looks closer in spirit to your "random selection of poissonian arrivals". –  D. Thomine Feb 29 '12 at 19:38
"do you mean that this cannot be treated as a poisson split process because the probability the source is active $p_s$ depends from the time $t$ so is not independent from the arrival birth rate / transition probability ?". Not exactly. I was pointing at the fact that if the source it idle, then it is idle for some length of time; if no packet arrive for some time, you can suspect that the source is idle, and that packets are less likely to arrive in the near future. You lose the Markov property. –  D. Thomine Feb 29 '12 at 19:44
if i get it, you're saying arrivals selections (masks / samples) aren't independent and not really random (like in a coin flip) as the probability the source is active is not constant in time but exponential in the same ${\Delta t}$ the system is transiting. about death rates my guesses are $n$ to $n-1$ = $μ(1−p2)$ and $n$ to $0$ = $\frac{np2}{\Delta t}$ (sorry if I sometimes retype comments, that's due to the 5 minutes edit limit of sxchange) –  gpilotino Feb 29 '12 at 20:07
$\Delta t$ is not defined, and must not appear in your formulas. All the transition rates you need have simple algebraic expression in terms of $\lambda$, $\mu$, etc. For instance, if the source is active, the transition from $n$ to $0$ happens at rate $\lambda p_2$ (a packet must enter the queue - this is a "birth", so you get a $\lambda$ - and trigger the "discard all" - hence the $p_2$). The transition from $n$ to $n-1$ happens at rate $\mu$ (or $\mu + \lambda p_1$, the exercise is not very clear on this point). I'll let you find the other transitions. –  D. Thomine Feb 29 '12 at 20:28