Itroductio to probability Stochastic Process Queuig systems TELE4642: Week2
Overview Refresher: Probability theory Termiology, defiitio Coditioal probability, idepedece Radom variables ad distributios Cotiuous r.v.: Expoetial Discrete r.v.: Poisso Momets ad momet geeratig fuctios Network Performace 2-2
Why formal models of performace? Why ot just use commo sese or ituitio? ca mislead may ot scale Stochastic theory more broadly applicable i the world: Games: aciet Greeks to moder poker Boltzma / Maxwell: thermodyamic etropy Quatum mechaics: everythig is ucertai! Shao: iformatio theory Erlag: telephoe switch capacity Questios pertiet to the Iteret: How to uatify ed-to-ed loss ad delay for Iteret traffic? How big should router buffers be? How may voice calls ca be admitted? How to tue commuicatio protocol parameters? How to exploit Iteret topology structure? How to make moey? Akamai ad Google did J Network Performace 2-3
Probability: termiology A radom experimet is a experimet for which the result is ot kow a priori E.g.: How may heads will occur i 10 flips of a fair coi? A possible outcome is a sample poit The sample space S is the set of all sample poits, i.e., the set of all possible outcomes There are 2 10 = 1024 differet outcomes of flippig a coi 10 times A simplified sample space with 11 outcomes (0 to 10 occurreces of heads) is valid for our experimet A evet A is a subset of S For example, we could defie the evet that there are 5 heads ; a odd umber of heads ; 7 or more heads, etc Network Performace 2-4
Probability: defiitio A probability measure defied o S is a fuctio that associates to each possible evet A a real umber P(A) such that: ( i ) 0 ( ii ) P ( iii ) P ( P ( A) ( S ) = 1 1! Ai ) = å i = 1 i = 1 P ( A i ) if A i ' s mutually exclusive Network Performace 2-5
Coditioal Probability 2-6 The coditioal probability of evet A give that evet B has occurred, deoted by P(A B), is defied as Q: A coi is tossed twice. What is the probability that both tosses were heads give that at least oe toss was heads? Bayes theorem: Give a partitio {G 1, G 2, } ad evet E Refiig a hypothesis based o additioal evidece ) ( ) ( ) ( B P B A ad P B A P = å = j j j i i i G P G E P G P G E P E G P ) ( ) ( ) ( ) ( ) ( Network Performace
Applicatio of Bayes Theorem Imagie you are a cotestat i a game-show. The host shows you three boxes, oe of which has treasure iside, ad asks you to pick oe. Say you pick box 1. He ow opes box 2 ad shows that the treasure is ot iside that box. He ow asks if you wat to chage your mid. Should you chage to box 3 or stay with box 1 to maximize your chaces of wiig? G i : treasure is i box-i E: you pick box 1 ad the host opes box 2 P(G 1 ) = P(G 2 ) = P(G 3 ) = 1/3 P(E G 1 ) = ½; P(E G 2 ) = 0; P(E G 3 ) = 1 Apply Bayes theorem to determie P(G 1 E) ad P(G 3 E) Network Performace 2-7
Idepedet evets Two evets are statistically idepedet iff P(A B) = P(A) ad P(B A) = P(B) Q: Two fair dice are throw simultaeously. Let A be the evet that the first die shows a 6 ad B the evet that the sum of the dice is 9. Are A ad B idepedet? What if B deotes the evet that the sum is 7? Network Performace 2-8
Radom Variables A radom variable X maps each outcome s i the sample space S to a real umber X(s) A radom variable is thus a measuremet of a experimet Network Performace 2-9
Cotiuous radom variables Ca take o a ucoutably ifiite umber of distict values Example: time betwee packet arrivals Cumulative distributio fuctio (cdf): F ( x) = P( X x) Probability desity fuctio (pdf): f ( x) = df ( x) / dx F ( x) = x f ( y) dy ò - Network Performace 2-10
Example: expoetial r.v. pdf: cdf: f(x) - µx f ( x) = µ e, x ³ 0 F - µ x ( x) = 1 - e pdf x Most commoly used cotiuous r.v. Models: Time elapsed sice arrival of task at a computer system Time betwee arrivals of buses at a bus-stop Time betwee arrivals of packets/coectios at a etwork switch Network Performace 2-11
Expoetial r.v.: memoryless property Memoryless: future is idepedet of the past! Mathematically:! " > $ + & " > &) =! " > $, $, & > 0 Proof:! " > $ + & " > &) =! " > $ + &,-. " > & /!(" > &) =! " > $ + & /!(" > &) = e e - µ ( s+ t ) - µ t = 1 234 =!(" > $) Network Performace 2-12
Exercise: Geerate Expoetial r.v. Usig a uiformly distributed radom variable i the iterval [0,1) (such as geerated by the rad() ad drad48() fuctios), how would you geerate a expoetial radom variable with parameter!? Method: Euate cdf of the two distributios Aswer: y = -l(1-x)/! where x is uiformly distributed i [0,1) ad y is expoetial with parameter!. Network Performace 2-13
Discrete radom variables Ca take o a fiite or coutably ifiite umber of values Example: umber of packet arrivals i a 1-hour iterval p ( x) = P[ X = x] Probability mass fuctio (pmf): F ( x) = å y x p( y) Cumulative distributio fuctio (cdf): Network Performace 2-14
Example: Beroulli ad Biomial r.v. Beroulli r.v.: P[X=1] = p ad P[X=0] = Coi toss (biased coi) where 1 deotes head ad 0 tail Biomial r.v.: sum of Beroulli radom variables Number of heads i coi tosses P[ X = i] = æö ç è i ø p i -i Network Performace 2-15
Mea / Momets The mea (or expected value or expectatio or first momet) of a cotiuous r.v. is E [ X ] = xf ( x) dx ò - Example: mea of expoetial r.v. is 1/µ The mea of a discrete r.v. is E [ X ] = å " kp( X = k) k Example: mea of biomial r.v. is p Secod, -th momets Variace, stadard deviatio Network Performace 2-16
Stochastic Process
Stochastic Processes A stochastic process (or radom process) is a family of radom variables {X(t): t Î T} idexed by parameter t over idex set T The typical iterpretatio is that T is the time dimesio ad r.v. X is a fuctio of time Cotiuous-time versus discrete-time The r.v. takes ew values some poit of time i cotiuous versus discrete space Cotiuous-value versus discrete-value The r.v. takes o cotiuous versus discrete values We will oly study statioary processes, i.e. those i euilibrium Network Performace 2-18
Markov Process A stochastic process havig the Markov property: P ( X s+ t = j X u = xu; u s) = P( X s+ t = j X s = xs) Sample path followed by the process after ay time t depeds oly o the state X t existig at that time, ad ot o past history We cosider: cotiuous-time, discrete-value Importat Markov process: Poisso process Simplest, mathematically well-behaved example of a Markov process It is a coutig process for the umber of radomly occurrig poitevets observed i a give iterval of time, e.g. Tasks arrivig at a processor Messages arrivig to a etwork Customers arrivig at a supermarket checkout Radioactive particles from a source Network Performace 2-19
Poisso Process: Defiitio Let the r.v. N(t,t) deote umber of arrivals i (t,t] Let o(h) deotes a expressio f(h) such that A Poisso process {N(0,t)}, t 0, with rate l is such that: 1. P[N(t,t+h)=0] = 1 - lh + o(h) 2. P[N(t,t+h)=1] = lh + o(h) 3. P[N(t,t+h)=2] = o(h) 4. N(0,t) ad N(t,t+h) are idepedet for all t, h > 0 Every small iterval has eual likelihood of arrival occurrece Arrivals are thus completely radom i time Time-homogeeity property: for all t: P[N(t, t+t)] = P[N(0,t)] = P[N(t)] Network Performace 2-20
Poisso Process: pmf Claim: The umber of arrivals N(t) i ay iterval of legth t is a Poisso r.v. with parameter lt: -lt k P[ N( t) = k] = e ( lt) k! Claim: Mea umber of arrivals i ay iterval of legth t: E[ N( t)] = å k= 0 kp[ N( t) = k] = lt Claim: Poisso is a limitig approximatio of biomial (λt = p) : i æö ( lt) Claim: Iter-arrival time (i.e. time betwee successive arrivals) is a expoetial r.v. with parameter l [Proof?] Ø Ø lim i -i ç p (1 - p) = e èi ø Time to first arrival is expoetial Time to ext arrival is expoetial -lt i! Network Performace 2-21
Poisso Process: Superpositio If k idepedet Poisso processes A 1,..., A k, with rates l 1,..., l k, are merged ito a sigle process, A = A 1 + + A k,, the combied process A is Poisso with rate l = l 1 + + l k l 2 l 1... l k + l Network Performace 2-22
Poisso Process: Decompositio If a Poisso process (with rate l) is split ito k other processes by idepedetly assigig each arrival to the ith process with probability p i, where p 1 +... + p k = 1, the resultig k processes are each Poisso with rate p i l for the ith process l p 1 l p 2 l... p k l Network Performace 2-23
Queuig systems
Queuig Systems Notatio Server System parameters: arrival process, service time, service capacity, waitig room Iput Queue Output Kedall otatio: a/b/c a: iter-arrival time distributio (M: memoryless, G: geeral) b: service time distributio (D: determiistic) c: umber of servers Extra letter ca deote waitig room capacity E.g.: M/M/1, M/M/c, M/G/1, M/D/1, M/M/1/K, Performace measures: wait time, sojour time, umber i ueue, work i system, Network Performace 2-25
PASTA: Radom Observer Property I ay ueueig system with Poisso arrivals: Probability that a radom arrivig customer fids the system i state A is exactly idetical to the probability that the system is i state A. PASTA (Poisso Arrivals See Time Averages) property This does ot hold for arbitrary systems, e.g. cosider a system where customers arrive at time 1, 3, 5,, each reuirig oe uit time of service, ad the system starts idle at time 0. Each arrival fid the system empty, but probability of empty system is 0.5 Network Performace 2-26
Little s Result The mea umber of customers i the system euals the product of the arrival rate ad the mea sojour time i the system E E[ ] N = le[ t ] = l T Ca be applied to sub-systems: Ø Ø Queue: Server: [ ] = le[ t ] r le[ t ] = l / µ = s The server utilisatio ρ deotes mea umber of customers at the server, which is the same as the fractio of time the server is workig Network Performace 2-27