probability review - college of...

51
Probability Review Thinh Nguyen

Upload: others

Post on 11-Aug-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Probability Review

Thinh Nguyen

Page 2: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Probability Theory Review

Sample spaceBayes’ RuleIndependenceExpectationDistributions

Page 3: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Sample Space - Events

Sample PointThe outcome of a random experiment

Sample Space SThe set of all possible outcomesDiscrete and Continuous

EventsA set of outcomes, thus a subset of SCertain, Impossible and Elementary

Page 4: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Set OperationsUnionIntersectionComplement

PropertiesCommutation

Associativity

Distribution

De Morgan’s Rule

A B∪A B∩

A B∪

CA

CA

A B B A∪ = ∪

( ) ( )A B C A B C∪ ∪ = ∪ ∪

( ) ( ) ( )A B C A B A C∪ ∩ = ∪ ∩ ∪

( )C C CA B A B∪ = ∩

S

A B∩

Page 5: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Axioms and Corollaries

Axioms

If

If A1, A2, … are pairwise exclusive

Corollaries

A B∩ =∅

[ ] [ ] [ ]P A B P A P B∪ = +

[ ]11

k kkk

P A P A∞ ∞

==

⎡ ⎤=⎢ ⎥

⎣ ⎦∑U

[ ]0 P A≤

[ ] 1P S =[ ]1CP A P A⎡ ⎤ = −⎣ ⎦

[ ] 1P A ≤[ ] 0P ∅ =

[ ][ ] [ ] [ ]

P A B

P A P B P A B

∪ =

+ − ∩

Page 6: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Conditional Probability

Conditional Probability of event A given that event B has occurred

If B1, B2,…,Bn a partitionof S, then

(Law of Total Probability)

A B∪

CA

S

A B∩[ ] [ ]

[ ]|

P A BP A B

P B∩

=

B1

B3

B2

A

[ ] [ ] [ ]1 1| ...

| j j

P A P A B P B

P A B P B

= + +

⎡ ⎤ ⎡ ⎤⎣ ⎦ ⎣ ⎦

Page 7: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Bayes’ Rule

If B1, …, Bn a partition of S then

[ ]

[ ] [ ]1

|

|

|

jj

j jn

k kk

P A BP B A

P A

P A B P B

P A B P B=

⎡ ⎤∩⎣ ⎦⎡ ⎤ =⎣ ⎦

⎡ ⎤ ⎡ ⎤⎣ ⎦ ⎣ ⎦=

likelihood priorposteriorevidence

×=

Page 8: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Event Independence

Events A and B are independent if

If two events have non-zero probability and are mutually exclusive, then they cannot be independent

[ ] [ ] [ ]P A B P A P B∩ =

Page 9: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Random Variables

Page 10: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Random Variables

The Notion of a Random Variable

The outcome is not always a numberAssign a numerical value to the outcome of the experiment

DefinitionA function X which assigns a real number X(ζ) to each outcome ζ in the sample space of a random experiment

S

x

Sx

ζ

X(ζ) = x

Page 11: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Cumulative Distribution Function

Defined as the probability of the event {X≤x}

Properties( ) [ ]XF x P X x= ≤

( )0 1XF x≤ ≤

( )lim 1XxF x

→∞=

( )lim 0XxF x

→−∞=

( ) ( )if then X Xa b F a F a< ≤

[ ] ( ) ( )X XP a X b F b F a< ≤ = −

[ ] ( )1 XP X x F x> = −

x

2

1

Fx(x)

¼

½

¾

10 3

1

Fx(x)

x

Page 12: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Types of Random Variables

ContinuousProbability Density Function

DiscreteProbability Mass Function

( ) [ ]X k kP x P X x= =

( ) [ ] ( )X X k kk

F x P x u x x= −∑

( ) ( )XX

dF xf x

dx=

( ) ( )x

X XF x f t dt−∞

= ∫

Page 13: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Probability Density Function

The pdf is computed from

Properties

For discrete r.v.

dx

fX(x)

( ) ( )XX

dF xf x

dx=

[ ] ( )b

XaP a X b f x dx≤ ≤ = ∫

( ) ( )x

X XF x f t dt−∞

= ∫

( )1 Xf t dt+∞

−∞

= ∫

fX(x)

[ ] ( )XP x X x dx f x dx≤ ≤ + =

x

( ) [ ] ( )X X k kk

f x P x x xδ= −∑

Page 14: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Expected Value and Variance

The expected value or mean of X is

Properties

The variance of X is

The standard deviation of X is

Properties

[ ] ( )XE X tf t dt+∞

−∞= ∫

[ ] ( )k X kk

E X x P x=∑

[ ]E c c=

[ ] [ ]E cX cE X=

[ ] [ ]E X c E X c+ = +

[ ] [ ]( )22Var X E X E Xσ ⎡ ⎤= = −⎣ ⎦

