Queueing theory Birth-death Analysis M/M/1 queues (intro to M/M/c)
Birth Death Processes Consider The M/M/1 queue State 0 – the queue and server is empty State 1 – the server is in use and the queue is empty State 2 – the server is in use and 1 is in the queue State 3 – the server is in use and 2 in the queue n 1 2 3 𝜆 𝜇
Thoughts on Birth death processes The rate of moving from state 2 into state 3 should be the same as the rate from moving from state 3 into state 2. Over the course of a day if the queuing system moved from state 2 to 3 5000/day then the rate that the system goes from state 3 to state 2 must also be 5000/day(or maybe 4999/day). The probability of being in one state i is 𝑃 𝑖 . The probability of being in state i and going to state i+1 is equal to the probability of doing from state i+1 and going to state i. 𝑃 𝑖+1 (𝑑𝑒𝑎𝑡ℎ 𝑖+1 )= 𝑃 𝑖 (𝑏𝑖𝑟𝑡ℎ 𝑖 )
Birth-Death for M/M/1 queues continued 𝑃 0 =1−𝜌=1− 𝜆 𝜇 𝜆𝑃 0 = 𝜇𝑃 1 𝑃 1 = 𝜆 𝜇 𝑃 0 𝑃 𝑛+1 = 𝜆 𝜇 𝑃 𝑛 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑛 𝑃 𝑛 = 𝜆 𝜇 𝑛 𝑃 0 𝑖=0 ∞ 𝑃 𝑛 =1 𝑖=1 ∞ 𝜆 𝜇 𝑛 𝑃 0 =1
Mathematical Summation Recall from Calculus II 𝑖=0 ∞ 𝑥 𝑖 = 1 1−𝑥 𝑓𝑜𝑟 0<𝑥<1 When 𝜆< 𝜇 𝑡ℎ𝑒𝑛 0< 𝜆 𝜇 =𝜌<1 1= 𝑖=0 ∞ 𝜆 𝜇 𝑖 𝑃 0 = 1 1−𝜌 𝑃 0
Expected Values of a roll of dice 𝐸= 𝑖=1 6 𝑖 𝑃 𝑖 = 1 1 6 + 2 1 6 + 3 1 6 + 4 1 6 +(5) 1 6 +(6) 1 6 = 21 6 =3.5
Expected # customers in M/M/1 queue 𝐸= 𝑖=0 ∞ 𝑖 𝑃 𝑖 = 𝑖=0 ∞ 𝑖 𝜆 𝜇 𝑖 𝑃 0 = 𝑃 0 𝑖=0 ∞ 𝑖 𝜆 𝜇 𝑖 Recall from Calculus II 𝑖=0 ∞ 𝑖𝑥 𝑖−1 = 1 1−𝑥 2 𝑓𝑜𝑟 0<𝑥<1 𝐸= 𝑃 0 𝑖=0 ∞ 𝑖 𝜌 𝜌 𝑖−1 =(1−𝜌) 𝜌 𝑖=0 ∞ 𝑖 𝜌 𝑖−1 𝐸= (1−𝜌) 𝜌 1−𝜌 2 = 𝜌 1−𝜌 = 𝜆 𝜇 1− 𝜆 𝜇
Example M/M/1 queue 𝜆=2/ sec 𝑎𝑛𝑑 𝜇=3/𝑠𝑒𝑐 What is the total time in the queueing system? Time in system = time waiting in queue + service time. 𝑇 𝑠 = 𝑊 𝑞 +1/𝜇 𝑇 𝑠 = 𝐸 # (1/𝜇)+1/𝜇 𝑇 𝑠 = 𝜆 𝜇 1− 𝜆 𝜇 (1/𝜇)+1/𝜇 𝑇 𝑠 = 2 3 1− 2 3 1 3 +(1) 1 3 =2 1 3 +1 1 3 =1 second
M/M/3 queue birth death analysis State 0 – system is empty State 1 – 1 server in use, 2 servers idle, queue empty State 2 – 2 servers in use, 1 server idle, queue empty State 3 – 3 servers in use, queue empty State 4 – 3 servers in use, 1 customer in the queue State 5 – 3 servers in use, 2 customer in the queue X
Birth death equations for M/M/3 𝜆𝑃 0 = 𝜇𝑃 1 𝜆𝑃 1 = 2𝜇𝑃 2 𝜆𝑃 2 = 3𝜇𝑃 3 𝜆𝑃 3 = 3𝜇𝑃 4 𝜆𝑃 𝑛 = 3𝜇𝑃 𝑛+1 𝑎𝑙𝑙 𝑛>3 n 1 2 3 𝜆 𝜇 2𝜇 3𝜇