Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

COURTESY OF MICHELLE OWINO

LESSON ONE
RANDOM VARIABLES
1.1 Introduction
In this lesson we will discuss the definition of a random variable, types of
random variables and their probability distributions.
1.2 Lesson Learning Outcomes
By the end of this lesson the learner will be able to:
i. Define a random variable
ii. State types of random variables
iii. Obtain the probability distributions of discrete and continuous
random variables.
1.3 Random variables
Let S be a sample space representing the outcomes of a statistical experiment.
Then we can define a random variable as follows:
A random variable X is a real valued function defined on S, that is
𝑿∶𝑺→ℝ
Capital letters are used to denote random variables while small letters are
used to denote respective values of the random variables.
Example 1.1: Suppose that three boys are selected at random from a school
parade and each is asked whether he smokes (S) or he does not (N). Then the
sample space of this random experiment is given by
𝑆 = {𝑆𝑆𝑆, 𝑆𝑆𝑁, 𝑆𝑁𝑆, 𝑁𝑆𝑆, 𝑆𝑁𝑁, 𝑁𝑆𝑁, 𝑁𝑁𝑆, 𝑁𝑁𝑁}
Let X denote the number of smokers among three chosen boys. Then
𝑋(𝑆𝑆𝑆) = 3, 𝑋(𝑆𝑆𝑁 = 𝑋(𝑆𝑁𝑆) = 𝑋(𝑁𝑆𝑆) = 2,
𝑋(𝑆𝑁𝑁) = 𝑋(𝑁𝑆𝑁) = 𝑋(𝑁𝑁𝑆) = 1, 𝑋(𝑁𝑁𝑁) = 0.
Therefore, X is a random variable which takes the values 0,1,2,3.
Example 1. 2 : Suppose that a real number is selected at random in the closed
interval [0,2]. Let X denote the number so chosen. Then X is a random variable
with possible values , 0 ≤ 𝑥 ≤ 2.
COURTESY OF MICHELLE OWINO

There are two types of random variables namely discrete and continuous
random variables.
1.3.1 : Discrete Random Variables

A random variable is said to be discrete if it assumes only a finite or


countable number of values on the real line. e.g , the random variable
described in example 1.1
A discrete random variable assumes each of its values with a certain
probability. In example 1 if we assume that all the outcomes are equally
likely then the random variable X takes the values 0,1,2,3 with the
following probabilities:

1
P(X=0) =P{NNN} = ,
8
3
P(X=1) =P{SNN, NSN,NNS} = ,
8
3
P(X=2) =P{SSN, SNS,NSS} = ,
8
1
and P(X=3) =P{SSS} = .
8
We can write these probabilities in a table form as follows:

x 0 1 2 3
P(X=x) 1 3 3 1
8 8 8 8

NB: P(X=0) + P(X=1) + P{X=2) +P (X=3) =1.


The above table represents a probability distribution of the random
variable X.
Let X be a discrete random variable, then the probability distribution of X is
a real valued function f(x) of x, defined by

𝑓(𝑥) = 𝑃(𝑋 = 𝑥)
and satisfying the following conditions:
(𝑖) 𝑓(𝑥) ≥ 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑥

(𝑖𝑖) ∑𝑥=∞
𝑥=−∞ 𝑓(𝑥) = 1.
COURTESY OF MICHELLE OWINO

Example 1.3: A digit is selected at random from among the digits


0,1,2,3,4,5,6,7. Let X denote the digit so selected. What is the probability
distribution of X?

Solution
1
𝑃(𝑋 = 𝑥) = 8 , 𝑥 = 0,1,2,3,4,5,6,7

and 𝑃(𝑋 = 𝑥) = 0 , 𝑥 ∉ {0,1,2,3,4,5,6,7}


Therefore, the probability distribution of X is by

1
, 𝑥 = 0,1,2,3,4,5,6,7
𝑓(𝑥) = {8
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Obviously 𝑓(𝑥) ≥ 0 and ∑=9
𝑥=0 𝑓(𝑥) = 1.

A probability distribution given by


1
, 𝑥 = 1,2,. . . , 𝑛
𝑓(𝑥) = {𝑛
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
is known as a discrete uniform distribution.
Example 1. 4 Let X be a discrete random variable whose set of values is the
set of all non-negative integers. Show that the function 𝑓(𝑥) given by
1
, 𝑥 = 0,1,2,. . .
𝑓(𝑥) = { 2𝑥+1
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
is a probability distribution.
Solution
1 1 1 1
𝑓(𝑥) ≥ 0 , for all x and ∑∞ ∞
𝑥=0 𝑓(𝑥) = ∑𝑥=0 = + + +. . . = 1. Hence
2𝑥+1 2 4 8
𝑓(𝑥) is a probability distribution.

Example 1.5 Let X be a discrete random variable whose probability


distribution is given by
COURTESY OF MICHELLE OWINO

𝑘𝑥, 𝑥 = 2,3,4,5,6
𝑓(𝑥) = {
0, 0𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Obtain the value of the constant k.
Solution
Since 𝑓(𝑥) is a probability distribution, then
∑6𝑥=2 𝑓(𝑥) = 1
∑6𝑥=2 𝑘𝑥 = 1
2𝑘 + 3𝑘 + 4𝑘 + 5𝑘 + 6𝑘 = 1
20𝑘 = 1
1
𝑘=
20

1.3.2 : Continuous Random Variables

A random variable is said to be continuous if it can assume any value in an


interval of the real line 𝑹. Therefore, a continuous random variable assumes
an uncountable number of values. Example 1.2 describes a continuous
random variable.
Let X be a continuous random variable assuming values in 𝑹. A continuous
real valued function 𝑓(𝑥) is said to be a probability density function (p.d.f)
or simply a probability distribution, of the random variable X if it satisfies the
following conditions:
(𝑖) 𝑓(𝑥) ≥ 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑟𝑒𝑎𝑙 𝑥


(𝑖𝑖) ∫−∞ 𝑓(𝑥) 𝑑𝑥 = 1.

𝑏
NB: 𝑃(𝑎 ≤ 𝑋 ≤ 𝑏) = ∫𝑎 𝑓(𝑥).

Example 1.6 Let X be a continuous random variable. Show that the function

1
𝑥, 0 ≤ 𝑥 ≤ 2
𝑓(𝑥) = {2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
1
is a p.d.f of X. Hence calculate 𝑃 ( ≤ 𝑋 ≤ 1) and 𝑃(−1 ≤ 𝑋 ≤ 1).
2
COURTESY OF MICHELLE OWINO

Solution
2 21
Clearly 𝑓(𝑥) ≥ 0, for all real x and ∫0 𝑓(𝑥) = ∫0 𝑥 𝑑𝑥 = 1, Hence 𝑓(𝑥) is
2
a p.d.f.
1 11 3
𝑃 ( ≤ 𝑋 ≤ 1) = ∫1 𝑥 𝑑𝑥 = and
2 2 2 16

0 1 1 1
𝑃(−1 ≤ 𝑋 ≤ 1) = ∫−1 𝑓(𝑥)𝑑𝑥 + ∫0 𝑓(𝑥)𝑑𝑥 = 0 + = .
4 4

Example 1.7 Let X be a continuous random variable whose p.d.f is given by

1
𝑘𝑥 + , 0 ≤ 𝑥 ≤ 3
𝑓(𝑥) = { 30
0, 𝑒𝑠𝑙𝑒𝑤ℎ𝑒𝑟𝑒
Where k is a constant. Calculate the value of k hence compute 𝑃(1 ≤ 𝑋 ≤ 2).
Solution

3
∫0 𝑓(𝑥) 𝑑𝑥 = 1 since 𝑓(𝑥) is a p.d.f
3
1
∫ (𝑘𝑥 + ) 𝑑𝑥 = 1
30
0
1
𝑘= .
5
1 1
𝑥+ , 0≤𝑥≤3
Therefore 𝑓(𝑥 ) = {5 30 and hence
0, 𝑒𝑠𝑙𝑒𝑤ℎ𝑒𝑟𝑒
2
1 1 1
𝑃(1 ≤ 𝑋 ≤ 2) = ∫ ( 𝑥 + ) 𝑑𝑥 =
5 30 3
1

𝑐, 𝑎 < 𝑥 < 𝑏
Example 1.8 Let 𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
be a p.d.f of a continuous random variable X. Find the value of the constant c.
COURTESY OF MICHELLE OWINO

Solution
𝑏
∫𝑎 𝑓(𝑥)𝑑𝑥 = 1 since 𝑓(𝑥) is a p.d.f of X.

𝑏
∫𝑎 𝑐 𝑑𝑥 = 1
1
𝑐=
𝑏−𝑎
1
, 𝑎<𝑥<𝑏
Therefore 𝑓(𝑥) = {𝑏−𝑎
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
And such a distribution is known as rectangular density function on the interval
(a,b). If a=0 and b=1, then we have

1, 0 < 𝑥 < 1
𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
as the uniform density function on the unit interval (0,1).

EXERCISES
2
(1 + 𝑥), 4 ≤ 𝑥 ≤ 7
1. If 𝑓(𝑥) = {39
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
is a p.d.f of a continuous random variable X calculate 𝑃(𝑋 < 5) and
𝑃(5 ≤ 𝑋 ≤ 6.5).

𝑘𝑥𝑒 −𝑥 , 𝑥 > 0
2. Let 𝑓(𝑥) = {
0, 𝑥 ≤ 0
be a p.d.f of X. Find the value of the constant k. Hence determine 𝑃(𝑋 < 5)
and 𝑃(𝑋 ≥ 10).

3. A discrete random variable X can take the values 0,1,2,3,4,5,6,7,8. Its


probability distribution is given by

x 0 1 2 3 4 5 6 7 8 9
f(x) 0.02 0.1p 0.2p 0.05 0.1 0.7p 0.2 0.9p 0.15 0.3p
Determine the value of the constant p and find 𝑃(𝑋 < 5) and 𝑃(3 ≤ 𝑋 ≤ 7).
COURTESY OF MICHELLE OWINO

References

1. Introduction to the Theory of Statistics by A.M. Mood, F.A. Graybill and D.C.
Boes .
2. Probability and Statistics by Rao V. Dukkip

LESSON TWO
DISTRIBUTION FUNCTIONS

2.1: Introduction
In this lesson will use the probability distributions we discussed in lesson one
to determine the distribution functions of both discrete and continuous
random variables.
2.2: Lesson Learning Outcome
By the end of this lesson learner will be able to determine the probability
distributions of discrete and continuous random variables

2.3: Distribution Functions

Let X be a random variable defined on a sample space S. Let us consider the


event E that satisfies −∞ < 𝑋 ≤ 𝑥, where 𝑥 is any real number, then
𝑃(𝐸) = 𝑃(𝑋 ∈ 𝐸)
COURTESY OF MICHELLE OWINO

= 𝑃(−∞ < 𝑋 ≤ 𝑥) = 𝑃(𝑋 ≤ 𝑥)

Thus, we may write


𝐹(𝑥) = 𝑃(𝑋 ≤ 𝑥)
The function 𝐹(𝑥) is called the distribution function or cumulative distribution
function (c.d.f) of the random variable X.

2.3.1 : Distribution function of a discrete random variable

If X is a discrete random variable with probability distribution (𝑥) , then its


distribution function is given by

𝐹(𝑥) = ∑𝑡≤𝑥 𝑓(𝑡)


Example 2.1
Let X be a discrete random variable with probability distribution

1
(𝑥 + 1), 𝑥 = 1,2,3,4,5
𝑓(𝑥) = {20
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

(i) Sketch the graph of 𝑓(𝑥)


(ii) Determine the distribution function of X and sketch its graph

Solution
(i)

x 1 2 3 4 5
f(x) 0.1 0.15 0.2 0.25 0.3

Graph of 𝑓(𝑥)

(ii) 𝐹(𝑥) = 𝑃(𝑋 ≤ 𝑥)


𝑥
= ∑𝑡=1 𝑓(𝑡)

Since 𝑥 is any real number it could lie in any one of the following six mutually
disjoint intervals
−∞ < 𝑥 < 1, 1 ≤ 𝑥 < 2, 2 ≤ 𝑥 < 3, 3 ≤ 𝑥 < 4, 4 ≤ 𝑥 < 5 𝑎𝑛𝑑 5 ≤x< ∞.
Thus
COURTESY OF MICHELLE OWINO

0 , 𝑥<1
1
, 1≤𝑥<2
10
1
, 2≤𝑥<3
𝐹(𝑥) = 4
9
, 3≤𝑥<4
20
7
, 4≤𝑥<5
10
{ 1 , 𝑥≥5

To see how 𝐹(𝑥) is obtained, note that if for instance 3 ≤ 𝑥 < 4, then 𝐹(𝑥) =
1 9
∑3𝑥=1 (𝑥 + 1) = since the value of 𝑥 = 4 is excluded.
20 20

Graph of 𝐹(𝑥)
(i) 𝐹(𝑥) is a step function,
(ii) 𝐹(𝑥) is everywhere continuous to the right of any point.
2.3.2: Distribution of a continuous random variable
If X is a continuous random variable with density function 𝑓(𝑥), then the
distribution function of X is given by
𝑥
𝐹(𝑥) = ∫−∞ 𝑓(𝑡) 𝑑𝑡.

Example 2
Let X be a continuous random variable with probability density function (p.d.f)
given by
1
𝑥, 0 < 𝑥 < 2
𝑓(𝑥) = {2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Obtain the cumulative distribution function (c.d.f) of X and sketch its graph.
Solution

𝐹(𝑥) = 𝑃(𝑋 ≤ 𝑥)
𝑥
= ∫−∞ 𝑓(𝑡)𝑑𝑡
COURTESY OF MICHELLE OWINO

0 , 𝑥≤0
𝑥1
= { ∫0 2 𝑡 𝑑𝑡 , 0 < 𝑥 < 2
1, 𝑥≥2
0, 𝑥≤0
1
= {4 𝑥 2 , 0 < 𝑥 < 2
1, 𝑥≥2

Graph of 𝐹(𝑥)

In the above example 𝐹(𝑥) is a continuous function for all real numbers 𝑥. In
particular 𝐹(𝑥) is everywhere continuous to the right of any point. Moreover,
the derivative of 𝐹(𝑥) with respect to 𝑥 exists at all points in the interval [0,2].
𝑑𝐹(𝑥)
That is, in the interval 𝑓(𝑥) = 𝐹 / (𝑥) = .
𝑑𝑥

2.3.3: Properties of the distribution function


(1) 0 ≤ 𝐹(𝑋) ≤ 1 since 0 ≤ 𝑃(𝑋 ≤ 𝑥) ≤ 1 .
(2) If a and b are any real numbers such that ≤ 𝑏 , then
𝑃(𝑎 ≤ 𝑋 ≤ 𝑏) = 𝐹(𝑏) − 𝐹(𝑎) .
(3) 𝐹(𝑥) is a non-decreasing function of 𝑥. This follows from (2) since
𝑥1 ≤ 𝑥2 ⇒ 𝐹(𝑥2 ) − 𝐹(𝑥1 ) = 𝑃(𝑥1 ≤ 𝑋 ≤ 𝑥2 ) ≥ 0 . That is if 𝑥2 ≥ 𝑥1 , then

𝐹(𝑥2 ) ≥ 𝐹(𝑥1 ) .

(4) lim 𝐹(𝑥) = 0 and lim 𝐹(𝑥) = 1 .


𝑥→−∞ 𝑥→∞

(5) 𝐹(𝑥) is continuous to the right at each point 𝑥. That is


lim 𝐹(𝑥) = 𝐹(𝑎) , where 𝑥 → 𝑎+ means approaching a from the right.
𝑥→𝑎+

(6) If X is a continuous random variable, then 𝐹(𝑥) is everywhere continuous


and
the probability density function (p.d.f) of X is given by
COURTESY OF MICHELLE OWINO

𝑑𝐹(𝑥)
𝑓(𝑥) =
𝑑𝑥

for those points where 𝐹(𝑥) is differentiable.


(7) If X is a discrete random variable, then 𝐹(𝑥) is a step function satisfying (1),
(2), (3), (4) and (5) and
𝑓(𝑥) = 𝑃(𝑋 = 𝑥)
= 𝐹(𝑥) − 𝐹(𝑥 − )
Where 𝐹(𝑥 − ) denotes the limit of 𝐹 at 𝑥 if we approach 𝑥 from the left.
Thus
The probability that X= 𝑥 is the height of the step that 𝐹 has at 𝑥.
Example 2.3
A continuous random variable X has distribution function (c.d.f) given by
0 , 𝑥<0
2 3
𝐹(𝑥) = { 𝑥 + , 0 ≤ 𝑥 < 5
25 5
1 , 𝑥≥5
(i) Sketch the graph of 𝐹(𝑥) and determine the probability distribution
𝑓(𝑥) of X.
(ii) Compute 𝑃(−3 ≤ 𝑋 ≤ 3).
Solution

(i) Graph of 𝐹(𝑥)

𝐹(𝑥) is discontinuous at 𝑥 = 0. At this point we have (𝑋 = 0) = 𝐹(0) −


3 3
𝐹(0− ) = − 0 = .
5 5
However, 𝐹(𝑥) is differentiable in the interval 0 < 𝑥 ≤ 5 and so
𝑓(𝑥) = 𝐹 / (𝑥)
2
= , 0<𝑥≤5
25

Thus, the probability distribution of X is given by


COURTESY OF MICHELLE OWINO

3
, 𝑥=0
5
𝑓(𝑥) = {2 , 0<𝑥≤5
25
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

(ii) 𝑃(−3 ≤ 𝑋 ≤ 3) = 𝐹(3) − 𝐹(−3)


6 3 21
= + −0=
25 5 25

Alternatively
𝑃(−3 ≤ 𝑋 ≤ 3) = 𝑃(0) + 𝑃(0 < 𝑋 ≤ 3)

3
= + 𝐹(3) − 𝐹(0)
5

3 6 3 3 21
= + + − =
5 25 5 5 25

Example 2.4
A continuous random variable X has probability density function (p.d.f) given
by
1
, −2 ≤ 𝑥 ≤ 2
𝑓(𝑥) = {4
0, 𝑒𝑠𝑙𝑒𝑤ℎ𝑒𝑟𝑒
Define a new random variable Y by Y=X2 . Obtain the cumulative distribution
function (c.d.f) of Y and hence determine its p.d.f.
Solution
The limits for y are follows:
0≤𝑦≤4
Let the cumulative distribution function (c.d.f) be 𝐺(𝑦). Therefore
𝐺(𝑦) = 𝑃(𝑌 ≤ 𝑦) satisfies
𝐺(𝑦) = 0 if 𝑦 < 0 and for 0 ≤ 𝑦 ≤ 4
𝐺(𝑦) = 𝑃(𝑋 2 ≤ 𝑦)
= 𝑃(−√𝑦 ≤ 𝑋 ≤ √𝑦)
𝑦 1 1
= ∫−√ 𝑑𝑡 = √𝑦
√𝑦 4 2

Therefore
COURTESY OF MICHELLE OWINO

0 , 𝑦<0
1
𝐺(𝑦) = {2 √𝑦 , 0 ≤ 𝑦 ≤ 4
1 , 𝑦>4
𝐺(𝑦) is differentiable in the interval [0,4]. Hence the p.d.f of Y is given by
𝑔(𝑦) = 𝐺 / (𝑦)
1
1−
= 𝑔(𝑦) = {4 𝑦 , 0 ≤ 𝑦 ≤ 4
2

0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Assessment
1. Let X be a discrete random variable with probability distribution function
1
, 𝑥 = 1,2,3,4
𝑓(𝑥) = {4
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Determine the c.d.f of X and hence sketch its graph.

2. Let X be a continuous random variable with p.d.f


2𝑥, 0 < 𝑥 < 1
𝑓(𝑥) = {
0, 𝑒𝑙𝑠𝑒ℎ𝑤𝑒𝑟𝑒
Find the c.d.f X and sketch its graph.

References

1. Introduction to the Theory of Statistics by A.M. Mood, F.A. Graybill and D.C.
Boes.
2. Probability and Statistics by Rao V. Dukkip

LESSON THREE
COURTESY OF MICHELLE OWINO

MODE AND MEDIAN OF DISTRIBUTION


3.1 : Introduction
In this lesson we discuss the mode and median of a probability
distribution.
3.2 : Lesson Learning Outcomes

By the end of this lesson the learner will be able to:


i. Determine the mode of a probability distribution
ii. Find the median of a random variable
3.3 MODE
Let X be a random variable with probability distribution 𝑓(𝑥) and
corresponding c.d.f 𝐹(𝑥). Then a mode of 𝑓(𝑥) is defined to be that
value of the random variable X which maximizes 𝑓(𝑥). That is a value µ0
of X is called a mode of 𝑓(𝑥) if it satisfies
𝑓(µ0 ) = max 𝑓(𝑥)
Where 𝑓(𝑥) is maximized over all possible values of X.

Example 3.1
Find the mode of each of the following distributions:
3 1 𝑥−1
(i) 𝑓(𝑥) = {4 (4) , 𝑥 = 1,2,3, . . .
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

3
𝑥 2 (𝑥 − 1), 0 ≤ 𝑥 ≤ 2
(ii) 𝑓(𝑥) = {4
0 , 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒

Solutions

(i) Since 𝑓(𝑥) is a decreasing function of 𝑥, the mode is µ0 =


1.
(ii) 𝑓(𝑥) is a continuous function of 𝑥 and so the mode
corresponds to the point of maximum of 𝑓(𝑥) in the interval
0 ≤ 𝑥 ≤ 2 . Therefore
3
𝑓 / (𝑥) = 𝑥(3𝑥 − 2)
4
Mode satisfies
𝑓 / (𝑥) = 0
3
i.e 𝑥(𝑥 − 2) = 0
4
COURTESY OF MICHELLE OWINO

2
𝑥 = 0 or = .
3

𝑑 2 𝑓(𝑥) 3
Thus the mode of 𝑓(𝑥) is 0 since at 𝑥 = 0 is − <
𝑑𝑥 2 2
0.

3.2: MEDIAN
The median of 𝑓(𝑥) is a value 𝜆 of the random variable X which satisfies
𝑃(𝑋 < 𝜆) ≤ 0.5 and (𝑋 ≤ 𝜆) ≥ 0.5 ,
when 𝑋 is a discrete random variable.
If X is a continuous random variable, then the median satisfies
𝜆 𝑢𝑝𝑝𝑒𝑟 𝑙𝑖𝑚𝑖𝑡
𝐹(𝜆) = 0.5 or ∫𝑙𝑜𝑤𝑒𝑟 𝑙𝑖𝑚𝑖𝑡 𝑓(𝑥)𝑑𝑥 = 0.5 or ∫𝜆 𝑓(𝑥) 𝑑𝑥 = 0.5.

Example 3.2
Obtain the median of each of the following distributions
4 1 𝑥 3 4−𝑥
(i) 𝑓(𝑥) = {(𝑥) (4) (4) , 𝑥 = 0,1,2,3,4
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

2𝑥, 0 < 𝑥 < 1


(ii) 𝑓(𝑥) = {
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Solution

(i) The median 𝑚 satisfies


𝑃(𝑋 < 𝜆) ≤ 0.5 and 𝑃(𝑋 ≤ 𝜆) ≥ 0.5

∑𝜆−1 𝜆
𝑥=0 𝑓(𝑥) ≤ 0.5 and ∑𝑥=0 𝑓(𝑥) ≥ 0.5

4 1 0 3 4−0 81
𝑓(0) = ( ) ( ) ( ) =
0 4 4 256
COURTESY OF MICHELLE OWINO

1 1 3 4−1 27
𝑓(1) = (41) ( ) ( ) =
4 4 64

Hence the median of 𝑓(𝑥) is 𝜆 = 1, because


81
𝑃(𝑋 < 1) = 𝑃(𝑋 = 0) = 𝑓(0) = < 0.5 and
256

189
𝑃(𝑋 ≤ 1) = 𝑃(𝑋 = 0) + 𝑃(𝑋 = 1) = 𝑓(0) + 𝑓(1) = > 0.5
256

(ii) Since 𝑓(𝑥) is continuous, the median 𝜆 of 𝑓(𝑥) satisfies


𝐹(𝜆) = 0.5
𝑥
But 𝐹(𝑥) = 𝑃(𝑋 ≤ 𝑥) = ∫0 𝑓(𝑡) 𝑑𝑡 = 𝑥 2 . Therefore the median of
𝑓(𝑥) is given by
𝜆 1
∫0 𝑓(𝑥) 𝑑𝑥 = 0.5 or ∫𝜆 𝑓(𝑥) 𝑑𝑥 = 0.5
𝜆2 = 0.5
𝜆 = √0.5 .

3.5: Assessment
1. Let X be a continuous random variable with p.d.f given by

2𝑒 −2𝑥 , 𝑥 ≥ 0
𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Obtain the median of X.
2. The c.d.f of a continuous random variable U if given by
0 , 𝑢<0
𝜋
𝐹(𝑢) = {1 − cos 𝑢 , 0 ≤ 𝑢 ≤ 2
𝜋
1 , 𝑢>
2

(i) Obtain the p.d.f of U.


(ii) Determine the mode and median of U.
𝜋 𝜋
(iii) Calculate 𝑃 ( ≤ 𝑈 ≤ )
4 3
References
1. Introduction to the Theory of Statistics by A.M. Mood, F.A. Graybill and
D.C. Boes .
2. Probability and Statistics by Rao V. Dukkip
COURTESY OF MICHELLE OWINO

LESSON FOUR
EXPECTATION OF A RANDOM VARIABLE
4.1: Introduction
In this lesson will discuss expectation of a random variable. The
properties will be discussed this forum.

4.2: Lesson Learning outcomes


By the end of this lesson the learner will be able to:
i. Obtain the expectation of a random variable
ii. State properties of expectation.
4.3: Expectation
4.3.1: Expectation of a discrete random variable

Let X be a discrete random variable whose probability distribution is


defined by
𝑓(𝑥) = 𝑃(𝑋 = 𝑥).

The expected value of X, denoted by 𝐸(𝑋) is defined by

𝐸(𝑋) = ∑∞
𝑥=−∞ 𝑥 𝑓(𝑥)

Example 4.1
Let X be a discrete random variable with probability distribution given
by
1
, 𝑥 = 1,2,3,4,5,6
𝑓(𝑥) = {6
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Obtain 𝐸(𝑋).
Solution

𝐸(𝑋) = ∑∞
𝑥=−∞ 𝑥 𝑓(𝑥)

1
= ∑6𝑥=1 𝑥 ( ) = 3.5
6
COURTESY OF MICHELLE OWINO

Let us now consider a new random variable 𝑔(𝑋) which depends on a


discrete random variable X. Then the expectation of 𝑔(𝑋) is defined
by

𝐸[𝑔(𝑋)] = ∑∞
𝑥=−∞ 𝑔(𝑥)𝑓(𝑥)

Example 4.2
The following table shows the probability distribution of a discrete
random variable X.

X 0 1 2 3
f(x) 1 1 1 1
4 3 4 6

Find the expected values of 𝑋 and 𝑔(𝑋) = [𝑋 − 𝐸(𝑋)]2 .

Solution
(i) 𝐸(𝑋) = ∑∞
𝑥=−∞ 𝑥𝑓(𝑥)
4
= ∑3𝑥=0 𝑥𝑓(𝑥)=
3

4 2
(ii) Therefore g(X)=[𝑋 − ] .
3
Hence
𝐸[𝑔(𝑋)] = ∑∞
−∞ 𝑔(𝑥)𝑓(𝑥)

4 2
= ∑3𝑥=0 (𝑥 − ) 𝑓(𝑥)
3

4 2 1 2 2 2
= (− ) 𝑓(0) + (− ) 𝑓(1) + ( ) 𝑓(2) +
3 3 3
5 2 57
(3) 𝑓(3) = 54 .

4.3.2: Expectation of a continuous random variable


COURTESY OF MICHELLE OWINO

Let X be a continuous random variable with p.d.f 𝑓(𝑥). Then the


expected value of X is defined by the integral


𝐸(𝑋) = ∫−∞ 𝑥𝑓(𝑥) 𝑑𝑥.

More generally, if 𝑔(𝑋) is a function of X, then


𝐸[𝑔(𝑋)] = ∫−∞ 𝑔(𝑥) 𝑓(𝑥)𝑑𝑥.

Example 4.3
Let X be a continuous random variable with p.d.f

1
(𝑥 + 3), −3 < 𝑥 < 3
𝑓(𝑥) = {18
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Compute 𝐸(𝑋) and 𝐸(𝑋 2 ).


Solution


𝐸(𝑋) = ∫−∞ 𝑥𝑓(𝑥) 𝑑𝑥.

3 1
= ∫−3 𝑥(𝑥 + 3)𝑑𝑥 = 1
18
and

𝐸(𝑋) = ∫−∞ 𝑥 2 𝑓(𝑥) 𝑑𝑥.

3 1
= ∫−3 𝑥 2 (𝑥 + 3)𝑑𝑥 = 3.
18

NB: If 𝐸 (𝑋) exists then 𝐸 |𝑋| also exists. If 𝐸 |𝑋| does not exist, then
𝐸|𝑋| = ∞.

Example 4.4
Let X be a continuous random variable with p.d.f given by
1
, −∞ < 𝑥 < ∞
𝑓(𝑥) = {𝜋(1+𝑥 2)
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
COURTESY OF MICHELLE OWINO

Prove that 𝐸(𝑋) does not exist.


Proof

∞ ∞ 𝑥
𝐸(𝑋) = ∫−∞ 𝑥𝑓(𝑥) 𝑑𝑥=∫−∞ 𝑑𝑥.
𝜋(1+𝑥 2 )

∞ ∞ 𝑥
But ∫0 𝑥𝑓(𝑥) 𝑑𝑥 = ∫0 𝑑𝑥
𝜋(1+𝑥 2 )

1 ∞
=[ 𝑙𝑛(1 + 𝑥 2 )] = ∞
2𝜋 0

Therefore 𝐸(𝑋) does not exist and 𝐸|𝑋| = ∞.

4.3.3 : Properties of Expectation

Let be a continuous random variable with p.d.f 𝑓(𝑥). Let 𝑔(𝑋) =


𝑎𝑋 + 𝑏
Where a and b are real numbers, be a function of X. Then


𝐸[𝑔(𝑋)] = ∫−∞ 𝑔(𝑥) 𝑓(𝑥)𝑑𝑥.


= ∫−∞(𝑎𝑥 + 𝑏) 𝑓(𝑥)𝑑𝑥.

∞ ∞
= 𝑎 ∫−∞𝑥 𝑓(𝑥)𝑑𝑥 + 𝑏 ∫−∞ 𝑓(𝑥) 𝑑𝑥

= 𝑎𝐸(𝑋) + 𝑏 ……………………………………..
(1)

If a=0 , then 𝑔(𝑋) = 𝑏 and 𝐸(𝑏) = 𝑏.


This expected value of a constant is a constant.

Let g(X) and ℎ(𝑋) be any two real valued functions of X. Then for any
constants a and

𝐸[𝑎 𝑔(𝑋) + 𝑏 ℎ(𝑋)] = ∫−∞(𝑎 𝑔(𝑥) + 𝑏 ℎ(𝑥)) 𝑓(𝑥)𝑑𝑥.

∞ ∞
= 𝑎 ∫−∞ 𝑔(𝑥) 𝑓(𝑥)𝑑𝑥 + 𝑏 ∫−∞ ℎ(𝑥)𝑓(𝑥) 𝑑𝑥
COURTESY OF MICHELLE OWINO

= 𝑎𝐸[𝑔(𝑋)] + 𝑏[ℎ(𝑋)]……………………… (2)

The two properties also hold for discrete random variables.

Example 4.5
Let X be a discrete random variable with probability distribution
𝑥
, 𝑥 = 1,2,3,4
𝑓(𝑥) = {10
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
3 2 ].
Compute 𝐸[5𝑋 − 2𝑋
Solution
𝐸[5𝑋 − 2𝑋 = 5𝐸(𝑋 3 ) − 2𝐸(𝑋 2 )
3 2]

𝑥3
But 𝐸(𝑋 2 ) = ∑4𝑥=1 𝑥 2 𝑓(𝑥) = ∑4𝑥=1 = 10 and
10
4 4
3) 3
𝑥4
𝐸(𝑋 = ∑ 𝑥 𝑓(𝑥) = ∑ = 35.4
10
𝑥=1 𝑥=1

Therefore
𝐸[5𝑋 3 − 2𝑋 2 ] = 5(35.4) − 2(10) = 157.

4.5 Assessment
1. Let X be a discrete random variable with probability distribution given by

1
, 𝑥 = 1,2,3, … , 𝑛
𝑓(𝑥) = {𝑛
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

𝑛+1
Show that (𝑋) = .
2

2. The following table shows the probability distribution function of a


discrete random variable X
x -5 -2 1 3
COURTESY OF MICHELLE OWINO

f(x) 1 1 0 1
3 2 6

Compute 𝐸(𝑋) , 𝐸(𝑋 2 ) and𝐸(4𝑋 2 − 6𝑋 + 2).


1. Suppose the p.d.f of a continuous random variable is defined by

1
, 𝑎<𝑥<𝑏
𝑓(𝑥) = {𝑏−𝑎
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Where a and b are real numbers. Show that
𝑎+𝑏 1
𝐸(𝑋) = and 𝐸(𝑋 2 ) = (𝑏 2 + 𝑎𝑏 + 𝑎2 ).
2 3

2. Let X be a continuous random variable with p.d.f


1
(𝑥 + 1), −1 < 𝑥 < 1
𝑓(𝑥) = {2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Compute 𝐸(𝑋) , 𝐸(𝑋 2 ) 𝑎𝑛𝑑 𝐸(𝑋 3 ).
COURTESY OF MICHELLE OWINO

LESSON FIVE
MOMENTS
5.1: Introduction
In this lesson we consider moments about a point. Hence we will discuss
central moments like variance. The properties of variance will be discussed.
5.2: Lesson Learning outcomes
By the end of this lesson the learner will be able to:
i. Determine the moment of a random variable about a point
ii. Find the mean and variance of a distribution
iii. State the properties of variance
5.2: Moments
Let X be a random variable with a probability distribution 𝑓(𝑥). Then the
expected value of X, if it exists, is called the mean of the random variable X or
the mean of the probability distribution 𝑓(𝑥). It is usually denoted by 𝜇. That is
1 n
𝜇 = 𝐸(𝑋)=  Xi = X
n i 1

Which is called the first moment about the point? 𝑥 = 0.


The kth moment about 𝑎 = 0 is defined by
1 n


𝜇𝑘 = 𝐸(𝑋 𝑘 ) = Xi , 𝑘 > 0
k

n i 1

Where

𝜇1 = 𝜇.
𝐸[(𝑋 − 𝑎)𝑘 ] is called the kth moment of the random variable X about the
point 𝑥 = 𝑎 (if it exists).
𝜇𝑘 = 𝐸[(𝑋 − 𝜇)𝑘 ] is the kth moment of the rand variable X about 𝜇, and is
also called central moment.
𝜇1 = 𝐸(𝑋 − 𝜇) = 𝐸(𝑋) − 𝜇 = 𝜇 − 𝜇 = 0 .This shows that the first moment
about the mean is always zero.
COURTESY OF MICHELLE OWINO

𝜇2 = 𝐸[(𝑋 − 𝜇)2 ] is the second central moment of a distribution commonly


used as a measure of dispersion or spread of the distribution. This is called the
variance of the distribution and is usually denoted by 𝜎 2 .
𝜎 2 = 𝑉𝑎𝑟(𝑋) = 𝐸[(𝑋 − 𝜇)2 ]= 𝐸[(𝑋 − 𝐸(𝑋))2 ]

Standard deviation = √𝑉𝑎𝑟(𝑋) = √ 𝐸[(𝑋 − 𝜇)2 ] .


Example 5.1
A continuous random variable X has a p.d.f given by

1
(3 − |𝑥|), −3 < 𝑥 < 3
𝑓(𝑥) = {9
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Calculate the mean and variance of X.


Solution
3
𝐸(𝑋)=∫−3 𝑓(𝑥) 𝑑𝑥

3𝑥 0 𝑥
= ∫0 (3 − 𝑥) 𝑑𝑥 + ∫−3 (3 + 𝑥) 𝑑𝑥 = 0
9 9

And the variance is given by

𝑉𝑎𝑟(𝑋) = 𝜎 2 = 𝐸[(𝑋 − 𝜇)2 ]

= 𝐸[(𝑋 − 0)2 ]

= 𝐸(𝑋 2 )

3 𝑥2 0 𝑥2
= ∫0 (3 − 𝑥) 𝑑𝑥 + ∫−3 (3 + 𝑥) 𝑑𝑥 = 1.5
9 9

NB: 𝐸[(𝑋 − 𝜇)2 ] = 𝐸[𝑋 2 − 2𝜇𝑋 + 𝜇2 ]


= 𝐸(𝑋 2 ) − 2𝜇𝐸(𝑋) + 𝐸(𝜇2 )

= 𝐸(𝑋 2 ) − 2𝜇2 + 𝜇2
COURTESY OF MICHELLE OWINO

= 𝐸(𝑋 2 ) − 𝜇2 = 𝜎 2 = 𝑉𝑎𝑟(𝑋)= 𝐸(𝑋 2 ) −


( E ( X )) 2

Example 5.2
The probability distribution of a discrete random variable X is given by

𝑥
, 𝑥 = 1,2,3,4,5,6
𝑓(𝑥) = {21
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Calculate the mean and variance of X.


Solution

𝑥2 13
𝜇 = 𝐸(𝑋) = ∑6𝑥=1 𝑥𝑓(𝑥) = ∑6𝑥=1 = .
21 3

𝑥3
𝐸(𝑋 2 ) = ∑6𝑥=1 𝑥 2 𝑓(𝑥) = ∑6𝑥=1 = 21
21
Therefore
2 2) 2 13 2 20
𝑉𝑎𝑟(𝑋) = 𝜎 = 𝐸(𝑋 − (𝐸(𝑋)) = 21 − ( ) = .
3 9
5.2.1 : Properties of Variance
𝑉𝑎𝑟(𝑋) = 𝐸[(𝑋 − 𝜇)2 ]
(𝑋 − 𝜇)2 = 𝑋 2 − 2𝜇𝑋 + 𝜇2 ≥ 0 since (𝑋 − 𝜇)2 is the square of a real
quantity. Therefore
𝐸(𝑋 2 ) − 2𝜇𝐸(𝑋) + 𝜇2 ≥ 0

𝐸(𝑋 2 ) − 𝜇2 ≥ 0
Thus
𝑉𝑎𝑟(𝑋) ≥ 0 (1)

𝐸(𝑋 + 𝑏) = 𝐸(𝑋) + 𝑏 = 𝜇 + 𝑏
COURTESY OF MICHELLE OWINO

𝑉𝑎𝑟(𝑋 + 𝑏) = 𝐸{[(𝑋 + 𝑏) − 𝐸(𝑋 + 𝑏)]}2 } = 𝐸{[𝑋 − 𝐸(𝑋)]2 } = 𝑉𝑎𝑟(𝑋).

Therefore, for any constant b

𝑉𝑎𝑟(𝑋 + 𝑏) = 𝑉𝑎𝑟(𝑋). (2)

𝐸(𝑎𝑋 + 𝑏) = 𝑎𝐸(𝑋) + 𝑏 = 𝑎𝜇 + 𝑏.

𝑉𝑎𝑟(𝑎𝑋 + 𝑏) = 𝐸{[(𝑎𝑋 + 𝑏) − 𝐸(𝑎𝑋 + 𝑏)]2 }

= 𝐸{[𝑎(𝑋 − 𝐸(𝑋)]2 }=Var(aX)

= 𝑎2 𝐸{[𝑋 − 𝐸(𝑋)]2 } = 𝑎2 𝑉𝑎𝑟(𝑋).


Thus, for any constants a and b
𝑉𝑎𝑟(𝑎𝑋 + 𝑏) = 𝑎2 𝑉𝑎𝑟(𝑋).
(3)
Example 5.3
1. Let X be a continuous random variable with p.d.f

1
(𝑥 + 1), −1 < 𝑥 < 1
𝑓(𝑥) = {2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Compute variance of 6𝑋 + 11.


Solution
𝑉𝑎𝑟(6𝑋 + 11) = 𝑉𝑎𝑟(6𝑋) = 62 𝑉𝑎𝑟{𝑋}.
But
𝑉𝑎𝑟(𝑋) = 𝜎 2 = 𝐸(𝑋 2 ) − (𝐸(𝑋))2
COURTESY OF MICHELLE OWINO

1 1 𝑥 1
𝜇 = 𝐸(𝑋) = ∫−1 𝑥𝑓(𝑥)𝑑𝑥 = ∫−1 (𝑥 + 1)𝑑𝑥 = and
2 3

1 1 𝑥2 1
𝐸(𝑋 2 ) = ∫−1 𝑥 2 𝑓(𝑥)𝑑𝑥 = ∫−1 (𝑥 + 1)𝑑𝑥 = . Therefore
2 3

1 1 2
𝑉𝑎𝑟(𝑋) = 𝜎 2 = 𝐸(𝑋 2 ) − 𝜇2 = − = . Hence
3 9 9

2
𝑉𝑎𝑟(6𝑋 + 11) = 36 ( ) = 8.
9

Example 5.4

𝑋−𝜇
Obtain the mean and variance of the random variable 𝑌 = , where
𝜎
𝜇 and 𝜎 are the mean and variance of a random variable X.
Solution

𝑋−𝜇 1
𝐸(𝑌) = 𝐸 ( ) = 𝐸(𝑋 − 𝜇) = 0
𝜎 𝜎

𝑋−𝜇 1 1
𝑉𝑎𝑟(𝑌) = 𝑉𝑎𝑟 (
𝜎
) = 𝜎2 𝑉𝑎𝑟(𝑋) = 𝜎2 × 𝜎 2 = 1 .

NB: Thus, the random variable Y has mean 0 and standard deviation one.
𝑋−𝜇
The linear transformation 𝑦 = is called a standardizing
𝜎
transformation and Y is called a standardized random variable.

5.4: Assessment
COURTESY OF MICHELLE OWINO

1. Let X be a discrete random variable with probability distribution given


by

1
, 𝑥 = 1,2,3, … , 𝑛
𝑓(𝑥) = {𝑛
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

𝑛2 −1
Show that 𝜎 2 = .
12

2. Suppose the p.d.f of a continuous random variable is defined by

1
, 𝑎<𝑥<𝑏
𝑓(𝑥) = {𝑏−𝑎
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Where a and b are real numbers. Show that

1
𝜎2 = (𝑏 − 𝑎)2 .
12

3. Let X be a continuous random variable with p.d.f


1
(𝑥 + 1), −1 < 𝑥 < 1
𝑓(𝑥) = {2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Find the mean and variance of X.

4. Let X be a continuous random variable with p.d.f


1
, 0<𝑥<4
𝑓(𝑥) = {4
0, 𝑒𝑠𝑙𝑒ℎ𝑤ℎ𝑒𝑟𝑒

Obtain the standardized random variable.


COURTESY OF MICHELLE OWINO

5. Let X be a discrete random variance with probability distribution


given by
𝑥
, 𝑥 = 0,1,2,3
𝑓(𝑥) = {6
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Compute 𝐸(𝑋), 𝑉𝑎𝑟(𝑋), 𝐸(6𝑋 2 + 7𝑋 3 ), 𝑉𝑎𝑟(3𝑋 + 4).

6. A continuous random variable X has p.d.f


𝑎 + 𝑏𝑥 + 𝑐𝑥 2 , 0 ≤ 𝑥 ≤ 1
𝑓(𝑥) = {
𝑜, 𝑒𝑠𝑙𝑒ℎ𝑤ℎ𝑒𝑟𝑒

4 4
If 𝐸(𝑋) = and (𝑋) = , determine the values of the constants a,b
3 45

and c.
COURTESY OF MICHELLE OWINO

LESSON SIX
MOMENT GENERATING FUNCTION
6.1: Introduction
In this lesson we will consider moment generating functions of various random
variables, and hence use them to determine the mean and variance of random
variables. We will use the concept of expectation which we discussed in lesson
four.

6.2: Lesson Learning outcomes


By the end of this lesson the learner will be able to:
i. Determine the moment generating function of a random variable
ii. Find the mean and variance of a distribution using moment
generating function
6.3: Moment Generating Function
Let X be a random variable with probability distribution 𝑓(𝑥). Then the
moment generating function (m.g.f) of 𝑓(𝑥) is defined by
𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 )
where t is any real number. When it exists, this expectation depends on the
choice of t, and so it defines a function of t. For t=0, it always exists since
𝑀𝑋 (𝑜) = 𝐸(𝑒 0 ) = 𝐸(1) = 1,
but for other values of t, the existence of 𝑀𝑋 (𝑡) depends on the distribution
𝑓(𝑥).
(𝑡𝑋)2 (𝑡𝑋)3
𝑒 𝑡𝑋 = 1+𝑡𝑋 + + +…
2! 3!

𝑡𝑘
= ∑∞
𝑘=0 𝑋
𝑘
and
𝑘!

𝑡𝑘
𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 ) = ∑∞ 𝑘
𝑘=0(𝑋 ) .
𝑘!
COURTESY OF MICHELLE OWINO

Therefore, the kth moment of a distribution can be obtained simply as the


𝑡𝑘
coefficient of in the expansion of 𝑀𝑋 (𝑡).
𝑘!

Alternatively, we can differentiate 𝑀𝑋 (𝑡) k times and obtain


(𝑘) 𝑑𝑘
𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 ) = 𝐸(𝑋 𝑘 𝑒 𝑡𝑋 ).
𝑑𝑡 𝑘
(𝑘)
Putting = 0 , in 𝑀𝑋 (𝑡) yields
(𝑘)
𝑀𝑋 (0) = 𝐸(𝑋 𝑘 ) , k=1,2,3,…
(1) (2) (3)
Ie 𝑀𝑋 (0) = 𝐸(𝑋 ), 𝑀𝑋 (0) = 𝐸(𝑋 2 ), 𝑀𝑋 (0) = 𝐸(𝑋 3 )
Example 6.1
Let X be a discrete random variable with probability distribution given by

𝑥
, 𝑥 = 1,2,3
𝑓(𝑥) = {6
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Obtain the m.g.f of X and use it to compute the mean and variance of X.
Solution
𝑥
𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 ) = ∑6𝑥=0 𝑒 𝑡𝑋
6
1 2 3
= + 𝑒 2𝑡 + 𝑒 3𝑡
6 6 6
∕ 1 4 9
𝑀𝑋 (𝑡) = + 𝑒 2𝑡 + 𝑒 3𝑡 and therefore
6 6 6
∕ 1 4 9 7
𝐸(𝑋) = 𝑀𝑋 (0) = + 𝑒 0 + 𝑒 0 = .
6 6 6 3
∕∕ 1 8 27
𝑀𝑋 (𝑡) = + 𝑒 2𝑡 + 𝑒 3𝑡 .
6 6 6
∕∕ 1 8 27
𝐸(𝑋 2 )=𝑀𝑋 (0) = + + = 6. Hence
6 6 6

7 2 5
𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 = 6 − ( ) = .
3 9

Example 6.2
A continuous random variable X has the standardized normal density
COURTESY OF MICHELLE OWINO

𝑥2
1 −
𝑓(𝑥) = {√2𝜋 𝑒 , −∞ < 𝑥 < ∞
2

0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Obtain the m.g.f of 𝑓(𝑥) and use it to compute the mean and variance of X.
Solution
The m.g.f of X is given by
𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 )

= ∫𝑥=−∞ 𝑒 𝑡𝑥 𝑓(𝑥)𝑑𝑥
𝑥 2
1 ∞ 𝑡𝑥 − 2
= ∫ 𝑒 𝑒 𝑑𝑥
√2𝜋 𝑥=−∞
𝑡2
=𝑒 2

and it exists for t, −∞ < 𝑡 < ∞.


𝑡2

𝑀𝑋 (𝑡) = 𝑡𝑒 2


𝐸(𝑋) = 𝜇 = 𝑀𝑋 (0) = 0

𝑡2 𝑡2
∕∕ 2
𝑀𝑋 (𝑡) =𝑒 +𝑡 𝑒 2 2

∕∕
𝐸(𝑋 2 )=𝑀𝑋 (0) = 1 . Therefore

𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 = 1 − 0 = 1.


Assessment
1. A random variable X has m.g.f
𝑀𝑋 (𝑡) = (1 − 𝑡 2 )−1 ,
Compute its mean and variance.
2. A continuous random variance X has p.d.f
1, 0 < 𝑥 < 1
𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
COURTESY OF MICHELLE OWINO

Determine the m.g.f of X and hence compute 𝐸(𝑋) and 𝑉𝑎𝑟(𝑋).

3. A random variable X has a binomial distribution with parameters n and p


(𝑛𝑥)𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 , 𝑥 = 0,1, … , 𝑛 , 𝑞 = 1 − 𝑝
i.e. 𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Obtain the m.g.f. of X , hence determine its mean and variance.
COURTESY OF MICHELLE OWINO

LESSON SEVEN
BERNUOLLI, BINOMIAL AND HYPERGEOMETRIC
DISTRIBUTIONS
7.1: Introduction
In this lesson some special discrete distributions namely Bernoulli, Binomial
and Hypergeometric distributions. The binomial distribution is also known as
Bernoulli distribution. It has been used to describe a wide variety of processes
in business and social sciences. We determine moments of each these
distributions.
7.2: Lesson Learning outcomes
By the end of this lesson the learner will be able to:
i. Define Bernoulli, Binomial and Hypergeometric distributions
ii. Determine means and variances of these distributions

7.3: Special discrete probability distributions

7.3.1: Bernoulli distribution


A random variable X is defined to have a Bernoulli distribution if the discrete
density function of X is given by
𝑝 𝑥 (1 − 𝑝)1−𝑥 , 𝑥 = 0,1 , 𝑞 = 1 − 𝑝
𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
The mean of X is given by
1

𝐸(𝑋) = ∑ 𝑥 𝑓(𝑥)
𝑥=0

= ∑1𝑥=0 𝑥 𝑝 𝑥 (1 − 𝑝)1−𝑥 = 𝑝.
The variance of X is given by
𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2
COURTESY OF MICHELLE OWINO

But 𝐸(𝑋 2 ) = ∑1𝑥=0 𝑥 2 𝑓(𝑥)


= ∑1𝑥=0 𝑥 2 𝑝 𝑥 (1 − 𝑝)1−𝑥 = 𝑝
Therefore 𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 = 𝑝 − 𝑝2 = 𝑝𝑞.
Example 7.1
A box contains 4 good fruits and 6 bad ones. If a fruit is selected at random
from the box, it can either be good or bad. The random variable
1 , 𝑖𝑓 𝑡ℎ𝑒 𝑓𝑟𝑢𝑖𝑡 𝑖𝑠 𝑏𝑎𝑑
𝑋={
0 , 𝑖𝑓 𝑡ℎ𝑒 𝑓𝑟𝑢𝑖𝑡 𝑖𝑠 𝑔𝑜𝑜𝑑
is a Bernoulli random variable. The probability of selecting a good fruit is the
proportion of good fruits in the box. Hence
4 2
𝑝 = 𝑃(𝑋 = 1) = = .Thus
10 5
2 2 2 6
𝐸(𝑋) = 𝑝 = and (𝑋) = 𝑝𝑞 = ( ) (1 − ) = .
5 5 5 25

The moment generating function of a Bernoulli random variable is given by


𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 ) = ∑1𝑥=0 𝑒 𝑡𝑥 𝑓(𝑥)
= ∑1𝑥=0 𝑒 𝑡𝑥 𝑝 𝑥 (1 − 𝑝)1−𝑥
= (1 − 𝑝) + 𝑝𝑒 𝑡
Which exists for all real numbers t.
We can obtain the mean and variance of X by using the above m.g.f as follows:

𝑀𝑋 (𝑡) = 𝑝𝑒 𝑡 .Therefore

𝐸(𝑋) = 𝑀𝑋 (0) = 𝑝.
∕∕
𝑀𝑋 (𝑡) = 𝑝𝑒 𝑡 . Thus
∕∕
𝑀𝑋 (0) = 𝑝 = 𝐸(𝑋 2 ) . Hence
𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 = 𝑝 − 𝑝2 = 𝑝𝑞.
7.2.2: BINOMIAL DISTRIBUTION
COURTESY OF MICHELLE OWINO

A random variable X is defined to have a binomial distribution if the discrete


density is given by

(𝑛𝑥)𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 , 𝑥 = 0,1, … , 𝑛 , 𝑞 = 1 − 𝑝


𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
The parameters of the above distribution are n and p, where 0 ≤ 𝑝 ≤ 1.
The mean of X is given by
𝐸(𝑋) = ∑𝑛𝑥=0 𝑥 𝑓(𝑥)
= ∑𝑛𝑥=0 𝑥 (𝑛𝑥)𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 = 𝑛𝑝.

𝐸(𝑋 2 ) = ∑𝑛𝑥=0 𝑥 2 𝑓(𝑥)


= ∑𝑛𝑋=0 𝑥 2 (𝑛𝑥)𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 = 𝑛(𝑛 − 1)𝑝2 + 𝑛𝑝.
Therefore the variance of X is given by
𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 = 𝑛(𝑛 − 1)𝑝2 + 𝑛𝑝 − 𝑛2 𝑝2 = 𝑛𝑝𝑞.
Example 7.2
In a certain community, the probability of a female birth is 0.3 . If ten
individuals are randomly selected from this community, calculate
(i) the probability that exactly six of them are males,
(ii) the average number of females in the sample. Assume that the rate
of survival is the same for both sexes.
Solution
Let X denote the number of females in the sample. Then assuming the
binomial distribution, we have

(10)(0.3)𝑥 (0.7)10−𝑥 , 𝑥 = 0,1, … ,10


𝑃(𝑋) = 𝑓(𝑥) = { 𝑥
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
(i) 𝑃𝑟𝑜𝑏(6 𝑚𝑎𝑙𝑒𝑠) = 𝑃(𝑋 = 10 − 6)
= 𝑃(𝑋 = 4)
= (10
4
)(0.3)4 (0.7)10−4 = 0.2001
(ii) 𝐸(𝑋) = 𝑛𝑝 = 10 × 0.3 = 3
COURTESY OF MICHELLE OWINO

The moment generating function of the binomial random variable X with


parameters n and p is given by
𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 ) = ∑𝑛𝑥=0 𝑒 𝑡𝑥 𝑓(𝑥)
= ∑𝑛𝑥=0 𝑒 𝑡𝑥 (𝑛𝑥) 𝑝 𝑥 (1 − 𝑝)𝑛−𝑥

= ∑𝑛𝑥=0(𝑛𝑥) (𝑝𝑒 𝑡 )𝑥 (1 − 𝑝)𝑛−𝑥 =


(𝑝𝑒 𝑡 + 𝑞)𝑛
The mean and variance of a binomial random variable X are determined by
using its m.g.f as follows:

𝑀𝑋 (𝑡) = 𝑛𝑝𝑒 𝑡 (𝑝𝑒 𝑡 + 𝑞)𝑛−1 . Therefore

𝐸(𝑋) = 𝑀𝑋 (0) = 𝑛𝑝(𝑝 + 𝑞)𝑛−1 .
= 𝑛𝑝 , since p+q=1.
/∕
𝑀𝑋 (𝑡) = 𝑛(𝑛 − 1)(𝑝𝑒 𝑡 )2 (𝑝𝑒 𝑡 + 𝑞)𝑛−2 + 𝑛𝑝𝑒 𝑡 (𝑝𝑒 𝑡 +
𝑞)𝑛−1 .
/∕
𝐸(𝑋 2 ) = 𝑀𝑋 (0) = 𝑛(𝑛 − 1)𝑝2 (𝑝 + 𝑞)𝑛−2 + 𝑛𝑝(𝑝 + 𝑞)𝑛−1
= 𝑛(𝑛 − 1)𝑝2 + 𝑛𝑝
𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 = 𝑛(𝑛 − 1)𝑝2 + 𝑛𝑝 − 𝑛2 𝑝2 = 𝑛𝑝𝑞.

Geometric Distribution

A random variable X is defined to have a geometric distribution if the p.d.f. of X is given by

 p1  p x , x  0,1,2,
f x   
 0, elsewhere

Mean and Variance.

We use the m.g.f. technique


COURTESY OF MICHELLE OWINO

M x t   E e tx  

  e tx f  x 
x 0

  e tx p1  p 
x

x 0


 p  e t 1  p  
x

 
 p 1  e t 1  p   e t 1  p    2

p

1  e 1  p 
t

p
 , where q  1  p
1  qet

pqet
M t  
'
x
1  qe  t 2

E x   M x' 0
pq q
 
1  q 2 p

2 pq 2 e 2t pqet
M t  
''

x
1  qe  1  qe 
t 3 t 2

M x'' 0  
2 pq 2 pq
 
1  q  1  q 2
3

2q 2 q
 2 
p p
COURTESY OF MICHELLE OWINO


Varx   M x'' 0  M x' 0 2

2
2q 2 q  q 
 2    
p p  p
q2 q
 
p2 p
q 2  pq

p2
q p  q 

p2
q
 2
p

7.2.3: Hypergeometric Distribution


Suppose that a box contains N bulbs, of which M are defective, n bulbs are
selected at random without replacement from the box. Let X be the number of
defective bulbs in the sample. Then X is called a hypergeometric random
variable. Therefore the probability distribution of X is given by
(𝑀 𝑁−𝑀
𝑥 )( 𝑛−𝑥 )
, 𝑥 = 0,1,2, … , 𝑛
𝑓(𝑥) = 𝑃(𝑋 = 𝑥) = { (𝑁
𝑛)
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Where N is a positive integer, M is a non-negative integer that is at most N,
and n is a positive integer that is at most N.
The mean of X is given by
𝐸(𝑋) = ∑𝑛𝑥=0 𝑥 𝑓(𝑥)
𝑥(𝑀 𝑁−𝑀
𝑥 )( 𝑛−𝑥 )
= ∑𝒏𝒙=𝟎
(𝑁
𝑛)

𝑀 𝑥(𝑀−1 𝑁−𝑀
𝑥−1 )( 𝑛−𝑥 ) 𝑛𝑀
= 𝑛 ( ) ∑𝒏𝒙=𝟏 = .
𝑁 (𝑁−1
𝑛−1 )
𝑁

(𝑀 𝑁−𝑀
𝑥 )( 𝑛−𝑥 )
𝐸[𝑋(𝑋 − 1)] = ∑𝑛𝑥=1 𝑥(𝑥 − 1)
(𝑁
𝑛)

𝑀(𝑀−1) 𝑛 (𝑀−2 𝑁−𝑀


𝑥−2 )( 𝑛−𝑥 ) 𝑀(𝑀−1)
= 𝑛(𝑛 − 1) ∑ = 𝑛(𝑛 − 1) .
𝑁(𝑁−1) 𝑥=2 (𝑁−2
𝑛−2 )
𝑁(𝑁−1)
COURTESY OF MICHELLE OWINO

𝑉𝑎𝑟(𝑋) = 𝐸[𝑋(𝑋 − 1)] + 𝐸(𝑋) − [𝐸(𝑋)]2


𝑀(𝑀−1) 𝑛𝑀 𝑛2 𝑀 2
= 𝑛(𝑛 − 1) + −
𝑁(𝑁−1) 𝑁 𝑁2

𝑛𝑀 (𝑁−𝑀)(𝑁−𝑛
= [ ].
𝑁 𝑁(𝑁−1)

Example 7.3
A committee of 4 people is to be selected at random from among 10 people of
whom 3 are women and 7 are men. Let X denote the number of women
selected. Obtain
(i) the probability distribution of X,
(ii) the mean and the variance of X.
Solution
The random experiment described here would give rise to the hypergeometric
probability model. Thus,

X is a hypergeometric random variable with parameters N=10, M=3, n=4.


Hence
(𝑥3)(4−𝑥
7
)
, 𝑥 = 0,1,2,3
(i) 𝑓(𝑥) = 𝑃(𝑋 = 𝑥) = { (10
4)
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

(ii) 𝐸(𝑋) = ∑3𝑥=0 𝑥𝑓(𝑥) = 1.2 and

𝐸(𝑋 2 ) = ∑3𝑥=0 𝑥 2 𝑓(𝑥) = 2 . Therefore

𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 = 2 − 1.22 = 0.56.

7.4: Assessment
1. A batch of 20 manufactured items contains 6 defective items, 5 items
are chosen at random from this batch. If X is the number of defective
items in the sample, find the probability distribution of X.
2. A study has shown that 80% of all families living in a certain residential
estate in Nakuru own a TV set. If 20 families are randomly selected from
this estate, compute the probability that
COURTESY OF MICHELLE OWINO

(i) all will have TV sets,


(ii) between 8 and 10, inclusive will have TV sets,
(iii) at most 10 will have TV sets,
(iv) at least 15 will own TV sets.
3. Suppose X is binomially distributed with parameters n and p; further
suppose that E(X)=5 and Var(X)=4. Find the values of n and p.

LESSON EIGHT
POISSON DISTRIBUTION
8.1: Introduction
In this lesson we will discuss Poisson distribution. It is applied to experiments
with random and independent occurrences. Some practical situations where
Poisson distribution can be used are:
i. In quality control statistics to count the number of defects of an item,
ii. In biology to count the number of bacteria,
iii. In physics to count the number of particles emitted from a radio-active
substance,
iv. In insurance problems to count the of causalities.
8.2: Lesson Learning outcomes
By the end of this lesson the learner will be able to:
i. define a Poisson distribution,
ii. obtain the mean, variance and moment generating function of a
Poisson random variable,
iii. State some of the uses of Poisson distribution in everyday life.
8.2: Poisson distribution
A random variable X is defined to have a Poisson distribution if its density is
given by
𝑒 −𝜆 𝜆𝑥
𝑃(𝑋 = 𝑥) = 𝑓(𝑥) = { , 𝑥 = 0,1,2, …
𝑥!
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒0
Where the parameter 𝜆 satisfies 𝜆 > 0.
The mean of Poisson random variable X is given by
COURTESY OF MICHELLE OWINO

𝐸(𝑋) = ∑∞
𝑥=0 𝑥𝑓(𝑥)

𝑒 −𝜆 𝜆𝑥
= ∑∞
𝑥=0 𝑥 𝑥!
𝜆𝑥−1
= 𝑒 −𝜆 𝜆 ∑∞
𝑥=1 𝑥 𝑥(𝑥−1)!

= 𝑒 −𝜆 𝜆𝑒 𝜆 = 𝜆.
The variance of X is given by
𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 .
But 𝐸(𝑋 2 ) = ∑∞ 2
𝑥=0 𝑥 𝑓(𝑥)

𝑒 −𝜆 𝜆𝑥
= ∑∞
𝑥=0 𝑥
2
𝑥!

𝑒 −𝜆 𝜆𝑥
= ∑∞
𝑥=1[𝑥(𝑥 − 1) + 𝑥] 𝑥!

𝑒 −𝜆 𝜆𝑥 𝑒 −𝜆 𝜆𝑥
= ∑∞
𝑥=1 𝑥(𝑥 − 1) + ∑∞
𝑥=0 𝑥
𝑥! 𝑥!

𝑒 −𝜆 𝜆𝑥
= 𝑒 −𝜆 𝜆2 ∑∞
𝑥=2 𝑥(𝑥 − 1) +
𝑥(𝑥−1)(𝑥−2)!
𝑒 −𝜆 𝜆𝑥
∑∞
𝑥=0 𝑥 𝑥!

= 𝑒 −𝜆 𝜆2 𝑒 𝜆 + 𝜆
= 𝜆2 + 𝜆.
∴ 𝑉𝑎𝑟(𝑋) = 𝜆2 + 𝜆 − 𝜆2 = 𝜆.
Example 8.1
The number of male mates of a queen bee was found to have a Poisson
distribution with parameter 𝜆 = 2.7. Find the probability that the number, X,
of male mates of a queen bee is
(i) exactly 2,
(ii) at most 2,
(iii)between 1 and 3, inclusive,
Solution
The probability distribution of X is given by
𝑒 −𝜆 𝜆𝑥
𝑃(𝑋 = 𝑥) = 𝑓(𝑥) = { , 𝑥 = 0,1,2, …
𝑥!
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒0
COURTESY OF MICHELLE OWINO

2.72
(i) 𝑃(𝑋 = 2) = 𝑓(2) = 𝑒 −2.7 = 0.2450
2!
(ii) 𝑃(𝑋 ≤ 2) = 𝑃(𝑋 = 0) + 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2)
2.70 2.71 2.72
= 𝑒 −2.7 + 𝑒 −2.7 + 𝑒 −2.7
0! 1! 2!
= 0.0672+0.1815+0.2450 = 0.4937
2.71 2.72 2.73
(iii) 𝑃(1 ≤ 𝑋 ≤ 3) = 𝑒 −2.7 + 𝑒 −2.7 + 𝑒 −2.7 = 0.6470
1! 2! 3!

The moment generating function of the Poisson random variable X with


parameter 𝜆 given by
𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 )
= ∑∞ 𝑡𝑥
𝑥=0 𝑒 𝑓(𝑥)

𝑒 −𝜆 𝜆𝑥
= ∑∞
𝑥=0 𝑒
𝑡𝑥
𝑥!

(𝜆𝑒 𝑡 )𝑥
= 𝑒 −𝜆 𝜆 ∑∞
𝑥=0 𝑥!
𝑡
= 𝑒 −𝜆 𝑒 𝜆𝑒
𝑡 −1)
= 𝑒 𝜆(𝑒 .
The mean and variance of X can be obtained using this m.g.f as follows:
∕ 𝑡 −1)
𝑀𝑋 (𝑡) = 𝜆𝑒 𝑡 𝑒 𝜆(𝑒 .

∴ 𝐸(𝑋) = 𝑀𝑋 (0) = 𝜆
∕∕ 𝑡 −1) 𝑡 −1)
𝑀𝑋 (𝑡) = 𝜆2 𝑒 2𝑡 𝑒 𝜆(𝑒 + 𝜆𝑒 𝑡 𝑒 𝜆(𝑒

∕∕ 0 −1) 0 −1)
Therefore 𝐸(𝑋 2 ) = 𝑀𝑋 (0) = 𝜆2 𝑒 0 𝑒 𝜆(𝑒 + 𝜆𝑒 0 𝑒 𝜆(𝑒 = 𝜆2 + 𝜆 .
Thus 𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2 = 𝜆2 + 𝜆 − 𝜆2 = 𝜆 .
8.2.1: Approximating Binomial Probabilities
The Poisson distribution can be used in approximating binomial probabilities
when the number of trials n becomes large, and the expected number of
successes np remains unchanged.
Consider the binomial distribution with parameters n and p. Then
COURTESY OF MICHELLE OWINO

(𝑛)𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 , 𝑥 = 0,1, … , 𝑛 , 𝑞 = 1 − 𝑝


𝑓(𝑥) = { 𝑥
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
𝑚
Let 𝑚 = 𝑛𝑝 (constant) ⇒ 𝑝 = . Then
𝑛

𝑛! 𝑚 𝑥 𝑚 𝑛−𝑥
𝑓(𝑥) = ( ) (1 − 𝑛 )
𝑥!(𝑛−𝑥)! 𝑛

𝑛(𝑛−1)(𝑛−2)…(𝑛−𝑥+1)(𝑛−𝑥)! 𝑚𝑥 𝑚 𝑛 𝑚 −𝑥
= (1 − 𝑛 ) (1 − 𝑛 )
𝑥!(𝑛−𝑥)! 𝑛𝑥

1 𝑛 𝑛−1 𝑛−𝑥+1 𝑚 𝑛 𝑚 −𝑥
= ( ×
𝑥! 𝑛 𝑛
× …×
𝑛
) 𝑚 𝑥 (1 − 𝑛 ) (1 − 𝑛 )

But
𝑚 −𝑥 𝑛 𝑛−1 𝑛−𝑥+1
lim (1 − ) = 1 , lim ( × × …× ) = 1 and
𝑛→∞ 𝑛 𝑛
𝑛→∞ 𝑛 𝑛
𝑚 𝑛
lim (1 − ) = 𝑒 −𝑚 . Therefore taking limits as 𝑛 → ∞ and holding np
𝑛→∞ 𝑛
fixed,
We have
𝑚𝑥 𝑒 −𝑚
𝑓(𝑥) → . Hence
𝑥!

𝑒 −𝑛𝑝 (𝑛𝑝)𝑥
lim (𝑛𝑥)𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 =
𝑛→∞ 𝑥!

for fixed np. Thus for large but finite n and small p, one can approximate the
binomial distribution with parameters n and p with the Poisson distribution
with mean 𝑚 = 𝑛𝑝 .
Example 8.2
A machine produces 1% defective items. Suppose it produces 1000 items.
What is the probability that an item selected at random is defective?
Solution
Let X be the number of defective items among the 1000 items produced by the
machine. Then X is binomially distributed with parameters
𝑛 = 1000 and 𝑝 = 0.01. Therefore

(1000)(0.01)𝑥 (0.99)1000−𝑥 , 𝑥 = 0,1, … ,1000


𝑓(𝑥) = { 𝑥
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
COURTESY OF MICHELLE OWINO

1000
𝑃(𝑋 = 1) = 𝑓(1) = ( ) (0.01)1 (0.99)999 = 0.00044
1
Using the Poisson approximation with 𝑚 = 𝑛𝑝 = 10 we have
𝑒 −1010𝑥
(1000
𝑥
)(0.01)𝑥 (0.99)1000−𝑥 ≃ 𝑥!
And

𝑒 −10101
𝑃(𝑋 = 1) ≃ = 0.0005
1!

8.4: Assessment
1. Use the Poisson approximation to compute the following probabilities
(i) 𝑃(𝑋 = 45) , where X is a binomial random variable with parameters
𝑛 = 100 and = 0.5 .
(ii) 𝑃(𝑋 ≤ 2) , where X is a binomial random variable with parameters
𝑛 = 120 and = 0.04 .
2. If X is a random variable with Poisson distribution satisfying 𝑃(𝑋 = 0) =
𝑃(𝑋 = 1), what is (𝑋) ?
1
3. If X has a Poisson distribution and 𝑃(𝑋 = 0) = , what is (𝑋) ?
2
COURTESY OF MICHELLE OWINO

LESSON NINE
NORMAL DISTRIBUTION
9.1: Introduction
In this lesson we consider the normal distribution which plays an important
role in solving everyday problems. If we want to compare performance of
students in different subjects we must standardize their scores assuming marks
are approximately normal.
9.2: Lesson Learning outcomes
By the end of this lesson the learner will be able to:
i. Define a normal distribution,
ii. State properties of a normal distribution,
iii. obtain the mean, variance and moment generating function of a
normal random variable,
iv. State some of the uses of normal distribution in everyday life.

9.3: Normal Distribution


A continuous random variable X is defined to be normally distributed if its
density is given by
𝑓(𝑥) =
1
1 − 2 (𝑥−𝜇)2
𝑒 2𝜎 , −∞ < 𝑥 < ∞ , −∞ < 𝜇 < ∞ , 𝜎 > 0
{√2𝜋𝜎2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
The graph of the normal distribution, called the normal curve, is a belled-
shaped curve that extends indefinitely in both directions, with the horizontal
axis as its asymptote.
If a random variable X is normally distributed with mean 𝜇 and standard
deviation 𝜎 , then it is usual to write
𝑋 ∽ 𝑁(𝜇, 𝜎)
9.3.1 : Moments of Normal Distribution
COURTESY OF MICHELLE OWINO

Suppose that a random variable X is normally distributed with mean 𝜇 and


standard deviation 𝜎 . Then the moment generating function of X can be
obtained as follows:
𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 )
Standardizing X we have
𝑋−𝜇
𝑍=
𝜎

So that 𝑍 ∽ 𝑁(0,1). But the moment generating function (m.g.f) is given by


𝑡2
𝑡𝑍 )
𝑀𝑍 (𝑡) = 𝐸(𝑒 = 𝑒 , −∞ < 𝑡 < ∞ .
2

Now 𝑋 = 𝜎𝑍 + 𝜇 .Thus
𝑀𝑋 (𝑡) = 𝐸[𝑒 𝑡𝑋 ]
= 𝐸[𝑒 𝑡(𝜎𝑍+𝜇) ]
= 𝑒 𝑡𝜇 𝐸[𝑒 𝑡𝜎𝑍 ]
Putting 𝑡 ⋇ = 𝑡𝜎 we have

∴ 𝑀𝑋 (𝑡) = 𝑒 𝑡𝜇 𝐸[𝑒 𝑡 𝑍 ]
2
𝑡∗
𝑡𝜇
=𝑒 𝑒 2

1 2 2
= 𝑒 𝑡𝜇+2𝜎 𝑡

and it exists for all real numbers t.


We can compute the mean and variance of X by using the above m.g.f.
1 2 2

𝑀𝑋 (𝑡) = (𝜇 + 𝜎 2 𝑡)𝑒 𝑡𝜇+2𝜎 𝑡


∴ 𝐸(𝑋) = 𝑀𝑋 (0) = 𝜇𝑒 0 = 𝜇.
1 2 2 1 2 2
∕∕
𝑀𝑋 (𝑡) = (𝜇 + 𝜎 2 𝑡)2 𝑒 𝑡𝜇+2𝜎 𝑡
+ 𝜎 2 𝑒 𝑡𝜇+2𝜎𝑡

∕∕
∴ 𝐸(𝑋 2 ) = 𝑀𝑋 (0) = 𝜇2 + 𝜎 2 , ∴ 𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) −
[𝐸(𝑋)]2
𝑉𝑎𝑟(𝑋) = 𝜇2 + 𝜎 2 − 𝜇2 = 𝜎 2 .
Example 9.1
COURTESY OF MICHELLE OWINO

A random variable X is normally distributed with mean 𝜇 and variance 𝜎 2 .


Determine the mean and variance of a new random variable 𝑌 = 𝑒 𝑋 .
Solution
𝐸(𝑌) = 𝐸(𝑒 𝑋 ) = 𝑀𝑋 (1)
1 2 2
Where 𝑀𝑋 (𝑡) = 𝑒 𝑡𝜇+2𝜎 𝑡
is m.g.f of X.
1 2
∴ 𝐸(𝑌) = 𝑒 𝜇+2𝜎
𝑉𝑎𝑟(𝑌) = 𝐸(𝑌 2 ) − [𝐸(𝑌)]2 .
2
But 𝐸(𝑌 2 ) = 𝐸(𝑒 2𝑋 ) = 𝑀𝑋 (2) = 𝑒 2𝜇+2𝜎
2 2
Therefore 𝑉𝑎𝑟(𝑌) = 𝑒 2𝜇+2𝜎 − 𝑒 2𝜇+𝜎 .
9.3.2 : Computing Normal Probabilities
If 𝑋 ∽ 𝑁(𝜇, 𝜎). Then 𝑃(𝑎 ≤ 𝑋 ≤ 𝑏) = 𝐹(𝑏) − 𝐹(𝑎). Therefore to compute
this probability we need to standardize X i.e
𝑋−𝜇
𝑍=
𝜎

Where 𝑍 ∽ 𝑁(0,1) . The p.d.f of Z is given by


1 2
1
𝑒 −2 𝑧 , −∞<𝑧<∞
𝑓(𝑧) = {√2𝜋
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
The standardized normal curve is symmetrical about z=0. Thus
𝑃(𝑍 ≤ −𝑎) = 𝑃(𝑍 ≥ 𝑎) = 1 − 𝑃(𝑍 ≤ 𝑎)
For any real number a (see the figure below)
Graph of f(z)
1
𝑧 1 − 𝑦2
Φ(𝑧) = ∫−∞ √2𝜋 𝑒 2 𝑑𝑦 . Therefore

Φ(−𝑎) = 1 − Φ(𝑎) or more generally


Φ(−𝑧) = 1 − Φ(𝑧) for all real z.
𝑎−𝜇 𝑋−𝜇 𝑏−𝜇
𝑃(𝑎 ≤ 𝑋 ≤ 𝑏) = 𝑃( ≤ ≤ )
𝜎 𝜎 𝜎
COURTESY OF MICHELLE OWINO

𝑎−𝜇 𝑏−𝜇
= 𝑃( ≤𝑍≤ )
𝜎 𝜎
𝑏−𝜇 𝑎−𝜇
= Φ( ) − Φ( )
𝜎 𝜎

Example 9.2
A random variance X is normally distributed with mean 50 and standard
deviation 10. Calculate 𝑃(45 ≤ 𝑋 ≤ 62) .
Solution
𝜇 = 50 , 𝜎 = 10 ⇒ 𝑋 ∽ 𝑁(50,10).
45−50 𝑋−50 62−50
𝑃(45 ≤ 𝑋 ≤ 62) = 𝑃( ≤ ≤ )
10 10 10

= 𝑃(−0.5 ≤ 𝑍 ≤ 1.2)
= Φ(1.2) − Φ(−0.5)
= Φ(1.2) − [1 − Φ(0.5)]
= 0.8849 − [1 − 0.6915]=0.5764.
Example 9.3
In an examination the average mark was 76.5 and the standard deviation was
9.5. If 15% of the class scored grade A and the marks are assumed to follow a
normal distribution, what is the lowest possible grade A mark and the highest
possible grade B mark?
Solution
𝑋 ∽ 𝑁(76.5 , 9.5).
Let a be the lowest possible grade A mark . Then
𝑃(𝑋 ≥ 𝑎) = 0.15
𝑎−76.5
Standardizing X we have 𝑃 (𝑍 ≥ ) = 0.15 or
9.5
𝑎−76.5
𝑃 (𝑍 ≤ ) = 0.85 .
9.5

Using the normal tables we have


𝑎−76.5
= 1.04 ⇒ 𝑎 = 86.4
9.5

Therefore, the lowest grade A mark is 87, and the highest grade B mark, is 86.
COURTESY OF MICHELLE OWINO

Example 9.4
If a random variable X is normally distributed with mean 𝜇 and variance 𝜇2 ,
and if 𝑃(𝑋 ≤ 8) = 0.95 , determine 𝑃(4 ≤ 𝑋 ≤ 11).
Solution
𝑋 ∽ 𝑁(𝜇, 𝜇)
8−𝜇
𝑃(𝑋 ≤ 8) = 𝑃 (𝑍 ≤ ) = 0.95
𝜇

8−𝜇 8−𝜇
i.e Φ ( ) = 0.95 ⇒ = 1.65
𝜇 𝜇

𝜇 = 3.02.
4−𝜇 11 − 𝜇
∴ 𝑃(4 ≤ 𝑋 ≤ 11) = 𝑃 ( ≤𝑍≤ )
𝜇 𝜇
= 𝑃(0.32 ≤ 𝑍 ≤ 2.64)
= Φ(2.64) − Φ(0.32)
= 0.9495 − 0.6255 = 0.3240.

Example 9.5 Let X be 𝑁(𝜇, 𝜎) so that 𝑃(𝑋 ≤ 89) = 0.90 and 𝑃(𝑋 ≤ 94)0.95.
Find 𝜇 and 𝜎 2 .
Solution

89−𝜇 89−𝜇
𝑃(𝑋 ≤ 89) = 0.90 ⇒ 𝑃 (𝑍 ≤ 𝜎 ) = 0.90 ⇒ 𝜎 = 1.28

𝜇 + 1.28𝜎 = 89 … … … … . . (1)
Similarly

94−𝜇 94−𝜇
𝑃(𝑋 ≤ 94) = 0.95 ⇒ 𝑃 (𝑍 ≤ 𝜎 ) = 0.95 ⇒ 𝜎 = 1.65

𝜇 + 1.65𝜎 = 94 … … … … . . (2)
Solving equations (1) and (2) simultaneously we have
𝜇 = 71.7 and 𝜎 2 = 182.25
COURTESY OF MICHELLE OWINO

9.5 Assessment
1. Given that X is normal with mean 10 and variance 4, compute
𝑃(|𝑋 − 10| > 1.8).
2. If 𝑋 ∽ 𝑁(10, 𝜎) and 𝑃(𝑋 > 12) = 0.1537, determine 𝑃(9 < 𝑋 < 11).
𝑋−𝜇
3. If 𝑋 ∽ 𝑁(𝜇, 𝜎), find the constant b so that 𝑃 (−𝑏 ≤ ≤ 𝑏) = 0.95.
𝜎
4. Let X be normally distributed with mean 𝜇 and variance 𝜎 2 ,and suppose
that (𝑋 ≤ 69) = 0.90 and 𝑃(𝑋 ≤ 74) = 0.95. Find 𝜇 and 𝜎 2 .
5. The time required to perform a certain job is a random variable having a
normal distribution with mean 50 minutes and a standard deviation of
10 minutes. Compute the probabilities that
(i) the job will take more than 75 minutes,
(ii) the job will take less than 60 minutes,
(iii) the job will take between 45 and 60 minutes.

LESSON TEN
GAMMA, EXPONENTIAL AND BETA
DISTRIBUTIONS
10.1: Introduction
In this lesson we will discuss gamma, exponential and beta distributions.
Their moments will be discussed.
10.2: Lesson Learning outcomes
By the end of this lesson the learner will be able to:
i. State the probability distributions of gamma, exponential and beta
random variables,
ii. Obtain the moments of gamma, exponential and beta random
variables.

10.3 : Gamma, Exponential and Beta Distributions

10.3.1: Gamma Distributions


COURTESY OF MICHELLE OWINO

A continuous random variable X is said to have the gamma


distribution with parameters 𝛼 and 𝛽 (𝛼 > 0 , 𝛽 > 0) if its p.d.f is of
the form
𝛽 𝛼 𝛼−1 −𝛽𝑥
𝑥 𝑒 , 𝑥>0
𝑓(𝑥) = {Γ(𝛼)
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Therefore, we write 𝑋 ∽ G(𝛼 , 𝛽) to mean that X has the gamma


distribution with parameters 𝛼 and 𝛽 .
10.3.1.1: Moments of the Gamma Random variable
The kth moment of a gamma random variable X about the point x=0 is given
by

𝑘)
𝐸(𝑋 = ∫ 𝑥 𝑘 𝑓(𝑥)𝑑𝑥
0

𝛽𝛼 ∞
= ∫ 𝑥 𝛼+𝑘−1 𝑒 −𝛽𝑥 𝑑𝑥
Γ(𝛼) 0

𝛽𝛼 Γ(𝛼+𝑘) Γ(𝛼+𝑘)
= . =.
Γ(𝛼) 𝛽 𝛼+𝑘 𝛽 𝑘 Γ(𝛼)

Γ(𝛼+1) 𝛼Γ(𝛼) 𝛼
Thus 𝐸(𝑋) = = = which the mean of X.
𝛽 Γ(𝛼) 𝛽Γ(𝛼) 𝛽
Γ(𝛼+2) (𝛼+1)αΓ(𝛼) (𝛼+1)α
Now 𝐸(𝑋 2 ) = = =
𝛽 2 Γ(𝛼) 𝛽 2 Γ(𝛼) 𝛽2

Therefore 𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2


(𝛼+1)α 𝛼2 𝛼
= − = .
𝛽2 𝛽2 𝛽2

The m.g.f of X is given by


𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 )

= ∫𝑥=0 𝑒 𝑡𝑥 𝑓(𝑥)𝑑𝑥
COURTESY OF MICHELLE OWINO

𝛽𝛼 ∞
= ∫ 𝑒 𝑡𝑥 𝑥 𝛼−1 𝑒 −𝛽𝑥 𝑑𝑥
Γ(𝛼) 𝑥=0

𝛽𝛼 ∞
= ∫ 𝑥 𝛼−1 𝑒 −(𝛽−𝑡)𝑥 𝑑𝑥
Γ(𝛼) 𝑥=0

𝛽𝛼 Γ(𝛼) 𝛽 𝛼
= . (𝛽−𝑡)𝛼 = ( ) , 𝑡<𝛽
Γ(𝛼) 𝛽−𝑡

We can now use this m.g.f of X to determine the mean and variance of X.

𝑀𝑋 (𝑡)=𝛼𝛽 𝛼 (𝛽 − 𝑡)−𝛼−1
Therefore
∕ 𝛼
𝐸(𝑋) = 𝑀𝑋 (0)=𝛼𝛽 𝛼 (𝛽)−𝛼−1 =
𝛽

∕∕
𝑀𝑋 (𝑡)=𝛼(𝛼 + 1)𝛽𝛼 (𝛽 − 𝑡)−𝛼−2
∕∕ (𝛼+1)α
𝐸(𝑋 2 ) = 𝑀𝑋 (0)=𝛼(𝛼 + 1)𝛽𝛼 (𝛽)−𝛼−2 =
𝛽2

Therefore 𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2


(𝛼+1)α 𝛼2 𝛼
= − = .
𝛽2 𝛽2 𝛽2

10.3.2: Exponential Distribution


If a random variance X has density given by
−𝜆𝑥
𝑓(𝑥) = {𝜆𝑒 , 𝑥 > 0 , 𝜆 > 0
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Then X is defined to have an exponential distribution.

𝐸(𝑋) = ∫0 𝑥𝑓(𝑥)𝑑𝑥

∞ 1
= 𝜆 ∫0 𝑥𝑒 −𝜆𝑥 𝑑𝑥 =
𝜆


𝐸(𝑋 2 ) = ∫0 𝑥 2 𝑓(𝑥)𝑑𝑥

∞ 2
= 𝜆 ∫0 𝑥 2 𝑒 −𝜆𝑥 𝑑𝑥 = .
𝜆2

Therefore 𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2


COURTESY OF MICHELLE OWINO

2 1 1
= − = .
𝜆2 𝜆2 𝜆2

The moment generating function of an exponential random variable is given by

𝑀𝑋 (𝑡) = 𝐸(𝑒 𝑡𝑋 )

= ∫𝑥=0 𝑒 𝑡𝑥 𝑓(𝑥)𝑑𝑥

= 𝜆 ∫𝑥=0 𝑒 𝑡𝑥 𝑒 −𝜆𝑥 𝑑𝑥
∞ 𝜆
= 𝜆 ∫𝑥=0 𝑒 −(𝜆−𝑡)𝑥 𝑑𝑥 = ,𝑡 < 𝜆 .
𝜆−𝑡

The mean and variance of X can be obtained by using the above m.g.f as
follows:
∕ 𝜆
𝑀𝑋 (𝑡) = (𝜆−𝑡)2

∕ 𝜆 1
∴ 𝐸(𝑋) = 𝑀𝑋 (0) = (𝜆−0)2 =
𝜆

∕∕ 2𝜆
𝑀𝑋 (𝑡) = (𝜆−𝑡)3

∕∕ 2𝜆 2
∴ 𝐸(𝑋 2 ) = 𝑀𝑋 (0) = (𝜆−0)3 =
𝜆2

Therefore 𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2


2 1 1
= − = .
𝜆2 𝜆2 𝜆2

Example 10.1
Suppose that the number of minutes required to serve a costumer at service
counter has an exponential distribution with mean 2. Compute the probability
that the time required to serve a single costumer will exceed 4 minutes.
Solution
Let X denote the number of minutes required to serve a costumer at a service
counter. Then
1 1
𝐸(𝑋) = 2 = ⇒ 𝜆 =
𝜆 2

Hence the p.d.f of X is given by


COURTESY OF MICHELLE OWINO

1
1− 𝑥
𝑓(𝑥) = {2 𝑒 , 𝑥 > 0
2

0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
∞ 1 ∞
1 −1𝑥 − 𝑥
∴ 𝑃(𝑋 > 4) = ∫ 𝑒 2 𝑑𝑥 = [−𝑒 2 ] = 0.1353
4 2 4

10.3.3 : Beta Distribution


A continuous random variable X is said to have the beta distribution
with parameters 𝛼 and 𝛽 (𝛼 > 0 , 𝛽 > 0) if its p.d.f is of the form
Γ(𝛼+𝛽)
𝑥 𝛼−1 (1 − 𝑥)𝛽−1 , 0 < 𝑥 < 1
𝑓(𝑥) = {Γ(𝛼)Γ(𝛽)
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

1 Γ(𝛼)Γ(𝛽)
NB: ∫0 𝑥 𝛼−1 (1 − 𝑥)𝛽−1 𝑑𝑥 = = Β(𝛼, 𝛽)
Γ(𝛼+𝛽)

10.3.3.1 : Moments of Beta Random variable


The moments of the beta distribution are computed as follows:

1
𝑘)
𝐸(𝑋 = ∫ 𝑥 𝑘 𝑓(𝑥)𝑑𝑥 , 𝑘 = 1,2, …
0

Γ(𝛼+𝛽) 1 𝑘
= ∫ 𝑥 𝑥 𝛼−1 (1 − 𝑥)𝛽−1 𝑑𝑥
Γ(𝛼)Γ(𝛽) 0

Γ(𝛼+𝛽) 1
= ∫ 𝑥 𝛼+𝑘−1 (1 − 𝑥)𝛽−1 𝑑𝑥
Γ(𝛼)Γ(𝛽) 0

Γ(𝛼+𝛽) Γ(𝛼+𝑘)Γ(𝛽)
= .
Γ(𝛼)Γ(𝛽) Γ(𝛼+𝛽+𝑘)

Γ(𝛼+𝛽) Γ(𝛼+𝑘)
= .
Γ(𝛼) Γ(𝛼+𝛽+𝑘)
Putting k=1 we have
Γ(𝛼+𝛽) Γ(𝛼+1)
𝐸(𝑋) = .
Γ(𝛼) Γ(𝛼+𝛽+1)

Γ(𝛼+𝛽) αΓ(𝛼) 𝛼
= . (𝛼+𝛽)Γ(𝛼+𝛽) = .
Γ(𝛼) 𝛼+𝛽
COURTESY OF MICHELLE OWINO

For k=2 we have


Γ(𝛼+𝛽) Γ(𝛼+2)
𝐸(𝑋 2 ) = .
Γ(𝛼) Γ(𝛼+𝛽+2)

Γ(𝛼+𝛽) α(𝛼+1)Γ(𝛼)
= . (𝛼+𝛽)(𝛼+𝛽+1)Γ(𝛼+𝛽)
Γ(𝛼)

𝛼(𝛼+1)
= (𝛼+𝛽)(𝛼+𝛽+1)

Therefore 𝑉𝑎𝑟(𝑋) = 𝐸(𝑋 2 ) − [𝐸(𝑋)]2

𝛼(𝛼+1) 𝛼2
= (𝛼+𝛽)(𝛼+𝛽+1) − (𝛼+𝛽)2

𝛼𝛽
= (𝛼+𝛽)2 (𝛼+𝛽+1) .

10.4 : Assessment
1. Show that, if in gamma density 𝛼 = 1, then the gamma density
specializes exponential density.
2. Show that the beta distribution reduces to the uniform distribution
over (0,1) if 𝛼 = 𝛽 = 1.

LESSON ELEVEN
FUNCTIONS OF A RANDOM VARIABLE
11.1: Introduction
In this lesson we will be discussing change of variable technique. We will
consider the distribution of a function of a univariate random variable. That is,
COURTESY OF MICHELLE OWINO

for a given random variable X we seek the distribution of 𝑈 = Φ(𝑋) for some
function 𝑔(𝑢).
11.2: Lesson Learning outcome
By the end of this lesson the learner will be able to obtain the probability
distribution a new random variable which is expressed terms of a random
variable with known density.
11.3: Change of variable

11.3.1: Variables with Discrete Distributions


Suppose that a random variable X has a discrete distribution for which the
probability function is 𝑓(𝑥). Let 𝑈 = Φ(𝑋) be another random variable
defined as a function of X.
∴ 𝑔(𝑢) = 𝑃(𝑈 = 𝑢)
= 𝑃( Φ(𝑋) = 𝑢)
= ∑𝑥:𝜙(𝑥)=𝑢 𝑓(𝑥)
Example 11.1
Let X have the binomial distribution given by
4 3 𝑥 1 4−𝑥
𝑓(𝑥) = { ) (4) (4)
( 𝑥
, 𝑥 = 0,1,2,3,4
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Find the distribution of 𝑈 = 𝑋 2 .
Solution
The possible values of U are 0,1,4,9,16
∴ 𝑔(𝑢) = 𝑃(𝑈 = 𝑢)
= 𝑃(𝑋 2 = 𝑢) = 𝑃(𝑋 = √𝑢)

4 3 √𝑢 1 4−√𝑢
𝑔(𝑢) = {(√𝑢) (4) (4) , 𝑢 = 0,1,4,9,16
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Example 11.2
Suppose that X has the discrete distribution given in the following table:
COURTESY OF MICHELLE OWINO

𝑥 -3 -2 -1 0 1 2 3
𝑓(𝑥) 4 1 1 1 1 1 4
21 6 14 7 14 6 21
Find the distribution of the random variable 𝑈 = 3𝑋 2 + 1.
Solution
The possible values of U are 1,4,13,28.
1
𝑃(𝑈 = 1) = 𝑃(𝑋 = 0) =
7
1 1 1
𝑃(𝑈 = 4) = 𝑃(𝑋 = −1 𝑜𝑟 𝑋 = 1) = 𝑃(𝑋 = −1) + 𝑃(𝑋 = 1) = + =
14 14 7
𝑃(𝑈 = 13) = 𝑃(𝑋 = −2 𝑜𝑟 𝑋 = 2) = 𝑃(𝑋 = −2) + 𝑃(𝑋 = 2)
1 1 1
= + =
6 6 3

𝑃(𝑈 = 28) = 𝑃(𝑋 = −3 𝑜𝑟 𝑋 = 3) = 𝑃(𝑋 = −3) + 𝑃(𝑋 = 3)


4 4 8
= + = .
21 21 21

Hence the probability distribution of U is


𝑢 1 4 13 28
𝑔(𝑢) 1 1 1 8
7 7 3 21

11.3.2: Variables with Continuous Distributions


Suppose X is a random variable with p.d.f 𝑓(𝑥) . Let 𝑈 = Φ(𝑋) be another
random variable. Then for any real number u, the cumulative distribution
function G(u) of U is
𝐺(𝑢) = 𝑃(𝑈 ≤ 𝑢)
= 𝑃(Φ(𝑋) ≤ 𝑢)

= ∫𝑥:𝜙(𝑥)≤𝑢 𝑓(x) 𝑑𝑥
COURTESY OF MICHELLE OWINO

If G(u) is a continuous function of u, then at any point u at which G is


differentiable the p.d.f of u will be given by
𝑑𝐺(𝑢)
𝑔(𝑢) =
𝑑𝑢

Example 11.3 Let X have a p.d.f given by


2𝑥, 0 < 𝑥 < 1
𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Find the p.d.f of 𝑈 = 2𝑋 + 3.
Solution
The cumulative distribution of U is given by
𝐺(𝑢) = 𝑃(𝑈 ≤ 𝑢)
= 𝑃(2𝑋 + 3 ≤ 𝑢)
1
= 𝑃(𝑋 ≤ (𝑢 − 3)
2
1
(𝑢−3)
= ∫0 2 𝑓(𝑥)𝑑𝑥
1
(𝑢−3)
= ∫0 2 2𝑥 𝑑𝑥
1
(𝑢−3) 1
= [𝑥 2 ]20 = (𝑢 − 3)2
4

𝑑𝐺(𝑢) 1
∴ 𝑔(𝑢) = = (𝑢 − 3)
𝑑𝑢 2

The range of u is 3 < 𝑢 < 5. Hence


1
(𝑢 − 3), 3<𝑢<5
𝑔(𝑢) = {2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Example 11.4
Suppose that X has a uniform distribution on the interval (−1,1). Find the p.d.f
of 𝑈 = −𝑙𝑛|𝑋|.
Solution
In this case the p.d.f of X is
COURTESY OF MICHELLE OWINO

1
, −1<𝑥 <1
𝑓(𝑥) = { 2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
The cd.f of U is given by
𝐺(𝑢) = 𝑃(𝑈 ≤ 𝑢)
= 𝑃(−𝑙𝑛|𝑋| ≤ 𝑢)
= 𝑃(|𝑋| ≥ 𝑒 −𝑢 )
= 1 − 𝑃(|𝑋| ≤ 𝑒 −𝑢 )
= 1 − 𝑃(−𝑒 −𝑢 ≤ 𝑋 ≤ 𝑒 −𝑢 )
𝑒 −𝑢
= 1 − ∫−𝑒 −𝑢 𝑓(𝑥)𝑑𝑥
𝑒 −𝑢 1
= 1 − ∫−𝑒 −𝑢 𝑑𝑥 = 1 − 𝑒 −𝑢
2

Therefore, the p.d.f of U is


𝑑𝐺(𝑢)
𝑔(𝑢) =
𝑑𝑢

𝑒 −𝑢 , 𝑢>0
𝑔(𝑢) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

11.4: Direct derivation of the density function for a Continuous Random


Variable
Suppose X is a random variable and 𝑈 = Φ(𝑋) . If 𝑎 < 𝑥 < 𝑏 and 𝛼 < 𝑢 < 𝛽.
Let 𝑥 = 𝜔(𝑢), then the function 𝜔 is the inverse of Φ.
If we assumed that the function Φ is continuous and strictly increasing over
the interval (𝑎, 𝑏), the inverse function 𝜔 is also continuous and strictly
increasing over the interval (𝛼, 𝛽). Hence for any value 𝑢 such that 𝛼 < 𝑢 <
𝛽,
𝐺(𝑢) = 𝑃(𝑈 ≤ 𝑢)
= 𝑃(Φ(𝑋) ≤ 𝑢)
= 𝑃(𝑋 ≤ 𝜔(𝑢))
= 𝐹(𝜔(𝑢) )
COURTESY OF MICHELLE OWINO

Where F is the distribution function of X.


If we now assume in addition that 𝜔 is a differentiable function over the
interval (𝛼, 𝛽) , then the distribution of U is continuous and its p.d.f is given by
𝑑𝐺(𝑢)
𝑔(𝑢) =
𝑑𝑢
𝑑𝐹(𝜔(𝑢) )
=
𝑑𝑢
𝑑𝜔(𝑢)
= 𝑓(𝜔(𝑢) ) for < 𝑢 < 𝛽 .
𝑑𝑢

Similarly if Φ is continuous and strictly decreasing over the interval (𝑎, 𝑏), then
U will vary over some interval (𝛼, 𝛽) as X varies over the interval (𝑎, 𝑏) , and
the inverse function 𝜔 will be continuous and strictly decreasing over the
interval (𝛼, 𝛽) . Hence for 𝛼 < 𝑢 < 𝛽 ,
𝐺(𝑢) = 𝑃(𝑈 ≤ 𝑢)
= 𝑃(Φ(𝑋) ≤ 𝑢)
= 𝑃(𝑋 ≥ 𝜔(𝑢))
= 1 − 𝑃(𝑋 ≤ 𝜔(𝑢))
= 1 − 𝐹(𝜔(𝑢))
If 𝜔 is differentiable over the interval (𝛼, 𝛽), then
𝑑𝐺(𝑢)
𝑔(𝑢) =
𝑑𝑢
𝑑[1−𝐹(𝜔(𝑢) )]
=
𝑑𝑢
𝑑𝜔(𝑢)
= −𝑓(𝜔(𝑢) ) for 𝛼 < 𝑢 < 𝛽.
𝑑𝑢
𝑑𝜔(𝑢)
Since 𝜔 is strictly decreasing, < 0 and hence 𝑔(𝑢) can be expressed in
𝑑𝑢
the form
𝑑𝜔(𝑢)
𝑔(𝑢) = 𝑓( 𝜔(𝑢)) | |.
𝑑𝑢

Example 11.5
Let X be a random variable with p.d.f given by
1
𝑥, 0 < 𝑥 < 2
𝑓(𝑥) = {2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
COURTESY OF MICHELLE OWINO

Find the p.d.f of a new random variable 𝑈 = 1 − 𝑋 2 .


Solution
−3 < 𝑢 < 1
𝑢 = 1 − 𝑥 2 ⇒ 𝑥 = √1 − 𝑢
𝑑𝑥 −1
=
𝑑𝑢 2√1−𝑢
𝑑𝜔(𝑢)
∴ 𝑔(𝑢) = 𝑓( 𝜔(𝑢)) | |
𝑑𝑢
𝑑𝑥
= 𝑓( 𝑥) | |
𝑑𝑢
1
= 𝑓(√1 − 𝑢 )
2√1−𝑢
1 1 1
= √1 − 𝑢 . =
2 2 √1−𝑢 4
1
, −3<𝑢 <1
={ 4
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

11.6: Assessment
1. Suppose that X has the discrete distribution given in the following table:

x 0 1 2 3
f(x) 1 1 1 1
4 3 4 6

Find the distribution of the random variable 𝑌 = 4𝑋 2 + 1.


2. If the density of a random variable X is
−𝑥 2
𝑓(𝑥) = {2𝑥𝑒 , 𝑥>0
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
2
Find the density of 𝑌 = 𝑋 .
1
3. If 𝑈 = 𝑋 2 and 𝑓(𝑥) = , 0 < 𝑥 < 𝜃, 𝜃 > 0. Find the c.d.f of X and U.
𝜃
Find the density of U.
4. If 𝑓(𝑥) = 1 , 0 < 𝑥 < 1, find the density of 𝑌 = 3𝑋 + 1.
COURTESY OF MICHELLE OWINO

(1+𝑥)
5. If 𝑓(𝑥) = , −1 < 𝑥 < 1 , find the density of 𝑌 = 𝑋 2 .
2

References
1. Introduction to the Theory of Statistics by A.M. Mood, F.A. Graybill and
D.C. Boes .
2. Probability and Statistics by Rao V. Dukkip.
3. Statistical Methods by S.P.Gupta

You might also like