Contious Random Variable - 1
Contious Random Variable - 1
Random variables are discrete or continuous when the outcomes are discrete or continuous.
𝑝(𝑥) 𝑝(𝑥)
𝑥 𝑥
Examples: Poisson Distributed Examples: Normally Distributed
Binomially Distributed
Discrete Uniform Distribution
Properties: Area under graph is 1
Properties: σ 𝑝(𝑥) = 1 𝑝 𝑥 ≥ 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑥
𝑝 𝑥 ≥ 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑥
Probability Density Function (p.d.f.)
𝑓(𝑥)
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 𝐷𝑒𝑛𝑠𝑖𝑡𝑦
𝑥 𝑥 (ℎ𝑒𝑖𝑔ℎ𝑡)
For continuous variables, it doesn’t In the Normal Distribution (a continuous
make sense to talk about the distribution), similarly, it doesn’t make sense
frequency of a specific value, e.g. to talk about the probability of a specific
no one will have an exact height of value.
1.7m. We would instead use 𝒇(𝒙) is known as the probability density
‘frequency density’. function (or p.d.f. for short).
1 +
, 1
x 1 ≤𝑥 ≤ 2
f (x ) 2 3
0 otherwise
Probability Density Function (p.d.f.)
! If𝑋 is a continuous random variable with p.d.f. 𝑓 𝑥
then:
𝑓 𝑥 ≥ 0 (we can’t have negative probabilities)
𝑏
𝑃 𝑎 < 𝑋 < 𝑏 = 𝑎𝑟𝑒𝑎 𝑢𝑛𝑑𝑒𝑟 𝑔𝑟𝑎𝑝ℎ = 𝑥𝑑 𝑥 𝑓 𝑎
∞
−∞ 𝑓(𝑥) 𝑑𝑥 = 1 (as total area under curve is 1)
Note
P(X = r) = 0
P(a < X < b) = P(a ≤ X < b) = P(a < X ≤ b) = P(a ≤ X ≤ b)
Example
Sketch the following functions and decide whether they are valid pdfs.
x 2 0 x5 13 x 0 x3
(a) f x (b) f x
0 otherwise 0 otherwise
2 y
4 y
1.5
0.5
1
x
x
–1 1 2 3 4 5 6
–1 1 2 3 4
–1
–0.5
–2
–1
–3
–4
Calculation Rule
𝑏
P(a < 𝑥 < b) = 𝑎 𝑓 𝑥 𝑑𝑥
∞
P(𝑥 > 𝑎) = 𝑎 𝑓 𝑥 𝑑𝑥
𝑎
P(𝑥 < 𝑎) = −∞ 𝑓 𝑥 𝑑𝑥
To find integration
Definite Integral
𝑏
𝑏 𝑛 𝑥 𝑛+1
𝑥 𝑎dx = = 𝐼 𝑏 −𝐼 𝑎
𝑛+1 𝑎
𝑏
𝑏 𝑛 𝑎𝑥+𝑏 𝑛+1 1
𝑎 𝑎𝑥 + 𝑏 = × =𝐼 𝑏 −𝐼 𝑎
𝑛+1 𝑎 𝑎
Example - 1: A continuous random variable X
has the probability density function given by
2
𝑥 1 ≤𝑥 ≤ 2
𝑓(𝑥) = 3
0 otherwise
𝑥2 2
=⅔ [ ]1
2
2
= ⅓ [𝑥2] 1
= ⅓ × (4 – 1)
=1
b. 𝑃(1.5 ≤ 𝑋 ≤ 2)
𝑥2 2
=⅔ [ ]1.5
2
2
=⅓ [𝑥2] 1.5
= ⅓ × (4 – 2.25)
= 0.583 (3d.p)
Example 2: The continues random variables X
has probability density function given by
2
𝑓 𝑥 = 𝑘𝑥 1 ≤ 𝑥 ≤ 4
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Where, 𝑘 is constant.
a) Find the value of 𝑘.
b) Draw a sketch of the probability density
function.
c) Calculate 𝑃(2.5 ≤ 𝑋 ≤ 3.5).
Solution:
a) Find the value of 𝑘.
Total area under the curve
𝑏 4
𝑓 𝑎 𝑥 𝑑𝑥 = 1 𝑘𝑥 2 𝑑𝑥 =1
4
2
𝑘 න 𝑥 𝑑𝑥 = 1
1
𝑥3 4
𝑘 = 1
3 1
𝑘 4
3 = 1
𝑥
3 1
𝑘
3
43 − 13 = 1
21𝑘 = 1
1
𝑘= 21
b. Draw a sketch of the probability density
function
2 1 2
We have 𝑓 𝑥 = 𝑘𝑥 = 𝑥
21
𝒙 1 2 3 4
f 𝑥 1 4 9 16
21 21 21 21
2 y
1.5
0.5
–1 1 2 3 4
–0.5
–1
2 1 2
c) We have 𝑓 𝑥 = 𝑘𝑥 = 𝑥
21
3.5 1 2
𝑝 2.5 ≤ 𝑥 ≤ 3.5 = 2.5 𝑥 𝑑𝑥
21
3.5
1
= න 𝑥 2 𝑑𝑥
21 2.5
1 𝑥 3 3.5
=
21 3 2.5
1 3 3.5
= 𝑥 2.5
63
1
= 3.53 − 2.53
63
= 0.4325
= 0.433 (3 𝑠. 𝑓. )
Example 3
Solution
Example 4
Solution
Example 5
Solution
Median, Quartiles, Mean and Variance
For continuous random variable 𝑋 with p.d.f. defined by 𝑓 𝑥 for
( 𝑎 ≤ 𝑥 ≤ 𝑏).
If ‘M’ is Median then,
𝑀 1
P( 𝑋 ≤ 𝑀) = 𝑓 𝑎 𝑥 𝑑𝑥 =
2
If ‘Q1’ is Lower Quartile then,
𝑄 1
P(X ≤ Q1) 𝑎1 𝑓 𝑥 𝑑𝑥 = 4
If ‘Q3’ is Upper Quartile then,
𝑄3 3
P(X ≤ Q3) = 𝑎 𝑓 𝑥 𝑑𝑥 = 4
If E(X) is Mean then,
𝑏
Mean = E(X) = 𝜇 = 𝑎 𝑥 𝑓 𝑥 𝑑𝑥
If Var(X) is Variance
𝑏
Variance = Var(X) = 𝜎 2 = 𝑥 𝑎2 𝑓 𝑥 𝑑𝑥 - 𝐸(𝑋) 2
Example – 1 The continues random variables X
has probability density function given by
1
𝑓 𝑥 = 8 𝑥 0 ≤ 𝑥 ≤ 4
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
a) Find the median of 𝑋.
b) Find the Interquartile Range
Continuous Uniform Distribution 1
A continuous random variable where all values in a range are
equally likely is called a continuous uniform distribution.
A sketch of the p.d.f is a rectangle, and so it is sometimes
known as a rectangular distribution. Because the area under
the p.d.f curve must equal 1, it has the following p.d.f:
1
a xb
f ( x) b a
0 otherwise
ab
EX
2
b a
2
Var X
12
For Contionus Uniform (Triangular) Distirbution
The coordinate are (𝑎, 0) and (𝑏, 0)
1
Total Area of Tringular (A) = × 𝑏 × ℎ
2
1
1 = × (𝑏 − 𝑎) × ℎ
2
2
ℎ=
(𝑏−𝑎)
𝑦2 −𝑦1
To find slope of line 𝑙 (𝑚) =
𝑥2 −𝑥1
To find Equation of line 𝑙, 𝑦 − 𝑦1 = 𝑚(𝑥 − 𝑥1 ).
𝑚𝑥 + 𝑐 𝑎<𝑥<𝑏
𝑓 𝑥 =
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