prob review
DESCRIPTION
Probability reviewTRANSCRIPT
ECE/CSC 570
Probability Theory Review
Do Young Eun ECE/CSC 570, Fall 2014
Why Probability ?
Extensive use in modeling network traffic Area of mathematics most fundamentally related to
computer networking Leads on to more powerful analysis tools and modeling
paradigms Markov chains Queueing theory, etc.
Deterministic approach is infeasible! You can’t rely on simulations/test-bed for every possible
scenarios We need insight, to be able to predict, optimize system in a
systematic way
Do Young Eun ECE/CSC 570, Fall 2014
Probability and Random Variables Sample space : A set of all possible outcomes (or
sample points) of an experiment
Event: a subset of , denoted as A, B, C, etc.
Random variable : a function of the outcome in a sample space, i.e.,
Probability: A measure of possibility an event of the sample space happened
Probability Axiom
Do Young Eun ECE/CSC 570, Fall 2014
More on Probability
Example: roll a dice = {1,2,3,4,5,6} Event: {2,4,6}, {1,5},
Random variable: e.g., x = 0 if it is even and =1 if odd.
E.g., X(k) = k2 square of the values
Probability: set function (mapping) from an event to [0,1]
Some properties of probability
If A B, then P(A) ≤ P(B) P(A B) ≤ P(A) + P(B)
Do Young Eun ECE/CSC 570, Fall 2014
Discrete Random Variables Discrete sample space, i.e., countable set: finite or
(countable) infinite outcomes Finite sample space – Roulette wheel
Total N slots, each slot is marked with a label picked up from (There are Ni slots marked with label xi
12
43
1
4Now spin the wheel.
X is a r.v. that records the outcome of the spin test. Probability pi that xi appears:
Do Young Eun ECE/CSC 570, Fall 2014
Infinite sample space Count the number of telephone calls Y arrived at a server in time
interval [0,1] Repeating the experiment many times.
We have (check!)
Y is called a Poisson r.v. with parameter
Do Young Eun ECE/CSC 570, Fall 2014
Continuous Random Variables
Example: Exponentially distributed random variable Xwith rate > 0 :
Probability distribution function of X : Properties:F(t) is non-decreasing in t, F() = 1
Probability density function (pdf) of X: Properties:
Do Young Eun ECE/CSC 570, Fall 2014
An event A occurs given that event B has occurred
Examples:1. Roulette Wheel Example
B={1, 2, 3}, A= {1,4}
0)P(for )(P
)(P)|(P
BB
BABA
A B
A and B
41
}{P}{P}|{P
321
1
NNN
NBX
BAXBXAX
ee
YYYYYY
1
}0{P1}1{P
0}P{Y}0 and 1{P}0|1{P
2. Let Y be a Poisson r.v.
Conditional Probability
Do Young Eun ECE/CSC 570, Fall 2014
3. Let X be the lifetime of a communication link that is exponentially distributed with rate , we want to estimate its probability that it will survive for at least ‘t’ more seconds, given that has been alive for ‘a’ seconds.
}{P___________________ ___________________
}|{P
tX
aXtaX
Note: This property is called memoryless, namely,
0
}P{}|{P tXaXtaX
Conditional Probability (cont’d)
Do Young Eun ECE/CSC 570, Fall 2014
Theorem of Total Probability
Let Bi be a partition of , i.e., Bi’s are disjoint and
1B2B
3B 4B
1BA
Do Young Eun ECE/CSC 570, Fall 2014
Bayes’ Theorem Let {Ei, i=1,2, …, N} be a partition of Then:
Updates prob. assigned to Ei in light of occurrence of F F is regarded as new evidence Widely used in inference systems
Do Young Eun ECE/CSC 570, Fall 2014
Example 3 coins are given: two of them are “fair”, one of them is
biased (P{H}=2/3, P{T}=1/3) We don’t know which one is biased; they all look the same Flip three coins in a row and we have observed
The first and second coins both show “heads”, while the third one shows “tail”
Class Exercise: Given the observation, P {the first coin is the biased one} = ?
Further question: flip one more (any of three) costs $1; pick the biased one you earn $2. Do you want to continue?
Do Young Eun ECE/CSC 570, Fall 2014
Another example: Monty Hall problem 3 doors; only one of them leads to prize; the other two have “goats”
(or no prize). You choose one of three, and the other (Monty Hall) open one of the
other two (unselected) and show that there is a goat. Monty asks you: “Do you want to stay on your choice or switch to the
other unopened door?”
Do Young Eun ECE/CSC 570, Fall 2014
Moments of an RV
The CDF (or PDF) provides complete info. about a r.v. X determines probability of any event involving r.v. X
Often, we need/want a lot less info about an experiment: We are not interested in all possible events.
We cannot provide/digest so much information
Instead, some partial information is OK
Moments of the PDF provide useful partial info.
Do Young Eun ECE/CSC 570, Fall 2014
Expected Value
E{X} denotes the expected value (average) of RV X: Definition:
discrete RV:
continuous RV:
Expected value of X is the sum of the values of X weighted by their probabilities
If Y = g(X):
discrete RV:
continuous RV:
Do Young Eun ECE/CSC 570, Fall 2014
Higher Moments
E{Xn} denotes the n-th moment of RV X:
Definition: discrete RV:
continuous RV:
First moment: expected value E{X}
Second moment: E{X2}
So on…
Do Young Eun ECE/CSC 570, Fall 2014
Variance
X2 or Var{X} denote the variance of RV X
Definition: X2 = E{(X-E{X})2}
the second moment around the mean
measure of the spread of X around its mean
extremely important, widely used in statistics
X2 = E{X2} – E2{X}
Standard deviation, X: defined as same dimension (units) as the mean E{X}
more realistic measure of the spread of X
Do Young Eun ECE/CSC 570, Fall 2014
Example
A r.v. X is geometrically distributed with parameter p (0,1)
Check if
pppnppn
pnpnpnpn
ppnpn
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
n
nn
11
)1(
)1( E{X}
0000
1011
1
1
1
1
Do Young Eun ECE/CSC 570, Fall 2014
Example (2)
Exponentially distributed RV X with rate
E{X} = ? Var{X} = ?
Poisson r.v. X with rate E{X} ? E{X2}=?
Do Young Eun ECE/CSC 570, Fall 2014
Independence of events Two events A and B are said to be independent if and
only if P(A|B) = P(A). Occurrence of B tells us nothing about occurrence of A
We have
If A and B are independent,
Do Young Eun ECE/CSC 570, Fall 2014
Two discrete r.v.s X and Y are independent
Consider two continuous r.v.s X and Y, Joint distribution function of X and Y:
Joint density function:
The two r.v.s X and Y are independent
},{P yYxX
dxdyyYxXdyxYX},{P),(f
2
,
)(P)(P),(P iiii yYxXyYxX
)(f)(f),(f , yxyx YXYX
Independence of random variables
Do Young Eun ECE/CSC 570, Fall 2014
dxdyyxxyXY YX ),(f}{E ,},{E}{E}{E YXXY
Independence of random variables
Independence implies
But, the converse is not true!!
uncorrelated
Example?
Do Young Eun ECE/CSC 570, Fall 2014
Stochastic Dynamic Systems
Dynamic systems: those that evolve in time Must describe the sequence of states a system enters Example: the length of the queue at a router interface
the queue length changes as packets arrive or leave need a model to describe these changes over time
Example: # of packet/call arrivals over time [0, t] Stochastic process: models dynamic systems
combines the concept of RV with the notion of time informally: a vector RV with infinite dimensions
Do Young Eun ECE/CSC 570, Fall 2014
Arrival (or Counting) process
{N(t), t ≥ 0} be a discrete-space, continuous time stochastic process
Definition: {N(t); t ≥ 0} is a counting (or arrival) process if:1. N(0)=02. N(t) is integer valued.3. N(t) is non-decreasing; i.e., if s ≤ t, then N(s) ≤ N(t).4. For s < t, N(t) - N(s) = # of events (or arrivals) in (s,t] (right continuous
property).
N(t)
Timet1 t2 t3
1. N(t) = # of telephone calls arrived in time interval [0,t]
2. N(t) = # of packets generated in time interval [0,t], etc.
Do Young Eun ECE/CSC 570, Fall 2014
“Independent Increments” Property
(s1,t1] and (s2,t2]: two non-overlapping time intervals Y1 = N(t1) – N(s1), Y2 = N(t2) – N(s2): RVs representing # of events in
each interval If arrivals in two intervals are independent, then RVs Y1 and Y2 are
also independent the process has independent increments (very strong property)
t0 s1 s2t1t2
N(t1)-N(s1) N(t2)-N(s2)
Do Young Eun ECE/CSC 570, Fall 2014
“Stationary Increments” Property
Not so strong property: quite popular assumption! For any t, s ≥ 0, the distribution of N(t+s) – N(t) is
independent of t.
Note: N(t+s) – N(t) ≠ N(s) in general: They have the same distribution, but are not equal.
P{N(t+s) – N(t) = n}
= P{N(t1+s) – N(t1) = n}
= P{N(s) = n}
Do Young Eun ECE/CSC 570, Fall 2014
Poisson Process
Two Definitions: Definition 1: An arrival process {N(t); t ≥ 0} is
said to be a Poisson Process with rate > 0, ifN(0)=0 It has stationary and independent incrementsP{N(h) = 1} = h + o(h)P{N(h) ≥ 2} = o(h): “rules out” simultaneous arrivals
Note: What is P{N(h)=0} then?
Do Young Eun ECE/CSC 570, Fall 2014
Poisson Process (cont’d)
Equivalent Definition: Definition 2: An arrival process {N(t), t ≥ 0} is said to
be a Poisson Process with rate , if N(0)=0 The process has independent increments.
The number of arrivals in any interval of length s is Poisson distributed with mean s. In other words, for all s and t ≥ 0,
Do Young Eun ECE/CSC 570, Fall 2014
Joint Distribution: Complete Characterization
For any increasing time instants (t1 , t2 , …, tk ) and non-decreasing integers (n1 , n2 , …, nk ), we want to compute
For instance, P{N(3)=4, N(5)=6, N(8)=10} = ?
Do Young Eun ECE/CSC 570, Fall 2014
Interarrival times of Poisson Process
Consider a Poisson process with rate
Let Xn be the time between the (n-1)st and the nth event (arrival). Then, {Xn, x ≥1} forms a sequence of interarrivaltimes.
Distribution ?
X1X2 X3
t=0 t=1 t=2 t=3
Do Young Eun ECE/CSC 570, Fall 2014
Interarrival times of Poisson Process
First, what is the distribution of X1?
X1 has an exponential distribution with mean 1/.
Repeating the argument …
In fact, Xn, n ≥ 1, are independent and identically distributed (i.i.d.) exponential random variables with mean 1/.
Another way of constructing a Poisson process?
Do Young Eun ECE/CSC 570, Fall 2014
Sn: Time until the nth Arrival
Sn can be expressed as:
The event {Sn ≤ t}, “ the nth arrival before time t ” is equivalent to the event {N(t) ≥ n}, “the number of arrivals occurring by time t is at least n”.
tSn
…
Do Young Eun ECE/CSC 570, Fall 2014
Memoryless Property
Let { N(t), t ≥ 0} be a Poisson process with rate Let t0 be the time since the last arrival Q: what is the distribution of time till the next arrival?
Exponential distribution is memoryless residual life paradox Exponential dist. is the only one with the memoryless property!
Do Young Eun ECE/CSC 570, Fall 2014
Paradox of Residual Life
Suppose that buses arrive at a stop according to a Poisson process with rate .
Assume that you arrive at that bus-stop at some arbitrary point in time.
Question: How long would you expect to wait? Two logical answers.
t
Xn Xn+2Xn+1
Do Young Eun ECE/CSC 570, Fall 2014
Answer 1: Average wait = 1/(2)
Note that average time between bus arrivals = 1/
On average, you will arrive exactly in the middle of an inter-arrival time.
Your average wait for the next bus = ½ E{Xi} = 1/(2)
t
Xn Xn+2Xn+1
Bus arrives Bus arrives
Do Young Eun ECE/CSC 570, Fall 2014
Answer 2: Average wait = 1/ Since buses arrive according to a Poisson process with rate ,
the time you have to wait is independent of how long it has taken since the last bus, i.e., the average wait = 1/.
In fact, by the second argument, if buses have been operational for a long time, then by the memory-less property, the expected time since the last bus arrival is also 1/
This implies that the expected time between the last bus and the next bus arrival in your interval = 2/
So, which answer is correct?
Do Young Eun ECE/CSC 570, Fall 2014
Paradox of Residual Life
Answer 2 is in fact correct! This is because the interval that you arrive in is not a typical
interval, i.e., it is in fact more likely that you will arrive in a larger time interval.
In the case of a Poisson process, if you are sufficiently far from the origin, this interval that you arrive is in fact two times as long as the average interval.
Inspection Paradox: also applies to other arrival processes
tSN(t) SN(t)+1
Do Young Eun ECE/CSC 570, Fall 2014
Utilities of Poisson Processes It has been shown that the number of call (or connection)
arrivals received in a network system in a time interval [0,t] is well modeled by a Poisson process.
Connection with Binomial distribution
Many nice properties
Do Young Eun ECE/CSC 570, Fall 2014
Poisson as a Limit of Binomial Distribution
Binomial random variable Xi: i.i.d., P{Xi=1} = 1 – P{Xi=0} = p
Bn has binomial distribution with parameters (n, p)
Now, n large, p=p(n) small, such that
Then, as n gets large, Bn converges to a Poisson random variable with mean
# of phone call (packet) arrivals at central switch over small time interval I (of size O(1/n)) Xk = 1 if there is a call arrival over I with probability p from kth source
Total n sources, while np
Do Young Eun ECE/CSC 570, Fall 2014
Utilities of Poisson Processes
Superposition of two independent Poisson processes are again a Poisson process. Let N1(t) be a Poisson process with rate 1, and N2(t) be a Poisson
process with rate 2, and they are independent.
Then, N1(t)+N2(t) is also a Poisson process with rate 1 + 2
Statistically splitting Poisson arrival into two arrival processes (using a Bernoulli r.v. for splitting) Poisson processes !
Do Young Eun ECE/CSC 570, Fall 2014
Other Arrival Processes
Renewal Process: A counting process for which the interarrival times are i.i.d. with an arbitrary distributionNote: if i.i.d. exponential dist. Poisson process !
Do Young Eun ECE/CSC 570, Fall 2014
Example 1: To transmit packets from source to destination.
SENDER RECEIVERSEQ. # CRC
PACKET
ACKTIMEOUT
retransmitif no ACK
acknowledge packetif no errors
time time
SourceDestination
Packet
Regenerative Method
Do Young Eun ECE/CSC 570, Fall 2014
Regenerative Method (2) Assumptions:
When destination receives a correct packet, an ACK would be generated, otherwise a NACK would be generated and sent back to source.
A packet is correctly transmitted with probability (1-p) A packet in error must be retransmitted. Transmission of packets is independent
X = # of transmissions needed for destination to get a correct packet.
Y = # of transmissions needed for destination to get a correct packet given that the first transmission is error.
-p) (pn}{X n- 1P 1
-p)(
pYX 1y probabilit with , 1y probabilit with , 1
Do Young Eun ECE/CSC 570, Fall 2014
Coin Flip Analogy
X = # of flips until tail shows up…
…
Y
Do Young Eun ECE/CSC 570, Fall 2014
Regenerative Method (3)
Since Y and X have the same distribution (Y is statistical “replica” of X):
Note: The purpose of regenerative method is to introduce a simple algebra calculation method instead of complex calculation
-p)/(XX p(-p
Yp(-p)(X
11 }E{})E{11
})E{1 11 }E{
Do Young Eun ECE/CSC 570, Fall 2014
Example 2 Example description: A prison cell has 4 doors (see figure).
Assumptions: It takes a prisoner 1 day to get to each door. A prisoner immediately forgets which door he takes every time. A prisoner chooses each door with equal probability.
Only 1 door lets to freedom, the other 3 doors, if a prisoner enters, he would be trapped and kept inside for 1 day, 3 days, 5 days each. Prison Cell
FREE
1 day
3 days5 days
Door-4
Door-1
Door-2
Door-3
Do Young Eun ECE/CSC 570, Fall 2014
X: # of days he takes to reach freedomE{X}: average days he takes to reach freedom Yi : # of days he takes if his previous choice is door-i other
than the one leads to freedom
In class exercise: E{X} = ?
Example 2 (cont’d)