---
# System prepended metadata

title: Markovian Queues in Equilibrium
tags: [QT]

---

# Markovian Queues in Equilibrium
###### tags: `QT`
:::info
**Slide**
[Markovian Queues in Equilibrium](https://drive.google.com/file/d/1vO8RkpcP6gfAsToURBMtcug2pQaHu1AV/view?usp=sharing)
:::

## 3
- flow out rate = flow in rate: $(\frac{\lambda}{2}+\lambda)p_0=\mu p_1\\(\lambda+\mu)p_1=\lambda p_0+\mu p_2\\\mu p_2=\frac{\lambda}{2}p_0+\lambda p_1\\p_0+p_1+p_2=1$

## 5
- cosnider $D/D/1$: customer arrives periodicaly, does not have any random properties. e.g. $\tilde t \bar X$, $\tilde x < \tilde t$:at some period of time, there would be no customers in teh system
- $\text{for }p_k\text{ : }p_1=\frac{\tilde x}{\tilde t},\ p_0=1-\frac{\tilde x}{\tilde t}$
- $r_k: r_1=0, r_0=1$
## 6
- $R_k(t)=\lim\limits_{\Delta t\rightarrow 0}P[N(t)=k | A(t,t+\Delta t)]
= \lim\limits_{\Delta t\rightarrow 0}\frac{P[N(t)=k,\ A(t,t+\Delta t)]}{P[A(t,t+\Delta t)]}\\=\lim\limits_{\Delta t\rightarrow 0}\frac{P[A(t,t+\Delta t)|N(t)=k]\cdot P[N(t)=k]}{P[A(t,t+\Delta t)]}\\
\because\text{memoryless}\ \therefore =\lim\limits_{\Delta t\rightarrow t}P[N(t)=k]=P(t)$
## 8
- distribution function: $B(x)=1-e^{-\mu x}$
- mean: inverse relationshoip with average service rate

## 11
- $[H^*(s)]^2$
- $\int xf(x)dx$
- for 2 stage:
    - factor: $2\mu$: $H^*(x)=\frac{2\mu}{2\mu +s}$
    - $B^*(s)=(\frac{2\mu}{2\mu+s})^2$
    - $E[x]=\frac{d}{ds}B^*(s)|_{s=0}$
    - $E[\tilde{x}]=2E[\tilde{x}]=2\cdot \frac{1}{2\mu}=\frac{1}{\mu}$
## 12
- $\frac{1}{r\mu}\cdot r=\frac{1}{\mu}$

## 14
- k customers: $(k-1)r+(r-i+1)=rk-i+1$

## 15
- relate $p_j$ to $p_k$
- $1^{st}:\ j=(k-1)r+r=kr\\
r^{th}:\ (k-1)r+1\\
p_k=\sum_{j=(k-1)r+1}^{kr}p_j$

## 16
- adding one customers means adding r stages, r stages to be completed for one person

## 17
- equation: $\begin{cases}\lambda p_0=r\mu p_1\\
(\lambda+r\mu)p_j=\lambda p_{j-1}+r\mu p_{j+1} && j=1,2,...\end{cases}$
- Solving: $P(z)=\sum_{j=0}^\infty p_jz^j$
- summation of the equation 2 to solve it
- (note for proof)
- use z transform

## 21
- each customers has r stages: consider k customers, total rk stages
- kth customer: starts at rk, ends at rk + r - 1

## 22
- once enters r stage, customers start to be able to leave the stage
- $0\to r-1$: no service rate, only enter next stage
- $r\to \infty$: service rate appears, let customers leave
- $\begin{cases}r\lambda p_0=\mu p_r&&j=0\\r\lambda p_j=r\lambda p_{j-1}+\mu p_{j+r}&&1\leq j\leq r-1\\(r\lambda+\mu)p_j=r\lambda p_j+\mu p_{j+r} && j \geq r\end{cases}$
- z-transform: [note](https://drive.google.com/file/d/1BIXB-97_Ej3j3sB-NYYveaxyRaHAPVRX/view?usp=share_link)

## 23
- The previous problem is not common
- use the previous result to solve popular problem
- for one customer to arrive, there are total r customers to be completed (has not finished r stages facilities): go to r
- each small r customers only need single stage

## 24
- Not realistic: general case
- sometimes multiple customers
- all the probability of gi = 1
- (no zero customer to arrive)

## 25
$\begin{cases}
\lambda p_0=\mu p_1(p_0=\sum_{i=1}^\infty g_i)\\
(\lambda+\mu)p_k=\mu p_{k+1}+\sum_{i=0}^{k-1}p_i\cdot\lambda g_{k-i} & k\geq 1
\end{cases}$
- $G(z) = \sum_{i=0}^{\infty}g_kz^k$
- z transform: [note]()

## 26
![](https://i.imgur.com/zv1jZ25.png)
- $\begin{cases}\lambda p_0=\mu p_1 & k=0 \\
(\lambda+\mu)p_1=\frac{\lambda}{2}p_0+\mu p_2 & k=1\\
(\lambda+\mu)p_k=\frac{\lambda}{2}p_{k-1}+\frac{\lambda}{2}p_{k-2}+\mu p_{k+1} & k\ge 2\end{cases}$
[note]()
## 27
- state: number of customers
- each customer needs to finish r stages

## 28
![](https://i.imgur.com/f5FHNWj.png)
- $\begin{cases}\lambda p_0=\mu(p_01+p_2+......) & k=0\\(\lambda+\mu)p_k=\mu p_{k+r}+\lambda p_{k-1} & k \ge 1\end{cases}$

[note]()

## 29
![](https://i.imgur.com/SMkNnfc.png)
- boundary case: $k=0: \lambda p_0=\mu p_1 + \mu p_2$
- other states: $k \ge 1 (\lambda p + \mu)p_k = \lambda p_{k-1} + \mu p_{k+2}$
- result: $P(z)=\frac{\mu p_0 p_0(z+1)+\mu p_1 z}{\mu(z+1)-\lambda z^2}$
    - $P(1) = 1$
    - $P_1 = 2(1-p_0)-\frac{\lambda}{\mu}$
    - $P(z) = \frac{(2\mu-\lambda)z+\mu}{\mu(z+1)-\lambda z^2}$