Chapter 3
Chapter 3
Chapter 3
1
A random variable may be either discreet or continuous.
X Possible values of X
Number of dots appear when tossing a die 0, 1, 2, 3, 4, 5, 6
Number of books in a bag 0, 1, 2, 3, 4, 5, 6, 7, 8, ....
Number of students in a class 0, 1, 2, 3, 4, 5, 6, 7, 8, ….
2
Theory 1
The probability distribution of a discrete random variable 𝑋 is described
as the function 𝑃(𝑋=𝑥) = 𝑃(𝑥) which satisfies:
• 0≤𝑃 𝑥 ≤1
• ∑ 𝑃 𝑋 =1
• 𝑃 𝑥 = 𝑃(𝑋 = 𝑥 )
Example 3.1
3
x -1 0 1 2 3
P(X=x) 1/8 2/8 2/8 2/8 1/8
x -1 0 1 2 3
P(X=x) 1/8 2/8 2/8 2/8 1/8
4
Cumulative Distribution of Discreet Random Variables
It is a function giving the probability that the random variable X is less
than or equal to x, for every value x.
For a discrete random variable, the cumulative distribution function is
found by summing up the probabilities.
Theory 2
The cumulative distribution function of a discrete random variable X is
described as the function 𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = ∑ 𝑃(𝑋 = 𝑥) which
satisfies:
10
5
Theory 3
The cumulative distribution function of a discrete random variable 𝑋
can be calculated by using the following formula:
• 𝑃 𝑋≤𝑟 =𝐹 𝑟
• 𝑃 𝑋 > 𝑟 =1−𝐹 𝑟
• 𝑃 𝑋 <𝑟 =𝑃 𝑋 ≤𝑟−1 =𝐹 𝑟−1
• 𝑃 𝑋 =𝑟 =𝐹 𝑟 −𝐹 𝑟−1
• 𝑃 𝑟 < 𝑋 ≤ 𝑠 =𝐹 𝑠 −𝐹 𝑟
• 𝑃 𝑟 ≤ 𝑋 ≤ 𝑠 =𝐹 𝑠 −𝐹 𝑟 +𝑓 𝑟
• 𝑃 𝑟 ≤ 𝑋 < 𝑠 =𝐹 𝑠 −𝐹 𝑟 +𝑓 𝑟 −𝑓 𝑠
• 𝑃 𝑟 < 𝑋 < 𝑠 = 𝐹 𝑠 − 𝐹 𝑟 − 𝑓(𝑠)
11
Example 3.2
x -2 -1 0 1 2
P(X=x) 0.12 0.22 0.24 0.23 0.19
12
6
x -2 -1 0 1 2
P(X=x) 0.12 0.22 0.24 0.23 0.19
𝟎, 𝑿 < −𝟐
𝟎. 𝟏𝟐, −𝟐 ≤ 𝑿 < −𝟏
𝟎. 𝟑𝟒, −𝟏 ≤ 𝑿 < 𝟎
𝑭 𝒙 =
𝟎. 𝟓𝟖, 𝟎≤𝑿<𝟏
𝟎. 𝟖𝟏, 𝟏≤𝑿<𝟐
𝟏, 𝑿≥𝟐
13
Or alternatively:
x < -2 -2 -1 0 1 >2
P(X=x) 0 0.12 0.22 0.24 0.23 0.19
F(x) 0 0.12 0.34 0.58 0.81 1
𝟎, 𝑿 < −𝟐
𝟎. 𝟏𝟐, −𝟐 ≤ 𝑿 < −𝟏
𝟎. 𝟑𝟒, −𝟏 ≤ 𝑿 < 𝟎
𝑭 𝒙 =
𝟎. 𝟓𝟖, 𝟎≤𝑿<𝟏
𝟎. 𝟖𝟏, 𝟏≤𝑿<𝟐
𝟏, 𝑿≥𝟐
14
7
Example 3.3
0, 𝑋 < −1
0.08, −1 ≤ 𝑋 < 2
𝐹 𝑥 = 0.36, 2 ≤ 𝑋 < 5
0.67, 5 ≤ 𝑋 < 7
1, 𝑋≥7
15
0, 𝑋 < −1
0.08, −1 ≤ 𝑋 < 2
𝐹 𝑥 = 0.36, 2 ≤ 𝑋 < 5
0.67, 5 ≤ 𝑋 < 7
1, 𝑋≥7
x F(x) P(X=x)
-1 0.08 0.08 – 0 = 0.08
2 0.36 0.36 – 0.08 = 0.28
5 0.67 0.67 – 0.36 = 0.31
7 1 1 – 0.67 = 0.33
16
8
Mean of a Probability Distribution
It is the weighted average over all possible outcomes, with the weight
for each outcome being the relative frequency or probability associated
with that outcome.
Theory 4
Mean (or expected value) of a probability distribution is
17
Theory 5
Variance of a probability distribution is
𝜎 = 𝑉𝑎𝑟 𝑋 = 𝐸 𝑋 − 𝐸 𝑋
where 𝑋 = the i-th outcome of X
𝐸 𝑋 = 𝑋 . 𝑃(𝑋 ) 𝑃 𝑋 = the probability of occurrence of the i-th
outcome of X
i = 1, 2, 3, ….
18
9
Theory 6
Standard deviation of a probability distribution is
𝜎 = 𝑠𝑡𝑑 𝑋 = 𝑉𝑎𝑟(𝑋)
Note: 𝐸 𝑎𝑋 + 𝑏 = 𝑎𝐸 𝑥 + 𝑏
𝑉𝑎𝑟 𝑎𝑋 + 𝑏 = 𝑎 𝑉𝑎𝑟 𝑥 + 𝑉𝑎𝑟 𝑏 = 𝑎 𝑉𝑎𝑟 𝑥 + 0
19
Example 3.4
x -1 0 1 2 3
P(X=x) 0.34 0.23 0.12 0.15 k
20
10
x -1 0 1 2 3
P(X=x) 0.34 0.23 0.12 0.15 0.16
Mean, E(X)
E(X) = S x P(X) = -1(0.34) + 0(0.23) + 1(0.12) + 2(0.15) + 3(0.16)
= 0.56
E(X2) = S x2 P(X) = (-12)(0.34) + (02)(0.23) + (12)(0.12) + (22)(0.15)
+ (32)(0.16)
= 2.5
Var(X) = E(X2) – [E(X)]2 = 2.5 – (0.56)2 = 2.19
Std(X) = √Var(X) = √2.19 = 1.48
21
X Possible values of X
Height of Year 5 primary school students 130 cm < x < 160 cm
Time taken to complete a 20-minute quiz 1 minute < x < 20 minutes
Distance between two cities 10 km < x < 20,010 km
22
11
Theory 7
Properties of the Probability Density Function (pdf), i.e. f(x), of
Continuous Random Variables:
• 𝑓(𝑥) ≥ 0
• ∫ 𝑓 𝑥 𝑑𝑥 = 1
23
Example 3.5
3
𝑓 𝑥 = 4 2𝑥 − 𝑥 , 0 < 𝑥 < 2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
24
12
(a) P(X > 1) = P(1 < X < 2)
3 3 𝑥 3 2 1
2𝑥 − 𝑥 𝑑𝑥 = 𝑥 − = 2 − − 1 −
4 4 3 4 3 3
3 8 1
= 4− − 1−
4 3 3
= 0.50
25
3 3 𝑥 3 1 0
2𝑥 − 𝑥 𝑑𝑥 = 𝑥 − = 1 − − 0 −
4 4 3 4 3 3
3 1
= 1− − 0
4 3
= 0.50
26
13
(c) P(0.5 < X < 2)
3 3 𝑥 3 2 0.5
2𝑥 − 𝑥 𝑑𝑥 = 𝑥 − = 2 − − 0.5 −
. 4 4 3 .
4 3 3
3 8 0.5
= 4− − 0.5 −
4 3 3
= 0.75
27
Example 3.6
2𝑐 , 0≤𝑥≤2
𝑓 𝑥 = 2𝑐 2𝑥 − 3 , 2≤𝑥≤3
0, 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
28
14
2𝑐 , 0≤𝑥≤2
𝑓 𝑥 = 2𝑐 2𝑥 − 3 , 2≤𝑥≤3
0, 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
∫ 2𝑐 𝑑𝑥 = 1
2𝑐 𝑥 = 1
2𝑐 2 − 0 = 1
4𝑐 = 1
𝟏
𝑐=
𝟒
29
2𝑐 , 0≤𝑥≤2
𝑓 𝑥 = 2𝑐 2𝑥 − 3 , 2≤𝑥≤3
0, 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
1 1 𝑥 1 𝟏
2 𝑑𝑥 = 𝑑𝑥 = = −0=
4 2 2 2 𝟐
30
15
2𝑐 , 0≤𝑥≤2
𝑓 𝑥 = 2𝑐 2𝑥 − 3 , 2≤𝑥≤3
0, 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
1 3
2 (2𝑥 − 3) 𝑑𝑥 = (𝑥 − ) 𝑑𝑥
. 4 . 2
3 𝑥 3𝑥 (3) 3(3) 2.5 3 2.5
𝑥− 𝑑𝑥 = − = − − −
. 2 2 2 .
2 2 2 2
= 0.625
31
𝐹 𝑥 =𝑃 𝑋≤𝑥 = 𝑓𝑡
Again, F(x) accumulates all of the probability less than or equal to x. The
cumulative distribution function for continuous random variables is just a
straightforward extension of that of the discrete case.
All we need to do is replace the summation with an integral.
32
16
Theory 8
The cumulative distribution function of a continuous random variable 𝑋
is described as the function:
33
Example 3.7
𝑥
𝑓 𝑥 = 8, 0<𝑥<4
0, 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
34
17
𝑥
𝑓 𝑥 = 8, 0<𝑥<4
0, 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
𝑥 𝑥 𝑥 𝑥
𝑑𝑥 = = −0 =
8 16 16 16
0, 𝑥<0
𝐹 𝑥 = 𝑥 /16, 0 ≤ 𝑥 < 4
1, 𝑥≥4
35
0, 𝑥<0
𝐹 𝑥 = 𝑥 /16, 0 ≤ 𝑥 < 4
1, 𝑥≥4
2
(a) P(X < 2) = P(X < 2) = F(2) = = 𝟎. 𝟐𝟓
16
1
(b) P(X > 1) = 1 – P(X < 1) = 1 – F(1) = 1 − = 𝟎. 𝟗𝟑𝟕𝟓
16
36
18
Mean, Variance and Standard Deviation of Continuous
Random Variables
Theory 9
The mean (or expected value) of a continuous random variable 𝑋 is:
𝜇=𝐸 𝑋 = 𝑥. 𝑓 𝑥 𝑑𝑥
37
Theory 10
The variance of a continuous random variable 𝑋 is:
𝜎 = 𝑉𝑎𝑟 𝑋 = 𝐸 𝑋 − 𝐸(𝑋)
where 𝐸 𝑋 = 𝑥 . 𝑓 𝑥 𝑑𝑥
Theory 11
The standard deviation of a continuous random variable 𝑋 is:
𝜎 = 𝑆𝑡𝑑 𝑋 = 𝑉𝑎𝑟(𝑋)
38
19
Example 3.8
The continuous random variable 𝑋 has the pdf given below. Determine
the mean and variance.
𝑥
𝑓 𝑥 = 8, 0<𝑥<4
0, 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Mean
𝑥 𝑥 𝑥 4
𝐸 𝑋 = 𝑥 𝑑𝑥 = 𝑑𝑥 = = − 0 = 𝟐. 𝟔𝟔𝟕
8 8 24 24
39
Variance
𝑥 𝑥 𝑥 4
𝐸 𝑋 = 𝑥 𝑑𝑥 = 𝑑𝑥 = = − 0 = 8.0
8 8 32 32
40
20