[ ] [ ]Std X Var Xσ= =

[ ] 0Var c =

[ ] [ ]2Var cX c Var X=

[ ] [ ]Var X c Var X+ =

Page 15: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Queuing Theory

Page 16: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Example

nnSend a file over the internetSend a file over the internet

packet link

buffer

Modemcard

(fixed rate)

Page 17: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Delay Models

time

place

A

B

Cpr

opag

atio

n

tran

smis

sion

Com

puta

tion

(Que

uing

)

Page 18: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Queue Model

Page 19: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Practical Example

Page 20: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Multiserver queue

Page 21: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Multiple Single-server queues

Page 22: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Standard Deviation impact

Page 23: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Queueing Time

Page 24: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Queuing Theory

The theoretical study of waiting lines, expressed in mathematical terms

input output

queue

server

Delay= queue time +service time

Page 25: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

The ProblemGiven

One or more servers that render the serviceA (possibly infinite) pool of customersSome description of the arrival and service processes.

Describe the dynamics of the system Evaluate its Performance

If there is more than one queue for the server(s), there may also be some policy regarding queue changes for the customers.

Page 26: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Common Assumptions

The queue is FCFS (FIFO). We look at steady state : after the system has started up and things have settled down.

State=a vector indicating the total # of customers in each queue at a particular time instant

(all the information necessary to completely describe the system)

Page 27: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Notation for queuing systems

A = the interarrival time distribution

B = the service time distribution

c = the number of servers

d = the queue size limit

A/B/c/d

M for Markovian (exponential) distribution

D for Deterministic distribution

G for General (arbitrary) distribution

:Where A and B can be

nnomitted if infiniteomitted if infinite

Page 28: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

The M/M/1 System

Poisson Process

output

queue

Exponential server

Page 29: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Arrivals follow a Poisson process

a(t) = # of arrivals in time interval [0,t]

λ = mean arrival ratet = kδ ; k = 0,1,…. ; δ→0

Pr(exactly 1 arrival in [t,t+δ]) = λδPr(no arrivals in [t,t+δ]) = 1-λδPr(more than 1 arrival in [t,t+δ]) = 0

Pr(a(t) = n) = e-λ t (λ t)n/n!

nnReadily amenable for analysisReadily amenable for analysisnnReasonable for a wide variety of situations Reasonable for a wide variety of situations

Page 30: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Model for Interarrivals and Service times

• Customers arrive at times t0 < t1 < .... - Poisson distributed• The differences between consecutive arrivals are the

interarrival times : τn = tn - t n-1

• τn in Poisson process with mean arrival rate λ, are exponentially distributed,

Pr(τn ≤ t) = 1 - e-λ t

Service times are exponentially distributed, with mean

service rate µ:

Pr(Sn ≤ s) = 1 - e-µs

Page 31: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

System Features

Service times are independentservice times are independent of the arrivals

Both inter-arrival and service times are memoryless

Pr(Tn > t0+t | Tn> t0) = Pr(Tn ≥ t) future events depend only on the present state

→ This is a Markovian System

Page 32: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Exponential Distribution

given an arrival at time x

|

Same as probability starting at time = 0

P x t x P x x tP x

P x t P xP x

e eP x

e ee

e ee

x t x

x t x

x

x t

x

(( ) ) ( ( ))( )

( ( )) ( )( )

( ) ( )( )

( )( )

( )

( )

τ τ ττ

τ ττ τ

λ λ

λ λ

λ

λ λ

λ

− < > =< < +

>

=< + − <

>=

− − −− <

=− +− −

=−

− + −

− + −

− −

1 11

1 11

Page 33: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Markov Models

BufferOccupancy

t t∆

• n+1

• n

• n-1

• n

departure

arrival

Page 34: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Probability of being in state n

P t t P t t t t tP t t tP t t t

t

P t t P t dP tdt

t

n n

n

n

n nn

( ) ( )[( )( ) ]( )[( )( )]( )[( )( )]

,

( ) ( ) ( )

+ = − − ++ −+ −

+ = +

+

∆ ∆ ∆ ∆ ∆∆ ∆∆ ∆

∆ ∆

1 111

0

1

1

µ λ µ λµ λλ µ

as Taylor series

Page 35: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Steady State Analysis

Substituting for

Steady stateP0

P t tP P P

P

n

n n n

( )( )

++ = +

=

+ −

∆λ µ µ λ

λ µ

1 1

1

Page 36: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Markov Chains

0 1 ... n-1 n n+1

λ λ λ

µ µ µRate leaving n =Rate arriving n = Steady State State 0

PP P

P P PP P

n

n n

n n n

( )

( )

λ µλ µ

λ µ λ µλ µ

++

+ = +=

− +

− +

1 1

1 1

0 1

Page 37: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Substituting Utilization

P P P

P P P

P P P P P P

