PRV 03 RV Notes
PRV 03 RV Notes
Joohyun Lee
S
s
real number line
x
2
Roll of Dice Example
▪ Random variable I is the number of dots on the die
sample space Mapping, I ( ) = 3
i
1 2 3 4 5 6
fI[i]
▪ Sample space: SI = {1, 2, 3, 4, 5, 6}
▪ Probability Mass Function (PMF) fI[i] 1/6
6
f𝐼 𝑖 = Pr 𝐼 = 𝑖 i
f𝐼 𝑖 = 1 1 2 3 4 5 6
𝑖=1
3
Roll a Pair of Dice
fI[i]
Find the PMF fI[i]
6
1/6
1/9
5
1/18
i
I=5 4 2 4 6 8 10 12
Pr[I=5] =
12
3
check: f𝐼 𝑖 = 1
𝑖=1
2
I=3 Pr[I=3] =
I=2 1 Pr[I=2] =
1 2 3 4 5 6 4
Some Distributions for Discrete R.V.
▪ Bernoulli
▪ e.g., binary data
▪ Uniform
▪ e.g., roll of a die
▪ Binomial
▪ e.g., sequence of binary events
▪ Geometric
▪ e.g., waiting times
▪ Poisson
▪ e.g., number of events or arrivals 5
Bernoulli Random Variable (Parameter p)
𝑆 = true, false PMF:
fI[i] p
𝐼 ∈ 1, 0 1−p
Pr 𝐼 = 1 = 𝑝 i
0 1
Pr 𝐼 = 0 = 1 − 𝑝
Example
sample space PMF:
fI[i]
+5 V
1 1/2 1/2 𝑆𝐼 = {0, 1}
0 −5 V
i
0 1 6
Discrete Uniform R.V. (Parameters n, m)
1
PMF: f𝐼 𝑖 = 𝑚≤𝑖≤𝑛
𝑛−𝑚+1
Example
Draw a ticket at a raffle; tickets numbered 0, 1, …, 9.
Selection of tickets equally likely. I is the ticket number.
The probability mass function is given by f 𝑖 = 1 𝑖 = 0,1, ⋯ , 9
𝐼
10
fI [i]
1/10
i
-1 0 2 4 6 8 10 7
Binomial R.V. (Parameters p, n)
Consider a binary sequence (ones and zeros) of length n
Let I be the number of times a one occurs in that sequence
𝑛 𝑖
The PMF is given by f𝐼 𝑖 = Pr 𝐼 = 𝑖 = 𝑝 1 − 𝑝 𝑛−𝑖
𝑖
fI[i]
i
Note 0 1 2 3 4 5
9
Using the Binomial Distribution
0 5 3 2
5 1 1 1 5 1 1 1
f𝐼 0 = Pr 𝐼 = 0 = = Pr 𝐼 = 3 = = 10 ⋅
0 2 2 32 3 2 2 32
1 4 4
5 1 1 1 5 1 1 1
f𝐼 1 = Pr 𝐼 = 1 = =5⋅ Pr 𝐼 = 4 = =5⋅
1 2 2 32 4 2 2 32
2 3 5 0
5 1 1 1 5 1 1 1
f𝐼 2 = Pr 𝐼 = 2 = = 10 ⋅ Pr 𝐼 = 5 = =
2 2 2 32 5 2 2 32
10/32
fI[i]
5/32
1/32 i
0 1 2 3 4 5 10
Binomial Distribution: Another Example
Consider a binary communication channel with channel error probability, p = 10–2.
The length of the binary sequence being transmitted is one hundred (100).
The number of errors I in 100 bits is a binomial random variable.
What is the probability of more than 3 errors?
3
Pr 𝐼 ≥ 4 = 1 − Pr 𝐼 < 4 = 1 − f𝐼 [𝑖]
𝑖=0
=
11
Geometric Random Variable (Parameter p)
Consider a sequence of trials (length indefinite) in which an event A may occur with Pr 𝐴 = 𝑝
Check: f𝐼 𝑖 = 𝑝 1 − 𝑝 𝑖
=
𝑖=0 𝑖=0 13
Binary Symmetric Channel Application
Consider a binary symmetric communication channel with channel error
probability Pr[1|0] = Pr[0|1] = p = 10–2.
The length of the binary sequence being transmitted is very large (infinite).
What is the probability that the first error occurs after the third transmission?
The waiting time J to the first error is a geometric random variable.
The probability of the first error occurs after the 3rd transmission is
Pr 𝐽 ≥ 3 =
14
Poisson Random Variable (parameter 𝛼)
Consider the occurrence of an event in a certain time period or in a
certain region of space.
𝛼 𝑖 −𝛼
f𝐼 𝑖 = Pr 𝐼 = 𝑖 = 𝑒 𝑖 ≥ 0
𝑖!
Applies to:
Number of packets arriving at a network switch (time).
Number of defects in a semiconductor chip (space).
15
Poisson Random Variable (parameter 𝛼)
The probability mass function is given by
𝛼 𝑖 −𝛼
f𝐼 𝑖 = Pr 𝐼 = 𝑖 = 𝑒
𝑖!
17
(Continuous) Random Variables
▪ A random variable (r.v.) is a function that assigns a real
number, X(s), to each outcome s in the sample space
▪ The mapping may be to any real numbers, rational or irrational
Mapping, X(s) = x
S
s
real number line
x
18
Cumulative Distribution Function (Continuous)
The fundamental description of a continuous random variable X is
through its cumulative distribution function (CDF), defined as
𝐹𝑋 (𝑥) = Pr[ 𝑋 ≤ 𝑥]
FX(x)
1.0
A typical CDF has the form:
x
0
19
Cumulative Distribution Function (Discrete)
Discrete random variables also have a CDF
𝑖
PMF CDF
20
Properties of the CDF
𝐹𝑋 (𝑥) = Pr[ 𝑋 ≤ 𝑥]
FX(x)
1.0
1. 0 ≤ 𝐹𝑋 𝑥 ≤ 1 x
0 a b
2. lim 𝐹𝑋 𝑥 = 1; lim 𝐹𝑋 𝑥 = 0
𝑥→∞ 𝑥→−∞
4. Pr 𝑎 < 𝑋 ≤ 𝑏 = 𝐹𝑋 𝑏 − 𝐹𝑋 𝑎
21
Probability Density Function (PDF)
PDF CDF
fX(x) FX(x)
1.0
x 0 x
a b a b
𝑥
𝑑𝐹𝑋 (𝑥)
𝑓𝑋 (𝑥) = 𝐹𝑋 (𝑥) = Pr[ 𝑋 ≤ 𝑥] = න 𝑓𝑋 (𝑧)𝑑𝑧
𝑑𝑥
𝑏 𝑏 𝑎 −∞
𝑓𝑋 (𝑥) ≥ 0 න 𝑓𝑋 (𝑥)𝑑𝑥 = 1
−∞ 𝑎+Δ𝑥
x
x
a
24
PMF approximates PDF
The PMF approximates the pdf as follows: 𝐿𝑘 +Δ
fK[k] න 𝑓𝑋 (𝑥)𝑑𝑥 = 1
fX(x) −∞
∞
f𝐾 [𝑘] = 1
𝑘=−∞
Lk x …-3 - -1 0 1 2 3 … k
A B
2 25
Some Distributions for Continuous RVs
▪ Uniform
▪ random number generation
▪ secure communication
▪ Exponential
▪ message interarrival times
▪ computer network service times
▪ system failures
▪ Gaussian
▪ noise in electronic systems
▪ sums of random variables
26
Uniform Random Variable (Parameters a, b)
Probability density function: fX(x)
1/(b−a)
1
𝑓𝑋 (𝑥) = ቐ𝑏 − 𝑎 , 𝑎 ≤ 𝑥 ≤ 𝑏
0, otherwise x
a b
Cumulative distribution function:
𝑥 𝑥
1 FX(x)
𝐹𝑋 (𝑥) = Pr[ 𝑋 ≤ 𝑥] = න 𝑓𝑋 (𝑧)𝑑𝑧 = න 𝑑𝑧
−∞ 𝑎 𝑏 − 𝑎 1
0, 𝑥<𝑎
𝑥−𝑎
𝐹𝑋 (𝑥) = , 𝑎≤𝑥<𝑏 x
𝑏−𝑎 a b
1, 𝑥≥𝑏
27
Uniform Random Variable: Example
Let a = 0, b = 10. Find Pr[2 < X ≤ 6]
fX(x) FX(x)
1/10
1
x x
0 2 6 10 2 6
Pr 2 < 𝑋 ≤ 6 =
28
Exponential Random Variable (Parameter 𝜆)
Probability density function: fX(x)
0 𝑥<0 e−x
𝑓𝑋 𝑥 = ቊ −𝜆𝑥
𝜆𝑒 𝑥≥0
x
Cumulative distribution function:
𝑥
𝐹𝑋 𝑥 = Pr 𝑋 ≤ 𝑥 = න 𝑓𝑋 𝑧 𝑑𝑧 = FX(x) 1−e−x
−∞
0 𝑥<0
𝐹𝑋 𝑥 = ቊ
1 − 𝑒 −𝜆𝑥 𝑥≥0 x
x
1
Let 𝜆 = ∶ Pr 𝑇 < 𝑋 ≤ 2𝑇 =
𝑇 30
The Memoryless Property
▪ Given that a system has been operational at time t sec, the probability that
it operates an additional h sec is same as the probability that it operates h
sec to begin with
▪ Applications of this property exist in queuing theory, communication and
computer networks
▪ Proof (for Exponential R.V.):
Show that Pr 𝑋 > 𝑡 + ℎȁ𝑋 > 𝑡 = 𝑃𝑟[𝑋 > ℎ]
31
Gaussian R.V. (Parameters 𝜇, 𝜎)
1 𝑥−𝜇 2
Probability density function: −
𝑓𝑋 𝑥 = 𝑒 2𝜎2 , −∞ < 𝑥 < ∞
2𝜋𝜎
= mean
fX(x)
= standard deviation
1
0.607
2
2𝜋𝜎
x
m− m m+
32
Gaussian R.V. (Parameters 𝜇, 𝜎)
𝑥
Cumulative distribution function:
𝐹𝑋 𝑥 = Pr 𝑋 ≤ 𝑥 = න 𝑓𝑋 𝑧 𝑑𝑧
−∞
1 𝑥 𝑧−𝜇 2
−
= න 𝑒 2𝜎2 𝑑𝑧
FX(x) 2𝜋𝜎 −∞
1
0.841
0.682 0.500
0.159
x
m− m m+
33
Transformations of Random Variable
If Y = g(X) and X is random, then Y is also random.
35
Finding Probabilities for Gaussian RVs
±
∞ 𝑧2
1
Define 𝑄 𝑦 = න 𝑒 −
2 𝑑𝑧 𝑥−𝜇
2𝜋 𝑦 𝑄
𝜎
then 𝑄 −𝑦 = 1 − 𝑄 𝑦 x
When x > Pr[X > x] is the shaded area.
𝑥−𝜇
and Pr 𝑋 > 𝑥 = 𝑄 ±
𝜎 𝑥−𝜇
𝑄
𝜎
𝑥−𝜇
𝐹𝑋 𝑥 = Pr 𝑋 ≤ 𝑥 = 1 − 𝑄
𝜎
x
When x < Pr[X > x] is the unshaded area.
Table of inverse Q function values
l x = Q−1(10−l ) l x = Q−1(10−l ) l x = Q−1(10−l ) l x = Q−1(10−l )
1 1.2816 7 5.1993 13 7.3488 19 9.0133
2 2.3263 8 5.6120 14 7.6506 20 9.2623
3 3.0902 9 5.9978 15 7.9413 21 9.5050
4 3.7190 10 6.3613 16 8.2221 22 9.7418
5 4.2649 11 6.7060 17 8.4938 23 9.9730
6 4.7534 12 7.0345 18 8.7573 24 10.1990
𝑥−𝜇
𝑄 = Pr 𝑋 > 𝑥
𝜎
use tables
Pr 𝑌 < 0 =
Pr 𝑌 < 0 =
10−2 𝑉 10−2 𝑉
𝑄 = 10−6 ⇒ = 4.753
2 2
40
Finding Probabilities Using “Error Function”
𝑥
1 (𝑧−𝑚)2 1 𝑥−𝑚
−
𝐹𝑋 𝑥 = න 𝑒 2𝜎2 𝑑𝑧 = 1 + erf
2𝜋𝜎 2 2 2𝜎
−∞
where
2 𝑦 −𝑧 2
erf 𝑦 = න 𝑒 𝑑𝑧 and erf −𝑦 = −erf 𝑦
𝜋 0
2 ∞ −𝑧 2 1
erfc 𝑦 = න 𝑒 𝑑𝑧 = − erf 𝑦
𝜋 𝑦 2
b Pr 𝑋 ≤ 0.2
42
Unit Impulse Function (= Delta Function)
43
Representation of Discrete R.V.
Impulses (x) provide finite probability with zero width (see Appendix B)
44
Mixed Random Variables
The pdf contains impulses and is continuous over one or several intervals.
fX(x) FX(x)
A
1
A
x0 x x
x0
45
Transformations of Random Variable
If Y = g(X) and X is random, then Y is also random.
dy
y Y=g(X)
dx
0 x 1
𝑓𝑌 𝑦 = 𝑓 𝑥
𝑑𝑦 𝑋 ቮ
Pr 𝑦 < 𝑌 ≤ 𝑦 + 𝑑𝑦 = Pr 𝑥 < 𝑋 ≤ 𝑥 + 𝑑𝑥 𝑑𝑥
𝑥=𝑔−1 𝑦
𝑓𝑌 𝑦 𝑑𝑦 = 𝑓𝑋 𝑥 𝑑𝑥
47
Transformations: Example 1
𝑓𝑋 𝑥
Let Y = g(X) = 2X with 1/4
1/4 0 ≤ 𝑋 ≤ 4 x
𝑓𝑋 𝑥 = ቊ 0 4
0 otherwise
y8
y
4 x
fY(y)
8
0
8
x
0 4 -8
0
1/8
-8
fY(y)
𝑓𝑋 𝑥 𝑓𝑋 𝑥
1/4 1/4
x x
0 4 0 4 50
Transformations: Example 3
𝑓𝑋 𝑥
Let Y = g(X) = X + 3 with 1/4
1/4 0 ≤ 𝑋 ≤ 4 x
𝑓𝑋 𝑥 = ቊ 0 4
0 otherwise
y
y
7
7
3
3 0 4 x
1/4
0
fY(y)
𝑓𝑋 𝑥
1/4
x
0 4 52
Straight Line Transformation
Let Y = g(X) = aX + b
𝑑𝑦 𝑌−𝑏
Then = 𝑎, 𝑋 =𝑔 −1
𝑌 =
𝑑𝑥 𝑎 1
y 𝑓𝑌 𝑦 = 𝑓 𝑥
Transfer Characteristic: 𝑑𝑦 𝑋 ቮ
d 𝑑𝑥 𝑦−𝑏
𝑥=
y 𝑎
1 𝑦−𝑏
= 𝑓𝑋
b dx 𝑎 𝑎
x
−𝑏ൗ 0
𝑎
53
Straight Line Transformation (Using CDF)
Let 𝑌 = 𝑎𝑋 + 𝑏, assume 𝑎 > 0
y Y = aX +b
Starting with FY(y) we can write:
𝐹𝑌 𝑦 = Pr 𝑌 ≤ 𝑦 = Pr 𝑎𝑋 + 𝑏 ≤ 𝑦
b
𝑦−𝑏 𝑦−𝑏
= Pr 𝑋 ≤ = 𝐹𝑋
𝑎 𝑎 x = (y -b)/a
Then
𝑑 𝑑 𝑦−𝑏 1 𝑦−𝑏
𝑓𝑌 𝑦 = 𝐹 𝑦 = 𝐹 = 𝑓𝑋
𝑑𝑦 𝑌 𝑑𝑦 𝑋 𝑎 𝑎 𝑎 54
Straight Line Transformation (Using CDF)
Let 𝑌 = 𝑎𝑋 + 𝑏, 𝑛𝑜𝑤 assume 𝑎 < 0
b
𝑦−𝑏
𝐹𝑌 𝑦 = Pr 𝑌 ≤ 𝑦 = Pr 𝑋 > y
𝑎
𝑦−𝑏 𝑦−𝑏
= 1 − Pr 𝑋 ≤ = 1 − 𝐹𝑋
𝑎 𝑎 x = (y -b)/a
𝑑 1 𝑦−𝑏
Combine to find 𝑓𝑌 𝑦 = 𝐹 𝑦 = 𝑓
𝑑𝑦 𝑌 𝑎 𝑋 𝑎 55
Straight Line Transformation Summary
𝑌 = 𝑎𝑋 + 𝑏
General Case 1 𝑦−𝑏
𝑓𝑌 𝑦 = 𝑓
𝑎 𝑋 𝑎
Special Cases
𝑌 = 𝑎𝑋 𝑌 =𝑋+𝑏
1 𝑦
𝑓𝑌 𝑦 = 𝑎
𝑓𝑋 𝑎 𝑓𝑌 𝑦 = 𝑓𝑋 𝑦 − 𝑏
56
Straight Line Transformation Example
(The Gaussian Case)
Suppose that X is Gaussian with parameters X and X :
𝑥−𝜇𝑋 2
1 − 2
2𝜎𝑋
𝑓𝑥 𝑥 = 𝑒 −∞<𝑥 <∞
2𝜋𝜎𝑋
2
𝑦−𝑏 2
−𝜇𝑋
then 1 1 −
𝑎
1 −
𝑦− 𝑏+𝑎𝜇𝑋
2
2𝜎𝑋 2
2𝑎 2 𝜎𝑋
𝑓𝑦 𝑦 = 𝑒 = 𝑒
𝑎 2𝜋𝜎𝑋 2𝜋 𝑎 𝜎𝑋
x1 x2 xm
Pr 𝑦 < 𝑌 ≤ 𝑦 + 𝑑𝑦 = Pr 𝑥1 < 𝑋 ≤ 𝑥1 + 𝑑𝑥1 + ⋯ + Pr 𝑥𝑚 < 𝑋 ≤ 𝑥𝑚 + 𝑑𝑥𝑚
𝐹𝑌 𝑦 = Pr 𝑌 ≤ 𝑦 = Pr 𝑎𝑋 2 ≤ 𝑦 x1 x2
𝑦 𝑦 𝑦 𝑦
= Pr − ≤𝑋≤ = 𝐹𝑋 − 𝐹𝑋 −
𝑎 𝑎 𝑎 𝑎
Then 𝑑 𝑦 𝑦 1 𝑦 𝑦
𝑓𝑌 𝑦 = 𝐹 − 𝐹𝑋 − = 𝑓 + 𝑓𝑋 −
𝑑𝑦 𝑋 𝑎 𝑎 2 𝑎𝑦 𝑋 𝑎 𝑎
60
The Radar Detection Problem
Consider a simple radar detection scheme:
Envelope X Y
Received Detector + +
−
RF Pulse
plus noise Threshold xT
62
The Radar Detection Problem: Example
The received signal at a radar detector output is
𝑋 𝑡 =𝐴+𝑊 𝑡
where A is a constant and W(t) is Gaussian noise with mean zero and variance 2
find and plot the probability of detection (pd) versus signal-to-noise ratio (SNR):
signal power 𝐴2
𝑆𝑁𝑅 = 10 log10 = 10 log10 2
noise power 𝜎
63
The Radar Detection Problem: Example
Suppose A = 2 and it is required that pfa = 0.01
Case 1:
𝐴2 22
𝑆𝑁𝑅 = 10 log10 2
= 10 log10 = 12.04 dB
𝜎 1/4
64
The Radar Detection Problem: Example
Target absent: X(t) = W(t) fX(x| Target absent)
pfa
Select xT such that
∞
xT x
න 𝑓𝑋 𝑥 𝑑𝑥 = 𝑝𝑓𝑎 0
𝑥𝑇
xT A x
0 66
The Radar Detection Problem: Example
Case 2 (increased noise)
22 fX(x)
2 = 4. Find pd. 𝑆𝑁𝑅 = 10 log10
4
= 0dB
pfa
Target absent: X(t) = W(t)
𝑥𝑇 − 0 xT x
𝑄 = 𝑝𝑓𝑎 0
2
From table: xT =
fX(x)
Target present: X(t) = 2 + W(t)
pd
4.65 − 2
𝑝𝑑 = 𝑄 = 𝑄 1.32 x
2 0 2 4.65
= 0.094 A xT 67
The Radar Detection Problem: Example
Case 3 (intermediate noise level):
Let 2 = 1. Find pd.
𝑆𝑁𝑅 = 6.02dB
𝑥𝑇 − 0
𝑄 = 𝑝𝑓𝑎 ⇒ 𝑥𝑇 = 2.32 from inverse Q table
1
Target present:
2.32 − 2
𝑄 = 68
1
Radar Detection (Concluded)
Plot of detection probability vs. SNR for fixed pfa:
pd
1 0.9496
0.9978
pfa = 0.01
0.5
0.38
0.034
0.094
−6 0 6 12 18 SNR
69
Radar Detection
70