Probability & Statistics I Chapter3: Continuous random variables
3-1- Definition
Definition 3.1 A random variable is said to be continuous if it takes its values from an
infinite set of uncountable points. For example, it describes the life of a car battery, the
arrival time of cars at a given motorway toll station, etc.
Definition 3.2 Let (Ω, 𝒜, ℙ) be a probability space, the random variable 𝑋 defined from
Ω into ℝ is said to be continuous if the set 𝑋(Ω) of its values is an interval or a union of
intervals in ℝ.
3-2- Probability density function of a continuous random variable
Definition 3.3 Let(Ω, 𝒜, ℙ) be a probability space, the random variable 𝑋 is said to be
absolutely continuous if there exists a function 𝑓 defined on ℝ with the following
properties:
- 𝑓(𝑋) ≥ 0;
∞
- ∫−∞ 𝑓(𝑋)𝑑𝑥 = 1.
The function 𝑓 is the probability density of the random variable 𝑋.
Properties 3.1 Let 𝑎 and 𝑏 ∈ ℝ
𝑏
• 𝑃(𝑎 ≤ 𝑥 ≤ 𝑏) = ∫𝑎 𝑓(𝑥)𝑑𝑥 ;
𝑎
• 𝑃(𝑥 ≤ 𝑎) = ∫−∞ 𝑓(𝑥)𝑑𝑥
• 𝑃(𝑋 = 𝑎) = 0;
+∞ 𝑎
• 𝑃(𝑥 > 𝑎) = ∫𝑎 𝑓(𝑥)𝑑𝑥 = 1 − ∫−∞ 𝑓(𝑥)𝑑𝑥
3-3- Distribution function of a continuous random variable
Definition 3.4 Let(Ω, 𝒜, ℙ) be a probability space, the distribution function of the
continuous random variable 𝑋 is the positive function 𝐹 defined by:
𝐹𝑋 ∶ ℝ → ℝ
𝑥 → 𝐹𝑋 (𝑥) = 𝑃(𝑋 ≤ 𝑥)
𝑥
= ∫−∞ 𝑓(𝑡)𝑑𝑡
Properties 3.2 The distribution function has the following properties:
• 𝐹 is continuous and increasing on ℝ;
• ℙ(𝑎 ≤ 𝑥 ≤ 𝑏) = 𝐹𝑋 (𝑏) − 𝐹𝑋 (𝑎) ;
• If 𝑓 is continuous at points 𝑥, so 𝑓(𝑥) = 𝐹𝑋′ (𝑥);
3-4- Expectation and variance of a continuous random variable
a- Moments of order 𝒓
Let 𝑋 be a continuous random variable and 𝑓 its density. Let 𝑟 be a natural number. 𝑋 is
said to have a moment of order 𝑟 if the function which at 𝑥 → 𝑥 𝑟 𝑓(𝑥) is integrable. In
this case the moment of order 𝑟 of 𝑋 is:
+∞
𝑚𝑟 (𝑋) = ∫ 𝑥 𝑟 𝑓(𝑥)𝑑𝑥
−∞
Dr. Sara Bouredja, bouredja@[Link] 1
Probability & Statistics I Chapter3: Continuous random variables
b- Expectation
The expectation of a continuous random variable 𝑋, denoted by 𝐸(𝑋), is the moment of
order 1 of the variable 𝑋:
+∞
𝐸(𝑋) = 𝑚1 (𝑋) = ∫ 𝑥𝑓(𝑥)𝑑𝑥
−∞
c- Variance
The variance of a continuous random variable 𝑋, is defined as follows :
𝑉(𝑋) = 𝐸(𝑥 2 ) − (𝐸(𝑋))2
∞ +∞ 2
𝑉(𝑋) = ∫ 𝑥 2 𝑓(𝑥)𝑑𝑥 − ( ∫ 𝑥𝑓(𝑥)𝑑𝑥)
−∞ −∞
d- Standard deviation
The standard deviation of a continuous random variable 𝑋, is defined as follows :
𝜎𝑋 = √𝑉(𝑋).
Example 3.1
Let 𝑋 be a continuous random variable with distribution (probability density function):
𝑥
, 0 ≤ 𝑥 ≤ 2;
𝑓(𝑥) = {2
0, 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
− Check that 𝑓(𝑥) is a probability density function.
− Calculate 𝐸(𝑋), 𝐸(𝑋 2 ), 𝑉(𝑋) et 𝜎𝑋 .
− Determine the distribution function.
− Calculate ℙ(1 ≤ 𝑥 ≤ 2.5).
Solution :
- We have :
2
+∞ 2 𝑥 𝑥2 4
∫−∞ 𝑓(𝑥)𝑑𝑥 = ∫0 2
𝑑𝑥 = [ 4 ] = − 0 = 1 so 𝑓 is a probability density.
4
0
2
+∞ 2 𝑥 2 𝑥2 𝑥3 8 4
- 𝐸(𝑋) = ∫−∞ 𝑥 𝑓(𝑥)𝑑𝑥 = ∫0 𝑥 2 𝑑𝑥 = ∫0 𝑑𝑥 = [ 6 ] = =
2 30 6
2
+∞ 2 𝑥 2 𝑥3 𝑥4 16
- 𝐸(𝑋 2 ) = ∫−∞ 𝑥 2 𝑓(𝑥)𝑑𝑥 = ∫0 𝑥 2 2 𝑑𝑥 = ∫0 2
𝑑𝑥 = [ 8 ] = −0=2
0 8
4 2 2
- 𝑉(𝑋) = 𝐸(𝑋 2 ) − 𝐸(𝑋)2 = 2 − ( ) = 9
3
2
- 𝜎𝑋 = √𝑉(𝑋) = √ = 0.47
9
- Distribution function :
𝐹𝑋 ∶ ℝ → ℝ
𝑥
𝑥 → 𝐹𝑋 (𝑥) = 𝑃(𝑋 ≤ 𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡.
• If 𝑥 < 0 ∶
𝑥 𝑥
𝐹𝑋 (𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡 = ∫−∞ 0 𝑑𝑡 = 0
• If 0 ≤ 𝑥 < 2 ∶
𝑥
𝐹𝑋 (𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡
Dr. Sara Bouredja, bouredja@[Link] 2
Probability & Statistics I Chapter3: Continuous random variables
0 𝑥
= ∫−∞ 𝑓(𝑡)𝑑𝑡 + ∫0 𝑓(𝑡)𝑑𝑡
0 𝑥𝑡
= ∫−∞ 0 𝑑𝑡 + ∫0 2
𝑑𝑡
𝑥
𝑡2 𝑥2
= [4] =
4
0
• If 𝑥 ≥ 2 ∶
𝑥
𝐹𝑋 (𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡
0 2𝑡 𝑥
= ∫−∞ 0 𝑑𝑡 + ∫0 𝑑𝑡 + ∫2 0 𝑑𝑡
2
2
𝑡2
= 0 + [4] + 0 = 1
0
0, 𝑥 < 0;
𝑥2
𝐹𝑋 (𝑥) = { , 0 ≤ 𝑥 < 2;
4
1, 𝑥 ≥ 2.
1 3
- ℙ(1 ≤ 𝑥 ≤ 2.5) = 𝐹𝑋 (2.5) − 𝐹𝑋 (1) = 1 − = 4
4
3-5- Continuous distribution
3-5-1- Uniform distribution
A continuous random variable 𝑋 follows a Uniform distribution over the interval [𝑎, 𝑏], if
its probability distribution has a density 𝑓 equal to:
1
𝑓(𝑥) = {𝑏 − 𝑎 , 𝑖𝑓 𝑥 ∈ [𝑎, 𝑏];
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
We note 𝑋 ↷ 𝒰[𝑎,𝑏]
a- Distribution function
The distribution function of a uniform distribution on [𝑎, 𝑏] is given by:
𝑥 𝑥
• If 𝑥 < 𝛼 ⟹ 𝐹𝑋 (𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡 = ∫−∞ 0𝑑𝑡 = 0;
𝑥
• If 𝑎 ≤ 𝑥 < 𝑏 ⟹ 𝐹𝑋 (𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡
𝑎 𝑥
= ∫−∞ 𝑓(𝑡)𝑑𝑡 + ∫𝑎 𝑓(𝑡)𝑑𝑡
𝑎 𝑥 1 𝑥−𝑎
= ∫−∞ 0𝑑𝑡 + ∫𝑎 𝑑𝑡 = ;
𝑏−𝑎𝑏−𝑎
𝑥
• If 𝑥 ≥ 𝑏 ⟹ 𝐹𝑋 (𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡
𝑎 𝑏 ∞
= ∫−∞ 𝑓(𝑡)𝑑𝑡 + ∫𝑎 𝑓(𝑡)𝑑𝑡 + ∫𝑏 𝑓(𝑡)𝑑𝑡
𝑎 𝑏 1 ∞
= ∫−∞ 0𝑑𝑡 + ∫𝑎 𝑏−𝑎 𝑑𝑡 + ∫𝑏 0𝑑𝑡 = 1
0, 𝑥 < 𝑎;
𝑥−𝑎
𝐹𝑋 (𝑥) = { , 𝑎 ≤ 𝑥 < 𝑏;
𝑏−𝑎
1, 𝑥 ≥ 𝑏.
b- Expectation
∞
𝑎+𝑏
𝐸(𝑋) = ∫ 𝑥𝑓(𝑥)𝑑𝑥 =
2
−∞
Dr. Sara Bouredja, bouredja@[Link] 3
Probability & Statistics I Chapter3: Continuous random variables
c- Variance and standard deviation
(𝑏−𝑎)2
𝑉(𝑋) = 𝐸(𝑋 2 ) − 𝐸(𝑋)2 = 12
(𝑏−𝑎)2
𝜎𝑋 = √𝑉(𝑋) = √ 12
3-5-2- Exponential distribution
A continuous random variable 𝑋 follows an exponential distribution, with positive
parameter 𝜆, if its probability density is given by :
𝜆𝑒 −𝜆𝑥 , 𝑖𝑓 𝑥 ≥ 0;
𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
We note 𝑋 ↷ ℰ(𝜆).
a- Distribution function
𝑥 𝑥
• If 𝑥 < 0 ⟹ 𝐹𝑋 (𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡 = ∫−∞ 0 𝑑𝑡 = 0;
𝑥
• If 𝑥 ≥ 0 ⟹ 𝐹𝑋 (𝑥) = ∫−∞ 𝑓(𝑡)𝑑𝑡
0 𝑥
= ∫−∞ 𝑓(𝑡)𝑑𝑡 + ∫0 𝑓(𝑡)𝑑𝑡
0 𝑥
= ∫−∞ 0 𝑑𝑡 + ∫0 𝜆𝑒 −𝜆𝑡 𝑑𝑡
= [−𝑒 −𝜆𝑡 ]0𝑥 = 1 − 𝑒 −𝜆𝑥
0, 𝑥 < 0;
𝐹𝑋 (𝑥) = {
1 − 𝑒 −𝜆𝑥 , 𝑥 ≥ 0;
b- Expectation
∞
1
𝐸(𝑋) = ∫ 𝑥𝑓(𝑥)𝑑𝑥 =
𝜆
−∞
c- Variance and standard deviation
2 1 2 1
𝑉(𝑋) = 𝐸(𝑋 2 ) − 𝐸(𝑋)2 = 2
−( ) =
𝜆 𝜆 𝜆2
1
𝜎𝑋 = √𝑉(𝑋) = √
𝜆2
Properties 3.3
- The random variable 𝑋, which follows an exponential distribution, is said to be
memoryless i.e., ℙ(𝑋 > 𝑠 + 𝑡 / 𝑋 > 𝑡) = ℙ(𝑋 > 𝑠), ∀𝑠, 𝑡 ≥ 0.
- The sum of two independent random variables following exponential distribution with
parameter 𝜆1 and 𝜆2 respectively is a random variable following an exponential
distribution with parameter (𝜆1+𝜆2 ).
3-5-3- Gamma distribution
A continuous random variable 𝑋 follows a Gamma distribution with parameters 𝑛 > 0
and 𝜆 > 0, if its probability density is given by:
Dr. Sara Bouredja, bouredja@[Link] 4
Probability & Statistics I Chapter3: Continuous random variables
𝑥 𝑛−1 𝑛 −𝜆𝑥
𝜆 𝑒 , 𝑖𝑓 𝑥 ≥ 0;
𝑓(𝑥) = { Γ(𝑛)
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒.
𝛤 is defined as:
+∞
𝛤(𝑛) = ∫−∞ 𝑥 𝑛−1 𝑒 −𝑥 𝑑𝑥 = (𝑛 − 1)! , 𝑛>0
We note 𝑋 ↷ Γ(𝑛, 𝜆).
a- Distribution function
𝑥 𝑥
𝑡 𝑛−1 𝑛 −𝜆𝑡
𝐹𝑋 (𝑥) = ℙ(𝑋 < 𝑥) = ∫ 𝑓(𝑡)𝑑𝑡 = ∫ 𝜆 𝑒 𝑑𝑡
Γ(𝑛)
−∞ 0
b- Expectation
𝑛
𝐸(𝑥) =
𝜆
c- Variance and standard deviation
𝑛
𝑉(𝑋) =
𝜆2
√𝑛
𝜎𝑋 = 𝜆
Properties 3.4
- If 𝑛 = 1 The Gamma distribution Γ(1, 𝜆) can be identified with the exponential
distribution ℰ(𝜆).
- The sum of two independent random variables, that follow Gamma distributions
𝑋 ↷ Γ(𝑛1 , 𝜆) and 𝑌 ↷ Γ(𝑛2 , 𝜆), follows a Gamma distribution 𝑋 + 𝑌 ↷ Γ(𝑛1 + 𝑛2 , 𝜆).
3-5-4- Chi-square distribution
2
The chi-squared distribution with 𝑘 degrees of freedom, denoted by 𝜒(𝑘) is a special case
𝑘 1
of Gamma distribution Γ (𝑛 = 2 , 2) where 𝑘 is a positive integer.
2 𝑘 1
We note: 𝑋 ↷ 𝜒(𝑘) ↷ Γ( , )
2 2
Example 3.2
1 2
𝑋 ↷ Γ (4, ) ↷ 𝜒(8)
2
a- Expectation and variance
𝑘
𝐸(𝑋) = 2 = 𝑘
1
2
𝑘
𝑉(𝑋) = 2 2 = 2𝑘
1
( )
2
3-5-5- Normal distribution
A real random variable 𝑋, taking its values in ℝ, follows Laplace-Gauss or normal
distribution, with parameters 𝑚 and 𝜎 , if its probability density is given by:
Dr. Sara Bouredja, bouredja@[Link] 5
Probability & Statistics I Chapter3: Continuous random variables
1 1 𝑥−𝑚 2
𝑒 − 2( )
𝑓(𝑥) = 𝜎 , 𝑥 ∈ ℝ.
𝜎√2𝜋
We note 𝑋 ↷ 𝒩(𝑚, 𝜎), Where:
𝑚 : expectation (mean)
𝜎 : standard deviation
a- Distribution function
𝑥 𝑥 𝑥
1 1 𝑡−𝑚 2 1 1 𝑡−𝑚 2
𝑒 −2( 𝜎 ) 𝑑𝑡 ∫ 𝑒 −2( )
𝐹𝑋 (𝑥) = ℙ(𝑋 < 𝑥) = ∫ 𝑓(𝑡)𝑑𝑡 = ∫ = 𝜎 𝑑𝑡.
𝜎√2𝜋 𝜎√2𝜋
−∞ −∞ −∞
b- Expectation
𝐸(𝑋) = 𝑚
c- Variance and standard deviation
𝑉(𝑋) = 𝜎 2
𝜎𝑋 = 𝜎
Property 3.5
- The sum of two independent random variables, that follow Normal
distributions 𝑋 ↷ 𝑁(𝑚1 , 𝜎1 ) and 𝑌 ↷ 𝑁(𝑚2 , 𝜎2 ), follows a Normal distribution
𝑋 + 𝑌 ↷ 𝑁 (𝑚1 + 𝑚2 , √𝜎12 + 𝜎22 ).
3-5-6- Standard normal distribution (Z-distribution)
The simplest case of a normal distribution is known as the standard normal distribution
or Z-distribution. This is a special case when 𝑚 = 0 and 𝜎 = 1 and it is described by the
following probability density:
1 1 2
𝑓(𝑥) = 𝑒 −2𝑥 , 𝑥∈ℝ
√2𝜋
we note 𝑋 ↷ 𝒩(0,1).
How to calculate a z-score?
Let 𝑋 be a random variable follows a normal distribution with parameters 𝑚 and 𝜎,
𝑋−𝑚
𝑋 ↷ 𝒩(𝑚, 𝜎), so the random variable 𝑍 = follows a standard normal distribution.
𝜎
𝑋−𝑚
𝑍= ↷ 𝑁(0,1)
𝜎
Dr. Sara Bouredja, bouredja@[Link] 6
Probability & Statistics I Chapter3: Continuous random variables
Example 3.3
𝑋 ↷ 𝑁(1,2)
𝑋 − 1 2.5 − 1
𝑃(𝑋 ≤ 2.5) = 𝑃 ( ≤ ) = 𝑃(𝑍 ≤ 0.75)
2 2
a- Distribution function
𝑧
1 𝑡2
∅(𝑧) = 𝐹𝑍 (z) = ℙ(𝑍 ≤ 𝑧) = ∫ 𝑒 − 2 𝑑𝑡.
√2𝜋
−∞
Where the calculation of this integral is too time-consuming, to avoid calculations we use
the table of the z- distribution to calculate the probability (the values of 𝐹𝑍 (z) are
tabulated).
This table shows the value of 𝑃(𝑍 ≤ 𝑡) where 𝑍 ↷ 𝑁(0,1). The 1st column indicates the
first digit after the decimal point of 𝑡 and the 1st row indicates the second digit after the
decimal point.
Example 3.4
To find the cumulative probability of a z-score equal to 1.21, cross-reference the row
containing 1.2 of the table with the column holding 0.01.
The table explains that: 𝑃(𝑍 < 1.21) = 0.88686.
Properties 3.6
Let 𝑍 a random variable that follow a standard normal distribution 𝑁(0,1), and 𝐹𝑍 its
distribution function so:
- 𝑃(𝑍 > 𝑡) = 1 − 𝑃(𝑍 ≤ 𝑡) = 1 − 𝐹𝑍 (𝑡)
- 𝐹𝑍 (−𝑡) = 1 − 𝐹𝑍 (𝑡) , 𝑡 > 0 . This is because normal density is symmetric.
- 𝑃(𝑎 ≤ 𝑍 ≤ 𝑏) = 𝐹𝑍 (𝑏) − 𝐹𝑍 (𝑎). ∀ 𝑎 and 𝑏 ∈ ℝ , with 𝑎 < 𝑏.
- 𝑃(−𝑡 ≤ 𝑍 ≤ 𝑡) = 𝐹𝑍 (𝑡) − 𝐹𝑍 (−𝑡) = 𝐹𝑍 (𝑡) − (1 − 𝐹𝑍 (𝑡)) = 2 𝐹𝑍 (𝑡) − 1, with 𝑡 ≥ 0.
Example 3.5
The speeds of cars are measured using a radar unit, on a motorway. The speeds are
normally distributed with a mean of 90 km/hr and a standard deviation of 10 km/hr.
- What is the probability that a car selected at chance is moving at more than 100
km/hr
Let the speed of cars is represented by a random variable X.
Given mean, 𝑚 = 90 and standard deviation, 𝜎 = 10.
𝑃(𝑋 > 100) = 1 − 𝑃(𝑋 ≤ 100)
𝑋−90 100−90
= 1−𝑃( ≤ )
10 10
= 1 − 𝑃(𝑍 ≤ 1)
= 1 − 𝐹𝑍 (1)
= 1 − 0.8413
= 0.1587
Example 3.6
𝑃(𝑍 ≤ −2) = 𝐹𝑍 (−2) = 1 − 𝐹𝑍 (2) = 1 − 0.97725 = 0.02275
Dr. Sara Bouredja, bouredja@[Link] 7
Probability & Statistics I Chapter3: Continuous random variables
Example 3.7
For some computers, the time period between charges of the battery is normally
distributed with a mean of 50 hours and a standard deviation of 15 hours. Rohan has one
of these computers and needs to know the probability that the time period will be
between 50 and 70 hours.
Let x be the random variable that represents the time period.
Given Mean, 𝑚 = 50 and standard deviation, 𝜎 = 15
50 − 50 𝑋 − 𝑚 70 − 50
𝑃( 50 < 𝑋 < 70) = 𝑃 ( < < )
15 𝜎 15
= 𝑃(0 < 𝑍 < 1.33)
= 𝐹𝑍 (1.33) − 𝐹𝑍 (0)
From the table we get the value, such as;
𝑃( 0 < 𝑧 < 1.33) = 0.9082 – 0.5 = 0.4082
The probability that Rohan’s computer has a time period between 50 and 70 hours is
equal to 0.4082.
b- Expectation and variance
𝑋−𝑚
Let 𝑋 be a random variable with a normal distribution 𝒩(𝑚, 𝜎), and let 𝑍 = be the
𝜎
variable that follows a standard normal distribution 𝒩(0,1).
𝑋−𝑚 1
𝐸(𝑍) = 𝐸 ( ) = (𝐸(𝑋) − 𝑚) = 0
𝜎 𝜎
𝑋−𝑚 1 𝑉(𝑋) 𝜎2
𝑉(𝑍) = 𝑉 ( )=
𝜎2
𝑉(𝑋 − 𝑚) =
𝜎2
= 𝜎2 = 1
𝜎
Property 3.7
- If 𝑋1 , … , 𝑋𝑛 are 𝑛 random variables that follow a standard normal distribution, so the
sum of their squares 𝑋12 + ⋯ + 𝑋𝑛2 follows a Chi-squared distribution with 𝑛 degrees of
freedom.
Dr. Sara Bouredja, bouredja@[Link] 8