Queuing - PowerPoint PPT Presentation

About This Presentation
Title:

Queuing

Description:

Title: 1 Author: Aiwa Last modified by: user Created Date: 9/7/2002 6:27:21 AM Document presentation format: Company: Emit – PowerPoint PPT presentation

Number of Views:109
Avg rating:3.0/5.0
Slides: 111
Provided by: Aiwa
Category:

less

Transcript and Presenter's Notes

Title: Queuing


1
Queuing
2
Problem 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

3
Queuing 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.

4
Sampling of Problems
  • Resource Scheduling
  • Demands
  • Unpredictable arrivals
  • Unpredictable service demands
  • Everybody wants immediate service
  • Conflict resolution
  • Waiting
  • Loss
  • sharing

Demand
Resource
5
Single Resource with waiting (queuing)
Arrivals
departures
queue
server
  • Assume
  • Arrival
  • Each service take
  • Service

6
Single Resource with waiting (queuing)
  • Def
  • IF constant inter-arrival times AND constant
    service times.
  • IF random inter-arrival times AND random service
    times.

7
Sampling 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
8
Sampling 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 ?

9
Probability
  • 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.

10
Probability
  • Independent trials
  • If outcome of any trial does not affect the
    outcome of any other trial
  • If trials are performed under identical
    conditions.

11
Probability
  • Statistical regularity
  • n independent trials.
  • Def likelihood differing

(????????)
12
Probability
  • 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

13
Probability
  • i.e.

14
Probability
  • 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

15
Probability
  • 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

16
Probability
  • 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

17
Probability
  • Sampling with replacement and without regard for
    order
  • r out of n
  • Ans

18
Probability
  • 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

19
Probability
  • (A3) For any countable sequence of events
    A1,A2,...,An,,that are mutually exclusive.?
  • (i.e. )

20
Some implications of the Axioms

21
Principles 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
22
Conditional Probability
  • Probability that event A has occurred given that
    B has occurred , notation P(AB)
  • Def

Generalization
23
Independent 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

24
Independent Events
  • Alternative Def
  • follows from first def
  • but if P(AB)P(A)
  • then P(A)P(B) P(A?B)

25
Independent 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
26
Some 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
27
Independence 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

30
Bayes 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

32
Chap 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

33
Probability 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

35
Particular Cases
  • Bernoulli

36
Particular 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
  • ?????

37
Particular Cases
  • Consider

38
Particular Cases
  • Generalization

39
Geometric 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

40
Geometric r.v Z
  • Distribution function
  • Fz(t)P(Zltt)
  • ?????,???

41
Geometric r.v Z
42
Poisson Pmf
???????
43
(No Transcript)
44
Probability Generating Function (Z transform)
  • Transformation
  • Will simplify many calculations later. (non
    negative integer valued r.v.)

45
Probability Generating Function (Z transform)
  • An example

46
(No Transcript)
47
Probability Generating Function (Z transform)
  • ??????
  • So

48
Some transforms
  • Bernoulli r.v.x

???????
49
(No Transcript)
50
Some transforms
  • Poisson

51
Linear recurrence relation
???
52
Linear recurrence relation
53
(No Transcript)
54
Review
55
Review
????
???????
56
Z-transform
  • Fn n0,1,2,3
  • Define
  • Property 1
  • Property 2

57
Z-transform
???
58
Z-transform
??????,????
59
Z-transform kleinrock Appendix I
60
Z-transform
Last 4 are special cases of the following
61
Z-transform
p.335
62
(No Transcript)
63
Discrete random vectors
  • Multivariate distributions

???
64
Discrete random vectors
  • What is the condition pmf

65
Continuous r.v
???? nondecreasing
66
Application 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

???????
67
Exponential distribution
  • Service time at a resource (server)
  • Distribution of time between arivals

F(x)
x
68
Exponential distribution
Fx(x)
x
t
Remaining life distribution
69
Exponential distribution
  • Memoryless property

70
Poisson distribution of exponential distribution
  • Poisson distribution was for the xxxxxxx of
    events in an interval of length t
  • where

71
Poisson 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
72
Expectation
  • Def of expectation
  • X a random variable
  • Moments

73
Expectation
74
Expectation
  • Expectation is a linear operation
  • Variance Xi are mutually
    indep.

75
Expectation
  • Expectation of functions of more than one random
    variable

a
0
current request
Next request
x2
x1
76
Conditional Distribution and Conditional
Expectation
  • Conditional Probabilities

? Marginal pmf
77
Conditional Distribution and Conditional
Expectation
  • Continuous r.v.

??????
??????
???
78
Conditional Distribution and Conditional
Expectation
????? example ??????,????
79
(No Transcript)
80
(No Transcript)
81
Conditional Expectation
82
Conditional Expectation
If U1 then V0 If U0 then V has same pmf as X
1EX
83
Example
84
Jobs arrivals

?exeuction time
Repair time
time
85
(No Transcript)
86
(No Transcript)
87
Laplace Transforms
88
(No Transcript)
89
Some properties
90
(No Transcript)
91
Laplace transform pairs
92
(No Transcript)
93
(No Transcript)
94
(No Transcript)
95
(No Transcript)
96
Why we need transforms ?
  • Ex Random sum of random variables

(continuous)
z-transform
97
(No Transcript)
98
Inversion of Laplace transforms
  1. Explicit inversion formula -- we wont use
  2. Inspection using table
  3. Partial fraction expansion

99
(No Transcript)
100
(No Transcript)
101
Random Sum of random variables
102
(No Transcript)
103
(No Transcript)
104
(No Transcript)
105
(No Transcript)
106
Last-come-first-serve
107
(No Transcript)
108
Review of Probability
109
(No Transcript)
110
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com