Lecture 05 - Random Variables
Lecture 05 - Random Variables
Lecture 05
Random Variables
Dr. Ramazan Çağlar
Random variable
Ω
ω4 ωn
ω1 ω2 …
ω3
X : Ω → ℝ
3
Lecture Notes 05 Random Variables
Why Random variable ?
A
XA
A = { ω: ω ∈ A } XA = { ω: ω ∈ XA }
Subset of Ω Subset of ℝ
A = { ω: ω ∈ XA }
Lecture Notes 05 Random Variables 6
Probability
(2) lim 𝐹𝑋 𝑥 = 1
𝑥 → +∞
(3) lim 𝐹𝑋 𝑥 = 0
𝑥 → −∞
(4) If 𝑥2 ≥ 𝑥1 ,
𝐹𝑋 𝑥1 ≤ 𝐹𝑋 𝑥2
‘’ 𝐹𝑋 𝑥 is a non-decreasing function ’’
Random Variables
Lecture Notes 05 10
Properties of the cdf
(7) 𝑃 𝑋 = 𝑏 = 𝐹𝑋 𝑏 − 𝐹𝑋 𝑏 −
The ‘’jump in the cdf at 𝑥 = 𝑏, gives
𝑃 𝑋=𝑏
Random Variables
Lecture Notes 05 11
Properties of the cdf
𝑃 𝑋 = 𝑏 = 𝐹𝑋 𝑏 − 𝐹𝑋 𝑏 −
The ‘’jump in the cdf at 𝑥 = 𝑏, gives 𝑃 𝑋 = 𝑏
Example:
𝑭𝑿 𝒙
1
𝐹𝑋 3
𝐹𝑋 2 , 𝐹𝑋 3−
𝐹𝑋 2−
𝐹𝑋 0
𝐹𝑋 −2
−2 −1 0 𝒙
1 2 3
𝑷 𝑿 ≤ −𝟐 𝑷 𝑿≤𝟎 𝑷 𝑿=𝟐 𝑷 𝑿=𝟑
𝐹𝑋 −2 𝐹𝑋 0 𝐹𝑋 2 − 𝐹𝑋 2− 𝐹𝑋 3 − 𝐹𝑋 3−
Random Variables
Lecture Notes 05 12
Example:
𝐹𝑋 𝑥 = 0 −∞<𝑥 ≤0
𝐹𝑋 𝑥 = 1 − 𝑒 −𝑥 0<𝑥≤∞
or with the another representation
This is the
0 −∞ < 𝑥 ≤ 0 ‘’exponential
𝐹𝑋 𝑥 = ቊ
1 − 𝑒 −𝑥 0<𝑥≤∞ distribution’’.
0 −∞ < 𝑥 ≤ 0
𝐹𝑋 𝑥 = ቊ
1 − 𝑒 −𝑥 0<𝑥≤∞
Random Variables
Lecture Notes 05 14
Example:
Expt: Toss a fair coin three times, and count number of
heads. Here, the random variable is the number of heads.
Ω = { HHH, HHT, THH, HTH, HTT, TTH, THT, TTT }
# of heads { 3, 2, 2, 2, 1, 1, 1, 0}
Outcomes Probability
1/2 H 3H 1/8
H T 2H 1/8
1/2
1/2
H 2H 1/8
1/2
H
1/2 1/2 T
T 1H 1/8
1/2
1/2 H 2H 1/8
1/2
1/2 H
T
1/2 T 1H 1/8
1/2 T 0H 1/8
6/8
P(X = 2) =3/8 The cdf is “ piecewise
5/8
P(X 1) =4/8
constant or shows a
4/8 “staircase behavior”.
3/8 Random variables with
2/8
P(X = 1) =3/8
such cdfs are called
discrete random variables.
1/8
P(X = 0) =1/8
x
0 1 2 3
Random Variables
Lecture Notes 05 17
Example:
Exponential cumulative distribution function (cdf)
0 𝑖𝑓 𝑥 < 0
𝐹𝑋 𝑥 = ቊ
1 − 𝑒 −𝑥 𝑖𝑓 𝑥 ≥ 0
FX (x)
1.0
x
0.0
Suppose that
0 𝑖𝑓 𝑥 < 0
𝐹𝑊 𝑥 =൝
𝑝 + (1 − 𝑝) 1 − 𝑒 −𝜆𝑥 𝑖𝑓 𝑥 ≥ 0
1.0
0.0 x
𝑭𝑿 𝒙 = න 𝒇𝑿 𝒕 𝒅𝒕
−∞
𝒃
𝑭𝑿 𝒃 −𝑭𝑿 𝒂 = 𝑷 𝒂 ≤ 𝑿 ≤ 𝒃 = න 𝒇𝑿 𝒕 𝒅𝒕
𝒂
When 𝑭𝑿 𝒙 is differentialable at x,
we obviously have
𝒅
𝒇𝑿 𝒙 = 𝑭𝑿 (𝒙)
𝒅𝒙
𝑭𝑿 𝒙+𝒉 −𝑭𝑿 𝒙 𝒅
As x 0, lim = 𝑭 𝒙 , therefore
∆𝒙→𝟎 ∆𝒙 𝒅𝒙 𝑿
𝒅
𝑷 𝒙 < 𝑿 ≤ 𝒙 + ∆𝒙 = ∆𝒙 ∙ 𝑭𝑿 𝒙
𝒅𝒙
= ∆𝒙 ∙ 𝒇𝑿 𝒙
Lecture Notes 05 Random Variables 24
fX (x)
Probability that X [ x, x +x ]
x
x
x x+x
Thus
P(X is in an interval of with x, in the vicinity of x ) x . fX (x)
𝑃 𝑎 < 𝑋 ≤ 𝑏 = න 𝑓𝑋 𝑡 𝑑𝑡
(2)
𝑎+
Careful with the limits !
+∞
(3) න 𝑓𝑋 𝑡 𝑑𝑡 = 1.0
−∞
Important note: For a continuous random variable X we have
for any a and b.
𝑃 𝑎≤𝑋≤𝑏 =𝑃 𝑎≤𝑋<𝑏 =𝑃 𝑎<𝑋≤𝑏 =𝑃 𝑎<𝑋<𝑏
Because 𝑃 𝑋 = 𝑥 = 0 for any 𝑥 ∈ ℝ
Random Variables
Lecture Notes 05 26
Independence of two random variables
𝐹𝑋,𝑌 𝑥, 𝑦 = 𝐹𝑋 𝑥 𝐹𝑌 (𝑦)
Random Variables
Lecture Notes 05 27
Example:
0 𝑖𝑓 𝑥 < 0
𝑓𝑋 𝑥 = ൝
𝜆𝑒 −𝜆𝑥 𝑖𝑓 𝑥 ≥ 0
x
7/8
6/8
5/8
4/8
3/8
2/8
1/8
x
0 1 2 3
7/8
6/8
5/8
4/8
3/8
2/8 discontinuities
1/8
x
0 1 2 3
1.0
0.5
0.0
- 0.2
-1.0 0.0 1.0
7/8
6/8
P(X = xi)
5/8 4/8
4/8 3/8
3/8 2/8
2/8
1/8
1/8 x
0 1 2 3
x
0 1 2 3
3/8 3/8
x x
0 1 2 3 0 1 2 3
1.0
0 𝑖𝑓 𝑥 < 0
𝐹𝑊 𝑥 =൝
𝑝 + (1 − 𝑝) 1 − 𝑒 −𝜆𝑥 𝑖𝑓 𝑥 ≥ 0 p
0.0 x
0 𝑥<0
𝑓𝑋 𝑥 = ቊ
𝑝𝛿 𝑥 + 𝜆𝑒 −𝜆𝑥 (1 − 𝑝) 𝑥 ≥ 0
x
0, 𝑥<0
𝒖 𝑥 =ቊ
1, 𝑥≥0
Then
𝐹𝑋 𝑥 = 𝒑𝑿 (𝑥𝑗 ) 𝒖(𝑥 − 𝑥𝑗 )
𝑗
and
𝑓𝑋 𝑥 = 𝒑𝑿 (𝑥𝑗 ) 𝜹(𝑥 − 𝑥𝑗 )
𝑗