Lecture 3: Algorithmic Methods for M/M/1-type models: Quasi Birth Death Process Dr. Ahmad Al Hanbali Department of Industrial Engineering University of Twente [email protected] 1 Lecture 3 ๏ฑ ๏ฑ This Lecture deals with continuous time Markov chains with infinite state space as opposed to finite space Markov chains in Lectures 1 and 2 Objective: To find equilibrium distribution of the Markov chain Lecture 3: M/M/1 type models 2 Background (1): M/M/1 queue ๏ฑ Customers arrive according to Poisson process of rate ๐, i.e., the inter-arrival times are iid exponential random variables (rv) with rate ๐ ๏ฑ Customers service times are iid exponential rv with rate ๐ ๏ฑ inter-arrivals and service times are independent ๏ฑ Service discipline can be Fisrt-In-First-Out (FIFO), Last-In-First-Out (LIFO), or Processor Sharing (PS) Under above assumptions, {๐(๐ก), ๐ก โฅ 0}, the nbr of customers in M/M/1 queue at time ๐ก is continuous-time infinite space Markov chain Lecture 3: M/M/1 type models 3 Background (2): M/M/1 queue ฮป 0 ฮป µ µ ฮป i i-1 1 µ ฮป ฮป µ ฮป i+1 µ µ Let ๐๐ denote equilibrium probability of state ๐, then โ๐๐0 + ๐๐1 = 0, ๐๐๐โ1 โ ๐ + ๐ ๐๐ + ๐๐๐+1 = 0, ๐ = 1,2, โฆ Solving equilibrium equations for ๐ = ๐/๐ < 1 (with ๐โฅ0 ๐๐ = 1) gives: ๐๐ = ๐๐โ1 ๐, ๐0 = 1 โ ๐ โ ๐๐ = 1 โ ๐ ๐๐ , ๐ โฅ 0, This means N is geometrically distributed with parameter ๐ Lecture 3: M/M/1 type models 4 Background (3) Stability condition, expected queue length is finite, load ฯ:= ฮป/µ < 1โ ๐ < ๐. This can be interpreted as drift to right is smaller than drift to left ๏ฑ In stable case ฯ is probability the M/M/1 system is non-empty, i.e. , ๐(๐ = 0) = 1 โ ๐ ๏ฑ Q, the generator of M/M/1 queue, is a tridiagonal matrix, form has the form โ๐ ๐ 0 โฆ ๐ โ๐ โ ๐ ๐ โฑ ๐= 0 ๐ โ๐ โ ๐ โฑ ๐ โฑ โฑ โฎ โฑ โฑ โฑ โฎ Lecture 3: M/M/1 type models ๏ฑ 5 M/M/1-type models: Quasi Birth Death Process ๏ฑ ๏ฑ ๏ฑ ๏ฑ A 2-dimensional irreducible continuous time Markov process with states (๐, ๐), where ๐ = 0, โฆ , โ and ๐ = 0, โฆ , ๐ โ 1 Subset of state space with common ๐ entry is called level ๐ (๐ > 0) and denoted ๐(๐) = {(๐, 0), (๐, 1), โฆ , (๐, ๐ โ 1)}. ๐(0) = {(0,0), (0,1), โฆ , (๐, ๐ โ 1)}. This means state space is โช๐โฅ0 ๐(๐) Transition rate from (๐, ๐) to (๐โฒ, ๐โฒ) is equal to zero for |๐ โ ๐โฒ| โฅ 2 For ๐ > 0, transition rate between states in ๐(๐) and between states in ๐(๐) and ๐(๐ ± 1) is independent of ๐ Lecture 3: M/M/1 type models 6 M/M/1-type models: Quasi Birth Death Process Order the states lexicographically, i.e., 0,0 , โฆ , (0, ๐ โ Lecture 3: M/M/1 type models 7 QBDs stability Theorem: The QBD is ergodic (i.e., mean recurrence time of the states is finite) if and only if ๐๐ด0๐ < ๐๐ด2๐, (mean drift condition) where ๐ is the column vector of ones and ๐ is the equilibrium distribution of the irreducible Markov chain with generator ๐ด = ๐ด0 + ๐ด1 + ๐ด2, ๐๐ด = 0, ๐๐ = 1 Interpretation: ๐๐ด0๐ is mean drift from level ๐ to ๐ + 1. ๐๐ด2๐ is mean drift from level ๐ to ๐ โ 1. Generator ๐ด describes the behavior of QBD within level Lecture 3: M/M/1 type models 8 Equilibrium distribution of QBDs Let ๐๐ = (๐(๐, 0), . . , ๐(๐, ๐ โ 1)) and ๐ = (๐0, ๐1, โฆ ) then equilibrium equation ๐๐ = 0 reads ๐0๐ต00 + ๐1๐ต10 = 0, ๐0๐ต01 + ๐1๐ต11 + ๐1๐ด2 = 0 ๐๐โ1 ๐ด0 + ๐๐๐ด1 + ๐๐+1 ๐ด2 = 0, ๐ โฅ 2 Theorem: if the QBD is ergodic the equilibrium probability distribution then reads ๐๐ = ๐1๐ ๐โ1 , ๐ โฅ 2, where ๐ = ๐ด0๐, called rate matrix, and the matrix ๐ records the expected sojourn time in the states of ๐(๐), starting from ๐(๐), before the first visit to ๐(๐ โ 1) Lecture 3: M/M/1 type models 9 Proof On board. Based on proof of Latouche & Ramaswami in the book โIntroduction to Matrix Analytic Methods in Stochastic Modelingโ Chap. 6 p. 129-133 ...... A direct result of the previous theorem is that spectral radius of ๐ is < 1 It remains to find ๐0, ๐1 , and ๐ ? Lecture 3: M/M/1 type models 10 Equilibrium Distribution (cnt'd) Lemma: The matrix ๐ is the minimal nonnegative solution of ๐ด0 + ๐ ๐ด1 + ๐ 2๐ด2 = 0 Lemma: The stationary probability vectors ๐0 and ๐1 are the unique solution of ๐0๐ต00 + ๐1 ๐ต10 = 0 ๐0๐ต01 + ๐1 (๐ต11 +๐ ๐ด2 ) = 0 ๐0 ๐๐ + ๐1 ๐ผ โ ๐ โ1 ๐๐ = 1 (Normalization condition) where ๐๐ and ๐๐ are column vectors of ones with size ๐ and ๐, respectively Lecture 3: M/M/1 type models 11 Compute R ๏ฑ ๏ฑ ๏ฑ ๏ฑ ๏ฑ Rearrange the quadratic equation of the rate matrix: ๐ = โ ๐ด0 + ๐ 2๐ด2 ๐ด1โ1 ๐ด1 is invertible since it is a generator of a transient Markov chain l(n) of states, n>0 Fixed point equation solved by successive substitution ๐ ๐+1 = โ(๐ด0 + ๐ ๐2 ๐ด2 )๐ด1โ1 , with ๐ 0 = 0 It can be shown that ๐ ๐ โ ๐ for ๐ โ โ A way to check the correctness of ๐ is by verifying that: ๐ต10 ๐๐ + ๐ต11 + ๐ ๐ด2 ๐๐ = 0 Lecture 3: M/M/1 type models 12 Special cases For ๐ด2 = ๐ฃ. ๐ผ is a product of two vectors where ๐ฃ is column vector and ๐ผ is row vector with ๐ ๐=0 ๐ผ๐ = 1, the rate matrix reads, ๐ is a column vector of ones, ๐ = โ๐ด0 ๐ด1 + ๐ด0 ๐๐ผ โ1 , ๏ฑ For ๐ด0 = ๐ค. ๐ฝ is a product of two vectors where ๐ค is column vector and ๐ฝ is row vector with ๐ ๐=0 ๐ฝ๐ = 1, the rate matrix reads ๐ = ๐ค. ๐ โ ๐ ๐ = ๐ ๐โ1 ๐ where ๐ is some row and ๐ = ๐. ๐ค (a number). ๐ is spectral radius of ๐ and can be found as the root (0,1) of det ๐ด0 + ๐ฅ๐ด1 + ๐ฅ 2 ๐ด2 = 0 ๏ฑ Lecture 3: M/M/1 type models 13 Spectral expansion method ๏ฑ The balance equation can be seen as a difference equation with a basis solution of form ๐๐ = ๐ฆ๐ฅ ๐ , ๐ฆ = ๐ฆ 0 , โฆ , ๐ฆ ๐ ๏ฑ โ 0 ๐๐๐ ๐ฅ < 1 Inserting this solution in the balance equation ๐๐โ1 ๐ด0 + ๐๐๐ด1 + ๐๐+1 ๐ด2 = 0, ๐ โฅ 2 yields ๐ฆ ๐ด0 + ๐ฅ๐ด1 + ๐ฅ 2 ๐ด2 = 0 โ det ๐ด0 + ๐ฅ๐ด1 + ๐ฅ 2 ๐ด2 = 0 ๏ฑ This latter equation has ๐ + 1 roots in the unit disk and ๐ ๐๐ = ๐๐ ๐ฆ๐ ๐ฅ๐ ๐โ1 , ๐ = 1,2, โฆ ๐=0 ๏ฑ The constants ๐๐ , ๐ = 0, โฆ , ๐, are found using the boundary equations and the normalization condition Lecture 3: M/M/1 type models 14 Spectral expansion method ๏ฑ ๏ฑ ๏ฑ ๏ฑ The roots ๐ฅ0 , โฆ , ๐ฅ๐+1 are eigenvalue of the rate matrix ๐ with corresponding left eigenvectors ๐ฆ0 , โฆ , ๐ฆ๐+1 If it appears some these roots are of a multiplicity higher than a more complicated basis solution should be considered No probabilistic interpretation is available for ๐ฅ๐ โs and ๐ฆ๐ โs Numerically it has been found that Matrix geometric methods is more stable than the spectral expansion Lecture 3: M/M/1 type models 15 M/M/1 Type models ๏ฑ Machine with set-up times ๏ฑ Unreliable machine ๏ฑ M/Er/1 model ๏ฑ Er/M/1 model ๏ฑ PH/PH/1 model Lecture 3: M/M/1 type models 16 Machine with set-up times (1) ๏ฑ ๏ฑ ๏ฑ In addition to assumptions of M/M/1 system, further assume that the system is turned off when it is empty System is turned on again when a new customer arrives The set-up time is exponentially distributed with mean 1/๐ Lecture 3: M/M/1 type models 17 Machine with set-up time (2) ๏ฑ ๏ฑ Number of customers in system is not a Markov process Two-dimensional process of state (๐, ๐) where ๐ is number of customers and ๐ is system state (๐ = 0, sys. is off, ๐ = 1, sys. is on) is Markov process Lecture 3: M/M/1 type models 18 Machine with set-up time (3) ๏ฑ Let ๐(๐, ๐) denote equilibrium prob. of state (๐, ๐), ๐ โฅ 0, ๐ = 0,1. Equilibrium equations read ๐(0,0)๐ = ๐(1,1)๐ ๐(๐, 0)(๐ + ๐) = ๐(๐ โ 1,0)๐, ๐โฅ1 ๐(๐, 1)(๐ + ๐) = ๐(๐, 0)๐ + ๐(๐ + 1,1)๐ + ๐(๐ โ 1,1)๐, ๏ฑ ๐โฅ1 Let ๐๐ = (๐(๐, 0), ๐(๐, 1)), then Equilibrium eqs read ๐0๐ต1 + ๐1๐ต2 = 0, ๐๐โ1 ๐ด0 + ๐๐ ๐ด1 + ๐๐+1 ๐ด2 = 0, ๐ โฅ 1 Lecture 3: M/M/1 type models 19 Machine with set-up time (4) where ๐ ๐ด0 = 0 0 0 โ ๐+๐ 0 , ๐ด2 = , ๐ด1 = 0 ๐ 0 ๐ 0 0 โ๐ 0 ๐ต1 = , ๐ต2 = 0 ๐ 0 โ๐ ๐ โ ๐+๐ , We shall use the Matrix geometric to the find the equilibrium probability Lecture 3: M/M/1 type models 20 Matrix Geometric Method (1) ๏ฑ Global balance equations are given by equating flow from level ๐ to ๐ + 1 with flow from ๐ + 1 to ๐ which gives, ๐ ๐, 0 + ๐ ๐, 1 ๐ = ๐ ๐ + 1,1 ๐, ๐ โฅ 1 ๏ฑ In matrix notation this gives ๏ฑ ๐ ๐๐+1 ๐ด2 = ๐๐ ๐ด3, where ๐ด3 = ๐ This gives, ๐ โฅ 1, 0 0 ๐๐โ1 ๐ด0 + ๐๐ ๐ด1 + ๐ด3 = 0 โ ๐๐ = โ๐๐โ1 ๐ด0 ๐ด1 + ๐ด3 โ ๐ = โ๐ด0 ๐ด1 + ๐ด3 Lecture 3: M/M/1 type models โ1 ๐/ ๐+๐ = 0 โ1 ๐/๐ ๐/๐ 21 Matrix Geometric method (2) ๏ฑ Stability condition: absolute values of eigenvalues of R should be strictly smaller than 1 ๐ < ๐ and ๐ > 0 ๏ฑ Normalization condition gives ๐0 ๐ผ + ๐ + ๐ 2 + โฏ ๐ = 1 โ ๐0 ๐ผ โ ๐ ๏ฑ =1 Note 0,1 is a transient state thus ๐ 0,1 = 0. ๐ ๐ Normalization gives that ๐ 0,0 = 1โ ๐+๐ ๏ฑ โ1 ๐ ๐ Mean number of customers ๐ธ[๐ฟ] = Lecture 3: M/M/1 type models ๐ ๐๐๐ ๐ = ๐0 ๐ ๐ผ โ ๐ โฅ 1 โ2 ๐ 22 Unreliable machine (1) ๏ฑ ๏ฑ ๏ฑ customers arrive according to Poisson process of rate ๐ Service times is exponentially distributed of rate ๐ Up time of the machine is exp. distributed with rate 1/๐ ๏ฑ Repair time is exp. dist. with rate 1/๐ ๏ฑ Stability condition: load is smaller than capacity of the machine: ๐/๐ < ๐(๐๐๐โ๐๐๐ ๐๐ ๐ข๐) = ๐/(๐ + ๐) Lecture 3: M/M/1 type models 23 Unreliable machine (2) ๏ฑ Under the above assumption the two-dimensional process of state (๐, ๐), where ๐ nbr of customers, ๐ the state of machine (๐ = 1 machine up, ๐ = 0 machine down), Then Lecture 3: M/M/1 type models 24 Unreliable machine (3) ๏ฑ Note ๐ด2 = ๐ฃ๐ผ, matrix geometric method gives ๐๐ ๏ฑ ๏ฑ = ๐0๐ ๐ , ๐ โฅ 1, ๐ = โ๐ด0 ๐ด1 + ๐ด0 ๐๐ผ โ1 = ๐ ๐ ๐+๐ ๐+๐ ๐ ๐+๐ 1 1 Note in this case we have that ๐0 ๐ผ โ ๐ โ1 = 1 โ ๐๐ข ๐๐ข , where ๐๐ข is probability that the machine is up ๐/(๐ + ๐). We find ๐0 = 1 โ ๐๐ข ๐๐ข ๐ผ โ ๐ = ๐๐ข โ ๐ ๐ ๐ ๐+๐ 1 Spectral expansion method gives ๐๐ = ๐1๐ฆ1๐ฅ1๐ + ๐2๐ฆ2๐ฅ2๐ where ๐ฅ1 and ๐ฅ2 are roots of (eigenvalues of ๐ ): ๏ฑ ๐ ๐ + ๐ ๐ฅ 2 โ ๐ ๐ + ๐ + ๐ + ๐ ๐ฅ + ๐2 = 0 Lecture 3: M/M/1 type models 25 M/Er/1 model (1) ๏ฑ ๏ฑ ๏ฑ Poisson arrivals with rate ฮป Service times is Erlang distributed of r phases of mean r/ฮผ, i.e., is sum r exponentially distributed rv each of rate ฮผ Stability is offered load is smaller than 1 ฯ = ฮป.r/ฮผ < 1 ๏ฑ Two dimensional process of state (i,j) where i is nbr of customers in the system (excluding the customer in service) and j remaining phases of customer in service is Markov process Lecture 3: M/M/1 type models 26 M/Er/1 model (2) State diagram: ๐ด0 = ๐๐ผ, ๐ด2 = Lecture 3: M/M/1 type models 0 โฎ โฎ 0 โฏ โฏ 0 0 ๐ โ1 0 0 , ๐ด = ๐ 1 โ1 1 โฎ โฑ โฎ 0 โฏ โฏ 0 โฆ โฑ โฑ 1 0 0 โ ๐๐ผ 0 โ1 27 M/Er/1 model (2) ๏ฑ Matrix geometric method gives ๐๐ = ๐0๐ ๐ , ๐ โฅ 1, ๐ = โ๐ด0 ๐ด1 + ๐ด0 ๐๐ผ ๏ฑ = โ๐ ๐ด1 + ๐๐๐ผ โ1 Sherman-Morrison formula gives that, ๐ฅ = ๐/(๐ + ๐), 1 ๐ฅ โฎ ๐ = 1โ๐ฅ ๐ฅ ๐โ1 ๏ฑ โ1 0 1 โฆ โฑ โฑ โฑ โฏ ๐ฅ 0 0 + 1โ๐ฅ 0 ๐ฅ๐ 1 1โ๐ฅ 1 โ ๐ฅ2 โฎ 1 โ ๐ฅ๐ ๐ฅ ๐โ1 โฆ 1 Note for any M/PH/1 queue we have that ๐ด2 is a rank one matrix (product of a column and row vector). So, ๐ can be found in closed form Lecture 3: M/M/1 type models 28 Phase-Type Distribution ๏ฑ ๏ฑ ๏ฑ ๏ฑ Consider a continuous time absorbing Markov chain (AMC) with {1, โฆ , ๐} transient states and one absorption state ๐ + 1, i.e., ๐๐+1๐+1 = 0. Let ๐ denote the transition rate matrix between transient states, and ๐ผ the initial state probability. Let ๐ 0 denote the transition rate vector of the transient states to absorption state. ๐๐ + ๐ 0 = 0 โ โ๐ โ1 ๐ 0 = ๐ Definition: A probability distribution ๐น(. ) on [0,โ) is a phase type distribution (PH-distribution) if it is the distribution of the time to absorption of AMC. The pair (๐ผ, ๐ป) is called a representation ๐น(. ) Lecture 3: M/M/1 type models 29 Phase-Type Distribution ๏ฑ ๏ฑ Examples of phase-type distribution are Erlang-n, Hyper-exponential, and Coxian distributions Hyper-exponential distribution of n phases each of rate ๐๐ with ๐ผ = ๐1, โฆ , ๐๐ p p p 1 ฮผ1 ๏ฑ n 2 1 2 n ฮผ2 ฮผn Coxian distribution of ๐ phases each of rate ๐๐ , where ๐๐ + ๐๐ = 1, ๐ = 1, . . , ๐ โ 1, and ๐๐ = 1, and ๐ผ=(1,0,โฆ,0) p1ฮผ1 1 Lecture 3: M/M/1 type models p2ฮผ2 2 q1ฮผ1 pn-1ฮผn-1 n q2ฮผ2 ฮผn 30 PH/PH/1 queue ๏ฑ ๏ฑ ๏ฑ ๏ฑ ๏ฑ Inter-arrival times distribution is phase-type with n phases denoted ๐ผ, ๐ and with mean โ๐ผ๐ โ1 ๐. Let ๐ 0 = โ๐๐ Service time distribution is of Phase type with ๐ phases denoted (๐ฝ, ๐) and with mean โ๐ฝ๐ โ1 ๐. Let ๐ 0 = โ๐๐ Assume that customers are served as FIFO The queue is stable if โ๐ผ๐ โ1 ๐ > โ๐ฝ๐ โ1 ๐ Let ๐๐ก , ๐ด๐ก , and ๐๐ก denote number of jobs in the system, phase of inter-arrival, and phase of job in service at time t Lecture 3: M/M/1 type models 31 PH/PH/1 model ๏ฑ ๏ฑ The process ๐๐ก , ๐ด๐ก , ๐๐ก is continuous-time Quasi-DeathProcess For Cox2/Cox2/1 queue, transitions between level ๐ states, level ๐ to ๐ + 1, and level ๐ to ๐ โ 1 are as follows: Lecture 3: M/M/1 type models 32 PH/PH/1 model Note if Q is generator of joint process of two independent Markov chains of size ๐1and ๐2. Then, Q is sum of two kronecker products, i.e., ๐ = ๐1 โ ๐ผ๐1 + ๐ผ๐2 โ ๐2 where ๐ด โB means every element of A is multiplied by B whole. ๏ฑ The generator of the PH/PH/1 ๐ต00 ๐ต01 0 0 โฆ ๐ต10 ๐ด1 ๐ด0 0 โฑ ๐= 0 ๐ด2 ๐ด1 ๐ด0 โฑ , โฎ โฑ ๐ด2 ๐ด1 โฑ โฎ โฑ โฑ โฑโฑ where ๐ด1 = ๐ โ ๐ผ๐ + ๐ผ๐ โ ๐, ๐ด0 = ๐ 0 ๐ผ โ ๐ผ๐ , ๐ด2 = ๐ผ๐ โ ๐ 0 ๐ฝ, ๐ต00 = ๐, ๐ต01 = ๐ 0 ๐ผ โ ๐ฝ, and ๐ต10 = ๐ผ โ ๐ 0 . Lecture 3: M/M/1 type models 33 PH/PH/1 model ๏ฑ The rate matrix ๐ is the minimal solution of the quadratic equation ๐ด0 + ๐ ๐ด1 + ๐ 2 A2 = 0, ๐ 0 ๐ผ โ ๐ผ๐ + ๐ (๐ โ ๐ผ๐ + ๐ผ๐ โ ๐) + ๐ 2 ๐ผ๐ โ ๐ 0 ๐ฝ = 0, Example: consider the Cox2/Cox2/1 queue with mean interarrival time 6/5, mean service time 5/6, โ1 0.4 โ1.5 0.5 ๐ผ = 1 0 ,๐ = and ๐ฝ = 1 0 , ๐ = 0 โ2 0 โ2 The iterative scheme needs about 40 iterations for 10โ5 precision ๏ฑ ๐ = 0.3833 0.0975 1.2777 0.3251 ๐0 = 0.2374 0.0681 , ๐ธ ๐ Lecture 3: M/M/1 type models 0.0639 0.0609 0.0140 0.2163 0.0214 0.0243 0.2129 0.2030 0.0467 0.7208 0.0712 0.0810 = 1.9582. 34 References ๏ฑ ๏ฑ ๏ฑ ๏ฑ R. Nelson. Matrix geometric solutions in Markov models: a mathematical tutorial. IBM Technical Report 1991. G. Latouche and V. Ramaswami (1999), Introduction to Matrix Analytic Methods in Stochastic Modeling. SIAM. I. Mitrani and D. Mitra, A spectral expansion method for random walks on semi-infinite strips, in: R. Beauwens and P. de Groen (eds.), Iterative methods in linear algebra. North-Holland, Amsterdam (1992), 141โ149. M.F. Neuts (1981), Matrix-geometric solutions in stochastic models. The John Hopkins University Press, Baltimore. Lecture 3: M/M/1 type models 35
© Copyright 2026 Paperzz