1 0 0

2 1 0

2 1 1 0 1 01

= =

= + −

= + − = + −

λµ

ρ

µ λ µ λλµ

λµ

ρ ρ

( )

( )

Page 38: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Substituting P1

P P PP P P P

P Pnn

2 0 02

0 0 02

0

0

1= + −

= + − =

=

ρ ρ ρ

ρ ρ ρ ρ

ρ

( )

• Higher states have decreasing probability• Higher utilization causes higher probability

of higher states

Page 39: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

What about P0

P P P P

P P

P

nn

n

n

n

n

nn

=

=

=

∑ = = ∑ = ∑ =−

=−

→ = −

= −

0 00 0

0

0

00

11

11

1

1

ρ ρρ

ρρ

ρ ρ( )

Queue determined by ρλµ

=

Page 40: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

E(n), Average Queue Size

ρρ

ρρρρ

-1=

)1()1()(000∑∑∑∞

=

=

=

−=−===n

n

n

n

nn nnnPnEq

Page 41: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Selecting Buffers

E(N) ρ1/3 .251 .53 .759 .9

For large utilization, buffers grow exponentially

Page 42: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Throughput

Throughput=utilization/service time = ρ/Ts

For ρ=.5 and Ts=1ms

Throughput is 500 packets/sec

Page 43: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Intuition on Little’s Law

If a typical customer spends T time units, on the overage, in the system, then the number of customers left behind by that typical customer is equal to

qTq λ=

Page 44: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Applying Little’s Law

)1()1(/

)1()( so 1

1)1(

1)1(

)()(

or or )()(Delay Average M/M/1

ρρλµλ

ρλρ

µ

λµρµρλρ

λ

λλλ

−=

−=

−==

−=

−=

−==

===

ss

qw

TTET

nETE

TqTwTEnE

Page 45: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Probability of Overflow

P n N pnn N

n

n N

N( ) ( )> = ∑ = − ∑ == +

= +

∞+

1 1

11 ρ ρ ρ

Page 46: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Buffer with N Packets

1 with )1(1

)1(1

)1( and 1

1

111

1+N1

110

1

00

00

<<−=−−

=

−−

=−−

=

⎥⎦

⎤⎢⎣

⎡−

−===

+

++

+

==∑∑

ρρρρρρ

ρρρ

ρρ

ρρρ

NN

N

N

N

n

nN

NN

n

nN

nn

p

pp

ppp

Page 47: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

ExampleGiven

Arrival rate of 1000 packets/secService rate of 1100 packets/sec

Find Utilization

Probability of having 4 packets in the queue

ρ λµ

= = =10001100

0 91.

PP P P P

44

1 2 3 5

1 062082 075 068 056

= − == = = =

( ) .. , . , . , .

ρ ρ

Page 48: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Example

04,.05,.05,.06,.07,.07,.08,.09,.09,.10,.11.

0411

yprobabilit loss cell buffers fixed 12With 28.)12(

buffers infiniteWith

99.91

)(

112

12

12

112

=

=−−

=

==>

=−

=

+

+

nP

.)(P

nP

nE

ρρρ

ρ

ρρ

Page 49: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Application to Statistcal Multiplexing

Consider one transmission line with rate R.Time-division Multiplexing

Divide the capacity of the transmitter into N channels, each with rate R/N.

Statistical MultiplexingBuffering the packets coming from N streams into a single buffer and transmitting them one at a time.

R/N

R/NR/N

R

λµ −=

1T

NT

NNT =

−=

λµ1'

Page 50: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

Network of M/M/1 Queues

1µ1γ 2µ

3γ3µ4γ

211 γγλ += 3212 γγγλ ++= 313 γγλ +=

ii

iiL

λµλ−

= 321 LLLL ++= 321 γγγγ ++=

∑= −

=J

i ii

iT1

1λµ

λγ

Page 51: Probability Review - College of Engineeringweb.engr.oregonstate.edu/~thinhq/teaching/ece466/winter07/Queuing_Theory.pdf2 ρ λ − = E S E Q At a given time t, the customers pay at

M/G/1 Queue

Q S0

S

2

2SSQ +

Assume that every customer in the queue pays at rate R when his or her remaining service time is equal to R.

Time Queuing:Time Service :

QS

Total cost paid by a customer:

Expected cost paid by each customer:2

][][ 2SEQEC +=µ

⎟⎟⎠

⎞⎜⎜⎝

⎛+==

2][][][

2SEQECQEµ

λλ

)1(2][][

2

ρλ

−=

SEQE

At a given time t, the customers pay at a rate equal to the sum of the remaining service times of all the customer in the queue. The queue begin first come-first served, this sum is equal to the queueing time of a customer who would enter the queue at time t.

µ1][ += QET

The customers pat at rate since each customer pays on the average and customers go through the queue per unit time.

CλC λ