Title: Queuing
1Queuing
2Problem Solving for performance evaluation
- Analysis use mathematical model to solve
usually need assumption to make it easy to
solve - Can have full domain of solution, I.e. optimal
solution - Simulation more realistic assumption
heuristic solution - Analysis used to be the main research area, now
simulation is a popular method, but
3Queuing examples
- Customer service
- Bank, post office , number of clerks vs. waiting
time , service time - Computer servers and jobs (requests)
- Traffic flow on freeway or computer networks.
- Why probability ?
- Because everything is unpredictable. We use
mean , variance to be the metrics.
4Sampling of Problems
- Resource Scheduling
- Demands
- Unpredictable arrivals
- Unpredictable service demands
- Everybody wants immediate service
- Conflict resolution
- Waiting
- Loss
- sharing
Demand
Resource
5Single Resource with waiting (queuing)
Arrivals
departures
queue
server
- Assume
- Arrival
- Each service take
- Service
6Single Resource with waiting (queuing)
- Def
- IF constant inter-arrival times AND constant
service times. - IF random inter-arrival times AND random service
times.
7Sampling of Problems
- Every disk access is equally likely to be to any
cylinder on the disk - What is the average distance (in cylinders) of a
seek ? - Expected execution
- time variance?
start
t1
yes
branch
no
0.25
exit
t2
0.75
t3
8Sampling of Problems
- fi fraction time link i is down at a random
time , what is the prob. That there is - Cherry GOES DOWN TWICE A WEEK. Whats the prob.
You lost your term report ?
9Probability
- Random experiment.
- Real world experiment.
- outcome not predictable.
- Associated with a random experiment.
- Set of all possible outcomes.
- Mutually exclusive and exhaustive.
- Events
- Event occurs or does not occur for each outcome.
- Defines a subset of outcomes.
10Probability
- Independent trials
- If outcome of any trial does not affect the
outcome of any other trial - If trials are performed under identical
conditions.
11Probability
- Statistical regularity
- n independent trials.
- Def likelihood differing
(????????)
12Probability
- Sample space set of all possible outcomes of a
random experiment Not required, but often deal
with equally probable outcomes. - Suppose event A occurs iff
- Oi1 or Oi2 or Oij occurs
13Probability
14Probability
- Counting Things Combinations
- Product rule
- Let A1 be a set containing n1 objects,
- A2 be a set containing n2 objects.
- The number of ordered pairs
- (a1, a2) s.t
- is n1n2
- Generalizes to
- r sets A1,A2,Ar of cordinalistics n1,n2,...,nr
- Number of distinct r-tuples with i-th componemt
an object from Ai is n1n2n3nr
15Probability
- Some fundamental cases
- Ways of selecting r out of n objects
- Two dimensions
- Ordered or unordered samples. (sequence v.s. a
set) - With or without replacement. (whether can repeat
an object) - Ordered sampling with replacement.
- The number of ways of selecting r objects in
succession from a set of n objects, where each
object is returned prior to the next selection is
nr
16Probability
- Ordered sampling without replacement
- The number of ways of selecting r objects in
succession from a set of n objects (r n) where
each object selected is removed from the set
prior to the next selection is, n(n-1)(n-r1)
n!/(n-r)! - Sampling without replacement and without regard
for order - The number of ways of selection r objects from a
set of n objects without replacement without
regard for order is
17Probability
- Sampling with replacement and without regard for
order - r out of n
- Ans
18Probability
- Probability Axioms
- Let S be a sample space of a random experiment
- Axioms
- (A1) for any event A,
- (A2) P(S) 1
- (A3)
- It follows easily that (n finite)
- if Ai are
mutually exclusive -
19Probability
- (A3) For any countable sequence of events
A1,A2,...,An,,that are mutually exclusive.? - (i.e. )
-
20Some implications of the Axioms
21Principles of inclusion exclusion
- If A1,A2,,An are any events then
-
Proof by induction on the number of events n
(recitation) Related result in combinatoric S
22Conditional Probability
- Probability that event A has occurred given that
B has occurred , notation P(AB) - Def
Generalization
23Independent Events
- Def Events A B are said to be independent iff
- In words, given that B occurred, given no
information about the probability that A
occurred. - Note If P(AB)P(A),that
- i.e. symmetric
24Independent Events
- Alternative Def
- follows from first def
- but if P(AB)P(A)
- then P(A)P(B) P(A?B)
-
25Independent Events
- Ex
- Piprob. of introducing an error, assume that n
msg arrives in error - P(msg arrives with error)?
- Let Eievent that link I introduces an error
- P(msg arrives with error)
- assume are independent. are
indep. ?? - gt P(msg arrives with error)
Generalized
26Some random properties
- If
- If A B are independent
- And BC are independent
- AC are independent
Ex B 1, 2, 3, 4 A 1, 3, 5
C 2, 4, 6
27Independence of a set of events
- Def A list of n events A1,A2,,An is said to be
mutually indep. iff for each set of k (2 k n)
distinct indices i1,i2,,Ik - pairwise indep. mutually indep.
Note duality mutually exclusive
mutually indep
28- Ex N blocks in a file.
- n accesses, uniformly distributed.
- What is the prob. That the first block
- is accessed at least once ?
- P1st block accessed
- ways to make the n accesses Nn
- ways with 0 accesses to 1st block (N-1)n
- ways with gt0 accesses to 1st block Nn- (N-1)n
- ?
29- Let Ei event that the first block is accessed
on i-th access - P1st block accessed at least once
30Bayes Rule
- In general
- Let B1, , Bn be mutually exclusive and
exhaustive events. - Let A be any event.
Bi exhaustive
Mutually exclusive
31- Ex Drawers
- G G
- G S
- Select a drawer at random
- reach in and take a coin without looking.
- The coin is gold, what is the prob that drawer 1
was chosen ? - Find P(drawer1gold)?
- P(drawer1)p(drawer2)1/2
- P(golddrawer1)1
- P(golddrawer2)1/2
-
-
32Chap 2 Discrete Random Variable
- Def A random variable X on a sample space S is a
function - X S?R from S to the reals
- Numbers often are naturally associated with
sample space outcomes. - e.g. face value on a die
- But not always
- e.g what if the die had colors
33Probability mass function
-
- Def Px(x)P(Xx)
- is also called the density function for X
- (Cumulative) Distribution function
-
3/36
1/36
2
3
4
34- Ex Bruin rot
- 1/10000 of having to disease Medical test.
- Two possibilities P (positive) or N (negative)
- PPBR0.99
- PPNBR0.01
- Henry gets a test result is positive.
- PBRP
35Particular Cases
36Particular Cases
- Experiments with two outcomes, repeat some number
of this n, There are 2n possible sequences of
length n for outcomes of the experiments. - Call the outcomes success and failure
- Letfor any single experiment
- P(success)p
- P(failure)1-pq
- Consider a sequence of length n
- ?????
37Particular Cases
38Particular Cases
39Geometric r.v Z
- (An) Interpretation
- Number of Bernoulli trials until a success is
obtained sample space is infinite - All sequences of some number of 0s followed by a
1 or fff.f s - PZ(i)qi-1p , I gt 1
40Geometric r.v Z
- Distribution function
- Fz(t)P(Zltt)
- ?????,???
41Geometric r.v Z
42Poisson Pmf
???????
43(No Transcript)
44Probability Generating Function (Z transform)
- Transformation
- Will simplify many calculations later. (non
negative integer valued r.v.)
45Probability Generating Function (Z transform)
46(No Transcript)
47Probability Generating Function (Z transform)
48Some transforms
???????
49(No Transcript)
50Some transforms
51Linear recurrence relation
???
52Linear recurrence relation
53(No Transcript)
54Review
55Review
????
???????
56Z-transform
- Fn n0,1,2,3
- Define
- Property 1
- Property 2
57Z-transform
???
58Z-transform
??????,????
59Z-transform kleinrock Appendix I
60Z-transform
Last 4 are special cases of the following
61Z-transform
p.335
62(No Transcript)
63Discrete random vectors
- Multivariate distributions
???
64Discrete random vectors
- What is the condition pmf
65Continuous r.v
???? nondecreasing
66Application to simulation
- How to generate a r.v. with desired FX(x)
- ? generate a uniformly distributed r.v. y
- Then x0FX-1(y0) got it
- Nonnegative r.v
???????
67Exponential distribution
- Service time at a resource (server)
- Distribution of time between arivals
F(x)
x
68Exponential distribution
Fx(x)
x
t
Remaining life distribution
69Exponential distribution
70Poisson distribution of exponential distribution
- Poisson distribution was for the xxxxxxx of
events in an interval of length t - where
71Poisson distribution of exponential distribution
- Exponential interarrival
- Poisson arrival process ? memoryless property ?
exponential interarrival times - What is the memoryless property important ?
- Real answer must wait but intuitively.
Arrival process
departures
72Expectation
- Def of expectation
- X a random variable
- Moments
73Expectation
74Expectation
- Expectation is a linear operation
- Variance Xi are mutually
indep.
75Expectation
- Expectation of functions of more than one random
variable
a
0
current request
Next request
x2
x1
76Conditional Distribution and Conditional
Expectation
- Conditional Probabilities
? Marginal pmf
77Conditional Distribution and Conditional
Expectation
??????
??????
???
78Conditional Distribution and Conditional
Expectation
????? example ??????,????
79(No Transcript)
80(No Transcript)
81Conditional Expectation
82Conditional Expectation
If U1 then V0 If U0 then V has same pmf as X
1EX
83Example
84Jobs arrivals
?exeuction time
Repair time
time
85(No Transcript)
86(No Transcript)
87Laplace Transforms
88(No Transcript)
89Some properties
90(No Transcript)
91Laplace transform pairs
92(No Transcript)
93(No Transcript)
94(No Transcript)
95(No Transcript)
96Why we need transforms ?
- Ex Random sum of random variables
(continuous)
z-transform
97(No Transcript)
98Inversion of Laplace transforms
- Explicit inversion formula -- we wont use
- Inspection using table
- Partial fraction expansion
99(No Transcript)
100(No Transcript)
101Random Sum of random variables
102(No Transcript)
103(No Transcript)
104(No Transcript)
105(No Transcript)
106Last-come-first-serve
107(No Transcript)
108Review of Probability
109(No Transcript)
110(No Transcript)