Understanding Probability Theory Concepts
Understanding Probability Theory Concepts
R
s X X(s)
S
S R
Dr. Laxmipriya Parida
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 4
Discrete Random Variables
Probability
0.3
0.2 0.2
Number
1 2 3 4 5 6
2. f(x)dx = 1.
f(x)
CDF
Area
0.3
0.2 0.2
E[X] = 0.166
0.1 0.1 0.1
1 2 3 4 5 6
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 11
Expected Value, nth Moment, nth
Central Moment, and Variance
Continuous Random Variable
Expected value or mean value
+
E[X] = xf(x)dx
-
nth moment +
E[Xn] = xnf(x)dx
-
nth central moment +
E[(X – E[X])n] = (x – E[X])nf(x)dx
-
Variance or the second central moment
2 = Var(X) = E[(X – E[X])2] = E[X2] - (E[X])2
n
P(X k) pk(1 p)n k ,
k
where,
k 0,1,2,...,n; n 0,1,2,...; p is the sucess probability, and
n
n!
k k!(n k)!
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 17
Multiple Random Variables
There are cases where the result of one experiment
determines the values of several random variables
The joint probabilities of these variables are:
Discrete variables:
p(x1, …, xn) = P(X1 = x1, …, Xn = xn)
Continuous variables:
cdf: Fx1x2…xn(x1, …, xn) = P(X1 x1, …, Xn xn)
n
FX 1, X 2,... Xn( x1, x 2,...xn)
pdf: fX 1, X 2,... Xn( x1, x 2,...xn)
x1x 2...xn
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 18
Independence and Conditional
Probability
Independence: The random variables are said to be independent
of each other when the occurrence of one does not affect the
other. The pmf for discrete random variables in such a case is
given by:
p(x1,x2,…xn)=P(X1=x1)P(X2=x2)…P(X3=x3) and for continuous
random variables as:
FX1,X2,…Xn = FX1(x1)FX2(x2)…FXn(xn)
Conditional probability: is the probability that X1= x1 given that
X2= x2. Then for discrete random variables the probability
becomes:
P ( X x1, X 2 x 2,..., Xn xn)
1
P ( X 1 x1 | X 2 x 2,..., Xn xn)
P ( X x ,..., X n x n )
2 2
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 20
Important Properties of Random
Variables
Sum property of the expected value
Expected value of the sum of random variables:
n n
E aiXi aiE[ Xi ]
i 1 i 1
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 21
Important Properties of Random Variables
Sum property of the variance
Variance of the sum of random variables is
n n n -1 n
Var aiXi ai Var ( Xi ) 2 aiaj cov[ Xi, Xj ]
2
i 1 i 1 i 1 ji 1
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 22
Important Properties of Random Variables
Distribution of sum - For continuous random variables with joint pdf fXY(x, y)
and if Z = Φ(X,Y), the distribution of Z may be written as
FZ ( z ) P( Z z ) fXY ( x, y )dxdy
zZ
where ΦZ is a subset of Z.
For a special case Z= X+Y
Fz ( z )
fXY ( x, y )dxdy fXY ( x, y )dxdy
Z
If both X and Y are non negative random variables, then pdf is the convolution
of the individual pdfs, fX(x)z and fY(y).
fZ ( z ) fX ( x) fY ( z x) dx, for - z
0
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 23
Central Limit Theorem
1 n
Sn X i
n i 1
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 24
Central Limit Theorem
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 25
Poisson Arrival Model
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 26
Properties of a Poisson Process
Properties of a Poisson process
For a time interval [0, t] , the probability of n arrivals in
t units of time is
(t ) n t
Pn (t ) e
n!
For two disjoint (non overlapping ) intervals (t1, t2) and
(t3, t4), (i.e. , t1 < t2 < t3 < t4), the number of arrivals in
(t1, t2) is independent of arrivals in (t3, t4)
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 27
Interarrival Times of Poisson Process
Interarrival times of a Poisson process
We pick an arbitrary starting point t0 in time . Let
T1 be the time until the next arrival. We have
P(T1 > t) = P0(t) = e -t
Thus the cumulative distribution function of T1 is
given by
FT1(t) = P(T1≤ t) = 1 – e -t
The pdf of T1 is given by
fT1(t) = e -t
Therefore, T1 has an exponential distribution with
mean rate .
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 28
Exponential Distribution
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 29
Memoryless and Merging Properties
Memoryless property
A random variable X has the property that “the future is
independent of the past” i.e., the fact that it hasn't
happened yet, tells us nothing about how much longer it
will take before it does happen.
Merging property
If we merge n Poisson processes with distributions for the
inter arrival times
1- e- λit where i = 1, 2, …, n
into one single process, then the result is a Poisson process
for which the inter arrival times have the distribution 1- e -t
with mean
= 1 + 2 +..+ n..
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 30
Basic Queuing Systems
What is queuing theory?
Queuing theory is the study of queues (sometimes
called waiting lines).
Can be used to describe real world queues, or more
abstract queues, found in many branches of computer
science, such as operating systems.
Basic queuing theory
Queuing theory is divided into 3 main sections:
Traffic flow
Scheduling
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 31
Kendall’s Notation
D.G. Kendall in 1951 proposed a standard
notation for classifying queuing systems into
different types. Accordingly the systems were
described by the notation A/B/C/D/E where:
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 32
Kendall’s notation
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 33
Little’s Law
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 34
Markov Process
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 35
Birth-Death Process
Special type of Markov process
Often used to model a population (or, no. of jobs in
a queue).
If, at some time, the population has n entities (n
jobs in a queue), then birth of another entity (arrival
of another job) causes the state to change to n+1.
On the other hand, a death (a job removed from the
the queue for service) would cause the state to
change to n-1.
Any state transitions can be made only to one of the
two neighboring states.
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 36
State Transition Diagram
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 37
M/M/1/ or M/M/1 Queuing System
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 38
Queuing Model and State Transition Diagram
Queue Server
0 1 2 …… i-1 i i+1 …
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 39
Equilibrium State Equations
If mean arrival rate is and mean service rate is ,
i = 0, 1, 2.. be the number of customers in the
system and P(i) be the state probability of the
system having i customers.
From the state transition diagram, the equilibrium state
equations are given by
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 40
Traffic Intensity
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 41
Queuing System Metrics
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 42
Queuing System Metrics
The average queuing length is
2 2
Lq (i 1) P(i )
i 1 1 ( )
Lq 2
Wq
(1 ) ( )
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 43
M/M/S/ Queuing Model
S
.
. S
2
Queue
1
Servers
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 44
State Transition Diagram
0 1 2 …… S-1 S S+1 …
2 3 (S-1) S S S
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 45
Queuing System Metrics
The average number of customers in the system is
S P (0)
Ls iP (i )
i 0 S ! (1 ) 2
S P ( 0)
LS 1
WS
S .S!(1 ) 2
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 46
Queuing System Metrics
The average queue length is
S 1
P ( 0)
Lq (i S ) P (i )
i s ( S 1)! ( S ) 2
S P (0)
Lq
Wq
S .S!(1 ) 2
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 47
M/G/1/ Queuing Model
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 48
Basic Queuing Model
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 49
Queuing System Metrics
The average number of jobs in the system, in the steady state is
2 E[ B 2 ]
E[ N ]
2(1 )
The average dwell time of customers in the system is
E[ N ] 1 E[ B 2 ]
Ws
2(1 )
The average waiting time of customers in the queue is
E[ N ] Wq
Average waiting time of customers in the queue is
E[ B 2 ]
Wq
2(1 )
The average queue length is
2 E[ B 2 ]
Lq
2(1 )
Copyright © 2002, Dr. Dharma P. Agrawal and Dr. Qing-An Zeng. All rights reserved. 50