NUFYP Mathematics: 7.1 Continuous Random Variables (CRV) - Part 1
NUFYP Mathematics: 7.1 Continuous Random Variables (CRV) - Part 1
NUFYP Mathematics
7.1
Continuous Random Variables (CRV)
– part 1
Foundation Year Program
Learning outcomes:
7.1.1 Define a probability density function of a
continuous random variable.
7.1.2 Define a cumulative distribution function
of a continuous random variable.
7.1.3 Find probabilities using a probability
density function or a cumulative distribution
function.
Foundation Year Program
3
Foundation Year Program
Recall:
Area of a bar = frequency density × class width
= 𝑘 × frequency
𝑛 = 100 → 𝑘 = 0.01
• 𝑓 𝑥 is a pdf.
Properties of pdf
If 𝑋 is a continuous random variable with pdf 𝑓(𝑥) then:
1. 𝑓 𝑥 ≥ 0 everywhere since we cannot have negative
probabilities.
𝑏
2. 𝑃 𝑎 < 𝑋 < 𝑏 = 𝑓 𝑎 𝑥 𝑑𝑥
∞
3. −∞ 𝑓 𝑥 𝑑𝑥 = 1
Foundation Year Program
Example 1
Which of the following could be a probability density
function?
Need to check:
(1) 𝑓 𝑥 ≥ 0
everywhere
∞
(2) −∞ 𝑓 𝑥 𝑑𝑥 = 1
Foundation Year Program
Solution
(a)
Start with a sketch of f(x) for the given values of x.
(b)
1
This is a pdf for 𝑘 = 4
For any values of 𝑘, some part of the graph is below the 𝑥-axis,
i.e., 𝑓 𝑥 < 0. Hence, this cannot be a pdf.
Foundation Year Program
Example 2
The random variable 𝑋 has probability density function:
a) Sketch 𝑓(𝑥).
b) Find the value of 𝑘.
Foundation Year Program
Solution
Total area =
+
1
= 𝑘 + × 2 × 4𝑘 = 5𝑘 = 1
2
1
So, 𝑘 =
5
Foundation Year Program
Your turn!
The random variable 𝑋 has probability density
function:
Solution
Foundation Year Program
Example 3
The random variable 𝑋 has the probability density
function:
3𝑥 2ൗ 0≤𝑥≤2
𝑓 𝑥 =ቐ 8,
0, otherwise
Solution
Remember from earlier that:
𝑏
𝑃 𝑎 < 𝑋 < 𝑏 = න 𝑓 𝑥 𝑑𝑥
𝑎
So, we need to integrate 𝑓(𝑥) between 0.5 and 1.2:
1.2 1.2
3𝑥 2 𝑥3
𝑃 0.5 ≤ 𝑋 ≤ 1.2 = න 𝑑𝑥 =
0.5 8 8 0.5
1.23 0.53
= − = 0.200375 = 0.20 (2 d.p.)
8 8
𝑥
𝐹 𝑥 = 𝑃(𝑋 ≤ 𝑥) = −∞ 𝑓(𝑡) 𝑑𝑡
We used 𝑥 already, so we
write 𝑓 as a function of 𝑡,
not 𝑥, to avoid confusion.
We call 𝑡 a dummy variable
Foundation Year Program
Example 4
The random variable X has probability density function:
Find
a) F(2.5), b) F(x).
Solution
𝑓(𝑥)
𝐹(2.5)
2.5 1 2.5
a) 𝐹 2.5 = −∞ 𝑓 𝑡 𝑑𝑡 = −∞ 𝑓 𝑡 𝑑𝑡 + 1 𝑓 𝑡 𝑑𝑡 =
2.5
t 2
= ( 2.5 − 1) =
2.5
1 1 2 21
0+න 𝑡 𝑑𝑡 =
1 4 8 1 8 32
Foundation Year Program
Solution
b) To find F(x) we need to use the definition:
𝑥
𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = න 𝑓 𝑡 𝑑𝑡
−∞
First, find 𝐹(𝑥) for 𝑥 < 1 and 𝑥 > 3, outside of the given
range.
For 𝑥 < 1,
𝑥 𝑥
𝐹 𝑥 = න 𝑓 𝑡 𝑑𝑡 = න 0 𝑑𝑡 = 0
−∞ −∞
For 𝑥 > 3,
𝑥 3 𝑥
𝐹 𝑥 = න 𝑓 𝑡 𝑑𝑡 = න 𝑓 𝑡 𝑑𝑡 + න 0 𝑑𝑡 = 1
−∞ −∞ 3
Foundation Year Program
b) For 1≤ 𝑥 ≤ 3,
Method 1 (definite int.) Method 2 (indefinite int.)
9 1
+ 𝐶 = 1, 𝐶=−
8 8
Foundation Year Program
0 ,𝑥 < 1
𝑥2 1
𝐹 𝑥 = ൞8 −8 ,1 ≤ 𝑥 ≤ 3
1 ,𝑥 > 3
Caution!
Don’t forget to define 𝐹(𝑥) over the whole range (−∞, ∞)
Foundation Year Program
Example 6
The random variable X has probability density function:
Find F(x).
This time f(x) has two parts defined and so we need to
consider the two parts separately. We can use either
method 1 or 2 as above; it is personal preference.
Foundation Year Program
Solution
From the range given in pdf, we know that 𝐹 𝑥 = 0 for
𝑥 ≤ 1 and 𝐹 𝑥 = 1 for 𝑥 > 4.
Let’s consider the range 1 < 𝑥 < 2
1 𝑥
𝐹 𝑥 = න 𝑓 𝑡 𝑑𝑡 + න 𝑓 𝑡 𝑑𝑡
−∞ 1
𝑥
= 0+ 1 0.2𝑑𝑡
= 0 + 0.2 𝑥 − 1 = 0.2(𝑥 − 1)
Note: A cdf of a continuous random variable is continuous.
This implies that we can write 1 ≤ 𝑥 ≤ 2 instead of 1 < 𝑥 < 2 for
𝐹 𝑥 = 0.2(𝑥 − 1)
Foundation Year Program
For 2 ≤ 𝑥 ≤ 4,
2 𝑥
𝐹 𝑥 = න 𝑓 𝑡 𝑑𝑡 + න 𝑓 𝑡 𝑑𝑡
−∞ 2
𝑥
= 𝐹 2 + න 𝑓 𝑡 𝑑𝑡 We find 𝐹(2) using
2 𝐹 𝑥 = 0.2 𝑥 − 1 for 1 < 𝑥 < 2
𝑥 𝑥
1 𝑡2 𝑡
= 0.2 2 − 1 + න 5
𝑡−1 𝑑𝑡 = 0.2 + −
10 5 2
2
𝑥2 𝑥 𝑥2 𝑥
= 0.2 + − −
10 5
0.4 − 0.4 = −
10 5
+15
Foundation Year Program
Example 7
The random variable X has cumulative distribution
function:
Solution
c) 𝑃 𝑋 = 1 = 0
Foundation Year Program
Solution (continued)
𝑑 1 3
d) 𝑓 𝑥 = 𝐹 𝑥 = + 𝑥,
𝑑𝑥 5 10
1 3
+ 𝑥 ,0 ≤ 𝑥 ≤ 2
𝑓 𝑥 = ൝5 10
0 , othewise
Note: we can solve (b) using a pdf as we saw in Example 3.
1.5 1 3 𝑥 3 2 1.5
𝑃 0.5 ≤ 𝑋 ≤ 1.5 = 0.5 5 + 𝑥 𝑑𝑥 = + 𝑥
10 5 20 0.5
1.5 3 2
0.5 3 2
= + 1.5 − + 0.5 = 0.5
5 20 5 20
Foundation Year Program
Learning outcomes:
7.1.1 Define a probability density function of a
continuous random variable.
7.1.2 Define a cumulative distribution function
of a continuous random variable.
7.1.3 Find probabilities using a probability
density function or a cumulative distribution
function.
Foundation Year Program
41