-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlec24.typ
More file actions
242 lines (157 loc) · 5.4 KB
/
Copy pathlec24.typ
File metadata and controls
242 lines (157 loc) · 5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
== Lecture 24
[D] § 3.2: Applications of Renewal Processes to queueing theory
1st example: GI/G/1 queue
GI = General input \
G = General service times \
1 = One server
#pagebreak()
Customers arrive at rate $lambda$ ($"E"tau = 1/lambda$) \
Customers served at rate $mu$ ($"E"s = 1/mu$)
*Theorem.* If $lambda < mu$ then the long run proportion of time the server is busy is $<= lambda/mu < 1$.
#pagebreak()
*Cost Equations (any queue)*
Let $X_s$ = \# customers in system at time $s$ (being served or waiting in queue).
Then LR average \# customers in system is
$
L = lim_(t -> oo) 1/t integral_0^t X_s d s
$
#pagebreak()
LR average amount of time a customer spends in system:
$
W = lim_(n -> oo) 1/n sum_(i=1)^n W_m
$
Where $W_m$ = amount of time spent in system by $m$th customer.
#pagebreak()
Finally, LR average rate at which customers arrive:
$
lambda_a = lim_(t -> oo) (N_a (t)) / t = lambda#footnote[if GI/G/1 Queue]
$
Where $N_a(t)$ = \# customers by time $t$.
*Little's Formula*#footnote[holds for any queue]
$
L = lambda_a W
$
#pagebreak()
*Proof.* Suppose customers pay \$1/min while in system.
Then in LR, system earns \$L/min.
Seen another way, each customer on average spends \$W.
Therefore, since customers arrive at a rate $lambda_a$, system earns $\$W lambda_a slash min$.
#pagebreak()
*An application:*
Let $W_Q$ = average time spent in queue (waiting to be served).
Note $W_Q = underbrace(W, "ave. time in system") - underbrace(E S, "ave. time being served")$
#pagebreak()
Let $L_Q$ = LR average queue length (not counting customer being served).
If instead, only pay \$1 when in queue, then
$
L_Q = lambda_a W_Q
$
The length of queue is 0 if no customers, and otherwise 1 less than \# customers in system.
#pagebreak()
$
therefore L_Q & = (L-1)(1-pi_0) + L pi_0 \
& = L - 1 + pi_0
$
where $pi_0$ = LR prob. of no customers altogether.
Altogether,
#pagebreak()
$
W_Q & = W - "E"S \
L_Q & = lambda_a W_Q quad \& quad L = lambda_a W \
L_Q & = L - 1 + pi_0
$
$
=> pi_0 & = L_Q - (L-1) \
& = 1 + L_Q - L \
& = 1 + lambda_a (W_Q - W) \
& = 1 - lambda_a "E"S
$
#pagebreak()
$therefore$ if GI/G/1 Queue, $pi_0 = 1 - lambda/mu$#footnote[$lambda_a = lambda, "E"S = 1 / mu, lambda_a "E"S = lambda / mu$]
$therefore 1 - pi_0 =$ LR prop. busy $= lambda/mu$
This shows result of previous theorem (LR prop. busy $<= lambda/mu$) is sharp.
#pagebreak()
Important special case of a GI/G/1 queue is
M/G/1 where we assume customers arrive according to a $"PP"(lambda)$. ($"M" equiv "Markovian"$).
$X_n$ = \# customers in queue when $n^"th"$ customer starts being served.
#pagebreak()
Thus MC can be constructed as follows:
Prob. exactly $k$ customers arrive during any given service time is:
$
a_k = integral_0^oo underbrace(e^(-lambda t) ((lambda t)^k) / (k!), #footnote[Prob. k more customers arrive during this service time, $P("Poi"(lambda t) = k)$]) underbrace(d G(t), #footnote[$G$ = CDF of service time, $g$ = PDF, $d G(t) = g(t) d t$])
$
#pagebreak()
Let $xi_1, xi_2, dots$ be IID RVs.
$
P(xi = k) = a_k
$
$xi_n$ = \# customers arriving during $n^"th"$ service time.
If $X_n = xi_n = 0$#footnote[$X_n = 0$, there is no people in the queue when the $n^"th"$ people starts to be served], then $X_(n+1) = 0$. \
Otherwise:
$X_(n+1) = X_n + xi_n underbrace(- 1, n^"th" "person has done being served")$
#pagebreak()
#figure[
#image(
"./figs/p24_25m.png",
height: 100%,
)
]
#pagebreak()
Therefore,
$
P = mat(
a_0+a_1, a_2, a_3, a_4, dots;
a_0, a_1, a_2, a_3, dots;
0, a_0, a_1, a_2, dots;
0, 0, a_0, a_1, dots;
dots.v, dots.v, dots.v, dots.v, dots.down
)
$
$
P_(0 0) & = a_0 + a_1 \
P_(0 1) & = a_2 \
P_(1 0) & = a_0
$
#pagebreak()
*Theorem.* In M/G/1 Queue,
$X_n$ = \# in queue when $n^"th"$ customer starts service
$lambda < mu: (X_n)$ Pos Rec & $"E"_0 T_0#footnote[starting with 0 people in the queue, the expected length of time we have to wait to clear out the queue] = mu / (mu-lambda)#footnote[$pi_0 = 1 - lambda / mu$]$
$lambda = mu: (X_n)$ Null Rec
$lambda > mu: (X_n)$ Trans
#pagebreak()
*Proof*
Consider the customers that arrive during $n^"th"$ service time the "children" of this customer.
Then we can compare $(X_n)$ with a BP with offspring distribution
$
P(xi = k) = a_k
$
#pagebreak()
#text(size: 11pt)[
$
"E"xi & = sum_k k a_k \
& = sum_k k integral_0^oo underbrace(e^(-lambda t) ((lambda t)^k)/(k!), P("Poi"(lambda t) = k)) d G(t) \
& = integral_0^oo underbrace(lambda t, #footnote[$sum_k k P("Poi"(lambda t) = k) = "E"("Poi"(lambda t)) = lambda t$]) d G(t) \
& = lambda "E"S \
& = lambda/mu
$
]
#pagebreak()
$therefore$ Trans, Pos Rec, Null Rec follow by BP#footnote[branching process] theory.
Only remains to show \
$"E"_0 T_0 = mu/(mu-lambda)$ in Pos Rec case.
*Note* BP transitions in discrete
#pagebreak()
steps, whereas $(X_n)$ transitions in varying continuous steps $tau_1, tau_2, dots$ of the underlying $"PP"(lambda)$.
This did not matter for determining Trans, Pos Rec, Null Rec.
But for $"E"_0 T_0$ we need to look at time $T_0$,
#pagebreak()
which is different in $(X_n)$ than in BP.
Recall that for GI/G/1 we showed $pi_0 = 1 - lambda/mu = (mu-lambda)/mu$ if customers arrive rate $lambda$.
That is case here for $"PP"(lambda)$.
$
therefore "E"_0 T_0 = 1 / pi_0 = mu/(mu-lambda)
$
#pagebreak()
More to say about M/G/1 queue.
We will skip this.
See p.134-136 if interested.