Documente Academic
Documente Profesional
Documente Cultură
mahanti@cpsc.ucalgary.ca
Random Variables
A random variable is a real-valued mapping that assigns a numerical value to each possible outcome of an experiment. Formally, a random variable X on a sample space S is a function X : S that assigns for all s S a real number X(s). Notation: Upper case characters (e.g., X, Y , Z etc) denote random variable; lower case characters (e.g., x, y, z etc.) denote value attained by a random variable.
Discrete Random Variable 2
Examples
Consider arrival of packets at a router. Let X be the number of packets that arrive per unit time. X is a random variable that can take the values {0,1,2,}. Consider rolling a pair of dice. Let X equal the sum of the dice on a roll. If we think of the sample points as a pair (i, j), where i = value rolled by the first die and j = value rolled by the second die, we have X(s) = i + j. X is a random variable that can take any value between 2 and 12.
Discrete Random Variable 3
Another Example
Consider tossing two fair coins (i.e., one toss followed by another). Define a random variable X as the number of heads seen in the experiment. For this experiment: The sample space S = {(H,H), (H, T), (T,H), (T, T)} The mapping of s S to a real number X(s) is as follows: s X(s) (H,H) (H,T) (T,H) (T,T) 2 1 1 0
4
Ax = {s S | S ( s ) = x}
Clearly, Ax satisfies the following properties:
Ax Ay = , x y
Ux Ax = S
Discrete Random Variable 5
A0 = {s S | X ( s ) = 0 } = {(T , T )} A1 = {s S | X ( s ) = 1} = {( H , T ), (T , H )} A2 = {s S | X ( s ) = 2 } = {( H , H )}
p X ( x ) = P( X = x) = P ({s | X ( s) = x}) =
X (s) = x
Discrete Random Variable 7
P( s)
Properties of PMF
Probability.
p ( x) = 1 ; this is true because random variable X x X assigns some value x to each sample point s S. A discrete random variable can take finite or countably infinite different values, say x1, x2,. Thus, the condition above can be restated as follows:
i p X ( xi ) = 1
The cumulative distribution function (CDF) of a random variable X is a function FX(t), < t < , defined as:
FX (t ) = P( < X t ) = P( X t ) = p X ( x)
x t
Discrete Random Variable 9
Properties of CDF
0 F(x) 1, < x < . F(x) is a monotone increasing function of x because if x1 x2, then F(x1) F(x2). limx = 1 and limx - = 0.
Note: In the above, the random variable is not explicitly specified. If we are talking about two random variables, say X and Y at the same time, then we should explicitly specify them in the CDFs, e.g., FX(t) and FY(t). Terminology: Cumulative Distribution Function may be called Probability Distribution Function or simply a Distribution Function.
Discrete Random Variable 10
Expectation
PMF of a random variable provides several numbers. Expectation (or mean) of X is one way to summarize the information provided by PMF E[ X ] = x p X ( x) = Definition:
11
Properties of Mean
E[cX ] = cE[ X ] E[ ci X i ] = ci E[ X i ]
i =1 i =1 n n
12
Variance
Variance of a random variable X, denoted as Var(X) or 2, is defined as the expected value of (X E[X])2:
Var ( X ) = E[( X E[ X ]) 2 ]
Var(X) can also be calculated as:
Var ( X ) = E[ X 2 ] ( E[ X ]) 2
where E[X2] is the second moment of X.
Discrete Random Variable 13
Properties of Variance
Variance is a measure of dispersion of a random variable about its mean.
15
Bernoulli Distribution
The CDF of a Bernoulli random variable X with parameter p=1- q is given by: 0, x < 0 F ( x ) = q, 0 x < 1 1, x 1 Mean and variance:
E[ X ] = p Var ( X ) = p(1 p)
Discrete Random Variable 17
Binomial PMF
Binomial Distribution (n = 10) 0.3 0.25 P ({X = k }) 0.2 0.15 0.1 0.05 0 0 1 2 3 4 5 6 7 8 9 10 Number of successes (k )
Discrete Random Variable 19
E[ X ] = np
Var ( X ) = np (1 p )
Discrete Random Variable 21
FX (t ) = (1 p ) i 1 p = 1 (1 p) t ,
i =1
t0
E[ X ] =
1 p
Var ( X ) =
1 p p2
22
Geometric PMF
Geometric Distribution (p = 0.5) 0.6 0.5 P ({X = k}) 0.4 0.3 0.2 0.1 0 0 1 2 3 4 5 6 7 8 9 10 Number of trials until first success (k )
23
We can say: P{Yi = 1} = p (i.e., a packet loss) P{Yi = 0} = 1 - p (i.e., no loss) So number of successful packet transmissions before first loss, X, is geometrically distributed P{(X = n)} = p (1-p)n-1 , n = 1,2,(good length distribution)
Discrete Random Variable 24
Timer times out if no ACK is received Assume each packet has length l bits
Questions
1) How many trials we need to successfully deliver a packet? 2) How does (1) depend on the channel BER (p)?
Discrete Random Variable 25
P1 P2 P3 are packet transmission trials X = number of trials needed to successfully transmit a packet X is geometrically distributed with probability q E[X] = 1 / q As p 1, q 0 E[X] , which coincides well with intuition Also, for fixed p, as l E[X]
Discrete Random Variable 26
k , e p X (k ) = k! 0,
k = 0,1,2,... otherwise
Poisson PMF with parameter is a good approximation of Binomial PMF with parameters n and p, provided = np, n is very large, and p is very small.
Discrete Random Variable 27
k =0
k! = e z ,
k =0
zk
p X ( k ) = e e = 1
28
Poisson PMF
Poisson Distribution 0.7 0.6 0.5 P [X = k] 0.4 0.3 0.2 0.1 0 0 1 2 3 4 5 6 7 8 9 10 Number of events (k)
Discrete Random Variable 29
= 0.5 =1 =5
P ({X = k })
5 Number of events (k )
10
Binomial distribution with large n and small p can be approximated by Poisson distribution with = np
Discrete Random Variable 30
10
FX (t ) = e
k =0
k
k!
t0
E[ X ] =
Var ( X ) =
Consider N independent Poisson random variables Xi, i=1,2,3,,N, with parameters Xi. Then X=X1+X2++XN is also a Poisson r.v. with parameter =1+2+...+
Discrete Random Variable 31
E[ X ] =
= e
k =1
k =0
k e
k
k!
k =1 k 1
= k e
k
k!
(k 1)!
= e
m =0
m
m!
m =0 24 1 4 3
p X ( m)
Divide the interval (0,t] into n subintervals of equal lengths Assume arrival of jobs in each interval to be independent of arrivals in another interval
Discrete Random Variable 33
11
p = t =
t n
The number of successes k in n trials can be given by the Binomial distributions PMF
n = p k (1 p) n k k
Discrete Random Variable 34
n k
e -
12
38
39
13
We assume X1+X2 are Poisson distributed with rate G, so X is also Poisson with rate G
Probability that no other traffic is initiated in vulnerable period is pX(0) = e-2G, which is Poisson model
40
e 2G (1 2G ) = 0 G = S max =
14
pY ( y ) = p X ,Y ( x, y )
x
44
Conditional PMF
15
Conditioning On An Event
Look at conditional PMFs given the occurrence of a certain event or given the value of another random variable Conditional PMF of random variable X, conditioned on an event A with P(A)>0 is defined as:
p X | A ( x) = P{( X = x | A)} =
P({ X = x} A} P( A)
Calculate pX|A(x) by adding the probabilities of outcomes that result in X=x and belong to the conditioning event A, and then normalize by dividing with P(A).
Discrete Random Variable 46
47
16
p X |Y ( x | y ) =
p X |Y ( x | y) = 1
x
Discrete Random Variable 49
17