Lecture 2 20240311
Lecture 2 20240311
ω2
X(ω1) X(ω2) 0 1
Random Variable: Examples
Ex 2.1] Letting X denote the random variable that is defined
as the sum of two fair dice
The outcomes of two dice = (ω1, ω2)
RV X(ω1, ω2) = ω1+ω2
Possible values of X = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
Probabilities to the possible values of the random variable
P(X=2)=P{(1,1)}=1/36
P(X=3)=P{(1,2), (2,1)}=2/36
6
…
P(X=11)=P{(5,6), (6,5)}=2/36 5
P(X=12)=P{(6,6)}=1/36
4
1 = 𝑃𝑃 ⋃12
𝑛𝑛=2{𝑋𝑋 = 𝑛𝑛}
= ∑12𝑛𝑛=2 𝑃𝑃 𝑋𝑋 = 𝑛𝑛 3
2
1
1 2 3 4 5 6
Ex.2.3] Suppose that we toss a coin having a probability p of
coming up heads, until the first head appears. Letting N
denote the number of flips required, then assuming that the
outcome of successive flips are independent, N is a random
variable taking on one of the values 1, 2, 3, . . . , with
respective probabilities
P{N = 1} = P{H} = p,
P{N = 2} = P{(T, H)} = (1 − p)p,
P{N = 3} = P{(T, T, H)} = (1 − p)2p,
...
P{N = n} = P{(T, T, … , T, H)} = (1 − p)n−1p, n ≥ 1
𝑃𝑃 𝐴𝐴𝑖𝑖 𝐴𝐴𝑗𝑗 is the probability that the first n trials all result in a non-i
and non-j outcome
Properties of CDF F
1. F(b) is a nondecreasing function of b
2. limb∞F(b)=F(∞)=1
3. limb-∞F(b)=F(-∞)=0
Probability Mass Function (pmf): for a discrete random variable X, pmf p(a) of X
is defined a p(a) = P{X=a}.
Properties of pmf
1. p(xi)>0, i=1,2,…
2. p(x)=0 all other values of x
3. ∑i={1,..,∞}p(xi)=1
4. cdf vs. pmf: F(a)=∑xi≤ap(xi)
If X represents the number of successes that occur in the n trials, then X is said
to be a binomial random variable with parameters (n, p).
𝑛𝑛 𝑖𝑖
∑𝑛𝑛𝑖𝑖=0 𝑝𝑝(𝑖𝑖) = ∑𝑛𝑛𝑖𝑖=0 𝑝𝑝 (1 − 𝑝𝑝)𝑛𝑛−𝑖𝑖 = (𝑝𝑝 + 1 − 𝑝𝑝 )𝑛𝑛 = 1
𝑖𝑖
Ex. 2.7] It is known that any item produced by a certain machine will be
defective with probability 0.1, independently of any other item. What is the
probability that in a sample of three items, at most one will be defective?
If X is the number of defective items in the sample, then X is a binomial random
variable with parameters (3, 0.1). Hence, the desired probability is given by
P{X = 0} + P{X = 1} =(3,0)(0.1)0(0.9)3+(3,1)(0.1)1(0.9)2 = 0.972
Example of Discrete RVs:
The Geometric RV
Suppose that independent trials, each having probability p of
being a success, are performed until a success occurs.
� 𝑝𝑝(𝑛𝑛) = 𝑝𝑝 � (1 − 𝑝𝑝)𝑛𝑛−1 = 1
𝑛𝑛=1 𝑛𝑛=1
Example of Discrete RVs:
The Poisson RV
A random variable X, taking on one of the values 0, 1, 2, . . . , is said to be a Poisson
random variable with parameter𝑖𝑖
λ, if for some λ > 0,
𝜆𝜆
𝑝𝑝 𝑖𝑖 = 𝑃𝑃 𝑋𝑋 = 𝑖𝑖 = 𝑒𝑒 −𝜆𝜆 , i=0,1,2,3,… (2.5)
𝑖𝑖!
Ex. 2.10] Suppose that the number of typographical errors on a single page of this
book has a Poisson distribution with parameter λ = 1. Calculate the probability that
there is at least one error on this page.
P{X≥1}=1-P{X=0}=1-e-1=0.633
Continuous RVs
RV X is said to be a continuous RV if there exists a non-negative
function f(x), defined for all real x∈{-∞,∞} having the property that
for any set B of real numbers
P{X∈B}=∫Bf(x)dx=1
Properties of pdf of X
∞
𝑃𝑃 𝑋𝑋 ∈ −∞, ∞ = ∫−∞ 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑 = 1
𝑏𝑏
𝑃𝑃 𝑎𝑎 ≤ 𝑋𝑋 ≤ 𝑏𝑏 = ∫𝑎𝑎 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑
𝑎𝑎
𝑃𝑃 𝑋𝑋 = 𝑎𝑎 = ∫𝑎𝑎 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑 = 0
𝑎𝑎
𝐹𝐹 𝑎𝑎 = 𝑃𝑃 𝑋𝑋 ∈ −∞, 𝑎𝑎 = ∫−∞ 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑(𝑎𝑎)
= 𝑓𝑓(𝑎𝑎)
𝑑𝑑𝑑𝑑
1
, 𝛼𝛼 < 𝑥𝑥 < 𝛽𝛽
𝑓𝑓 𝑥𝑥 = �𝛽𝛽 − 𝛼𝛼
0, 𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜
where
∞
Γ 𝛼𝛼 = � 𝑒𝑒 −𝑥𝑥 𝑥𝑥 𝛼𝛼−1 𝑑𝑑𝑑𝑑
0
Example of Continuous RVs:
Normal RV
A continuous RV is said to be a normal RV with parameter μ
and σ2, if its probability density function is given by
1 (𝑥𝑥−𝜇𝜇)2
−
𝑓𝑓 𝑥𝑥 = 𝑒𝑒 2𝜎𝜎2
2𝜋𝜋𝜎𝜎
for -∞<x<∞.
Expectation of a function of a RV
The expected value of X , E[X], is a weighted average of the possible
values that X can take on, each value being weighted by the probability
that X assumes that value.
Ex. 2.23] Suppose X has the following probability mass function: p(0)
= 0.2, p(1) = 0.5, p(2) = 0.3. Calculate E[X2].
Letting Y = X2, we have that Y is a random variable that can take on
one of the values 02, 12, 22 with respective probabilities
pY (0) = P{Y = 02} = 0.2,
pY(1) = P{Y = 12} = 0.5,
pY(4) = P{Y = 22} = 0.3
Hence, E[X2] = E[Y] = 0(0.2) + 1(0.5) + 4(0.3) = 1.7
Note that E[X2] ≠ E[X]2
Expectation of a function of a RV
Proposition 2.1
1. If X is a discrete random variable with probability mass function p(x),
then for any real-valued function g,
𝐸𝐸 𝑔𝑔(𝑋𝑋) = � 𝑔𝑔(𝑥𝑥)𝑝𝑝(𝑥𝑥)
𝑥𝑥:𝑝𝑝 𝑥𝑥 >0
Corollary 2.2
If a and b are constants, then E[aX + b] = aE[X] + b
Expectation of a function of a RV
The expected value of a RVX, E[X], is also referred to as the mean or the first
moment of X.
Var(X)=E[(X-E[X])2]
=E[X2-2E[X]X+E[X]2]
=E[X2]-E[2E[X]X]+E[E[X]2]
=E[X2]-2E[X]2+E[X]2
=E[X2]-E[X]2
2. The event {𝑥𝑥1 < 𝑋𝑋 ≤ 𝑥𝑥2 , 𝑌𝑌 ≤ 𝑦𝑦} consists of all points {𝑋𝑋, 𝑌𝑌}
in the vertical half-strip 𝐷𝐷2 and the event {𝒙𝒙 ≤ 𝑥𝑥, 𝑦𝑦1 < 𝑌𝑌 ≤
𝑦𝑦2 } consists of all points {𝒙𝒙, 𝒚𝒚} in the vertical half-strip 𝐷𝐷3 .
We maintain that
𝑃𝑃 𝑥𝑥1 < 𝑋𝑋 ≤ 𝑥𝑥2 , 𝑌𝑌 ≤ 𝑦𝑦 = 𝐹𝐹 𝑥𝑥2 , 𝑦𝑦 − 𝐹𝐹 𝑥𝑥1 , 𝑦𝑦
𝑃𝑃 𝑋𝑋 ≤ 𝑥𝑥, 𝑦𝑦1 < 𝑌𝑌 ≤ 𝑦𝑦2 = 𝐹𝐹 𝑥𝑥, 𝑦𝑦2 − 𝐹𝐹 𝑥𝑥, 𝑦𝑦1
Example 2.31 At a party N men throw their hats into the center of
a room. The hats are mixed up and each man randomly selects one.
Find the expected number of men who select their own hats.
Letting X denote the number of men that select their own hats, we can
best compute E[X] by noting that X = X1 + X2 + · · · + XN where Xi =1, if
the ith man selects his own hat, otherwise 0.
Now, because the ith man is equally likely to select any of theN hats, it
follows that P{Xi = 1} = P{ith man selects his own hat} = 1/N
E[X]=E[X ]+E[X ]+ · · · +E[X ]=N(1/N)=1
1 2 N
Independent RVs:
The random variables X and Y are said to be independent if,
for all a, b,
P{X ≤ a, Y ≤ b} = P{X ≤ a}P{Y ≤ b}
⇔ F(a, b) = FX(a)FY(b) for all a, b
⇔ f(x, y) = fX (x)fY(y) for continuous cases
⇔ p(x, y) = pX (x)pY(y) for discrete cases
Given the joint p.d.f 𝑓𝑓𝑋𝑋𝑋𝑋 (𝑋𝑋, 𝑌𝑌), how does one obtain 𝑓𝑓𝑍𝑍 (𝑍𝑍) the
p.d.f of 𝑍𝑍?
𝑓𝑓𝑍𝑍 𝑍𝑍 = 𝑃𝑃 𝑍𝑍 𝜁𝜁 ≤ 𝑧𝑧 = 𝑃𝑃 𝑔𝑔 𝑋𝑋, 𝑌𝑌 ≤ 𝑧𝑧 = 𝑃𝑃 𝑋𝑋, 𝑌𝑌 ∈ 𝐷𝐷𝑧𝑧 = ∬𝐷𝐷 𝑓𝑓 𝑥𝑥, 𝑦𝑦 𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑
𝑍𝑍
𝑑𝑑 ∞
𝑓𝑓𝑋𝑋+𝑌𝑌 (𝑎𝑎)= ∫ 𝐹𝐹 𝑎𝑎 − 𝑦𝑦 g(y)dy
𝑑𝑑𝑑𝑑 −∞ 𝑋𝑋
∞ 𝑑𝑑 ∞
= ∫−∞ 𝐹𝐹𝑋𝑋 𝑎𝑎 − 𝑦𝑦 g(y)dy = ∫−∞ 𝑓𝑓 𝑎𝑎 − 𝑦𝑦 g(y)dy
𝑑𝑑𝑑𝑑
Example 1
Example 2.36 (Sum of Two Independent Uniform Random
Variables) If 𝑋𝑋 and 𝑌𝑌 are independent random variables both
uniformly distributed on (0, 1), then calculate the probability
density of 𝑋𝑋 + 𝑌𝑌.
Answer?
fY (x ) f X ( z − x) f X ( z − x ) fY ( x )
x x x
1 z −1 z z
(a ) 0 ≤ z < 1
fY (x ) f X ( z − x) f X ( z − x ) fY ( x )
x x x
1 z −1 z
z −1 1
( b) 1 ≤ z < 2
f Z (z )
z
0 1 2
39
From Chap.6 in Papoulis’s (4Ed)
Joint Probability Distribution of
Functions of Random Variables
Let X1 and X2 be jointly continuous random variables with
joint probability density function 𝑓𝑓(𝑥𝑥1 , 𝑥𝑥2 ).
w y
D′
C D C′
∆w
∆i
w yi
θ ϕ B′
A B A′
∆z
z z xi x
(a) (b)
Moment Generating Functions
The moment generating function φ(t) of the random variable X is
defined for all values t by
∑𝑥𝑥 𝑒𝑒 𝑡𝑡𝑥𝑥 𝑝𝑝(𝑥𝑥)
ϕ 𝑡𝑡 = 𝐸𝐸 𝑒𝑒 𝑡𝑡𝑡𝑡 = � ∞ 𝑡𝑡𝑡𝑡
∫−∞ 𝑒𝑒 𝑓𝑓 𝑥𝑥 𝑑𝑑𝑑𝑑
Properties
𝑑𝑑 𝑑𝑑 𝑡𝑡𝑡𝑡
ϕ′ (𝑡𝑡) = 𝐸𝐸 𝑒𝑒 𝑡𝑡𝑡𝑡 = 𝐸𝐸 𝑒𝑒 = 𝐸𝐸 𝑋𝑋𝑒𝑒 𝑡𝑡𝑡𝑡
𝑑𝑑𝑡𝑡 𝑑𝑑𝑑𝑑
𝑑𝑑 𝑑𝑑
ϕ 𝑡𝑡 = ϕ′ (𝑡𝑡) = 𝐸𝐸
′′
(𝑋𝑋𝑒𝑒 𝑡𝑡𝑡𝑡 ) = 𝐸𝐸 𝑋𝑋 2 𝑒𝑒 𝑡𝑡𝑡𝑡
𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑
ϕ(𝑛𝑛) 𝑡𝑡 = 𝐸𝐸 𝑋𝑋 𝑛𝑛 𝑒𝑒 𝑡𝑡𝑡𝑡
ϕ′ 0 = 𝐸𝐸 𝑋𝑋 , ϕ′′ 0 = 𝐸𝐸 𝑋𝑋 2 , ϕ(𝑛𝑛) 0 = 𝐸𝐸 𝑋𝑋 𝑛𝑛
An important property of moment generating functions is that the
moment generating function of the sum of independent random
variables is just the product of the individual moment generating
functions. To see this, suppose that X and Y are independent and
have moment generating functions φX(t) and φY(t), respectively.
Then φX+Y(t), the moment generating function of X + Y, is given by
φX+Y(t) = E[et(X+Y)]= E[etXetY]= E[etX]E[etY]= φX(t)φY(t)
Limit Theorems: Strong Law of Large
Numbers
Let X1, X2, . . . be a
Theorem 2.1 (Strong Law of Large Numbers)
sequence of independent random variables having
a common distribution, and let E[Xi] = μ. Then, with
𝑋𝑋1 +𝑋𝑋2 +⋯+𝑋𝑋𝑛𝑛
probability 1, → 𝜇𝜇
𝑛𝑛