Chapter 8 Random Variables
Chapter 8 Random Variables
LECTURE 1
TOPIC
: 8.0 RANDOM VARIABLES
SUBTOPIC : 8.1 Introduction to Random Variables
LEARNING :
understand the concept of discrete
OUTCOMES
and continuous random variable
construct probability distribution
table and probability distribution
function
Variable is defined as a characteristics or attribute
that can assume different values. Various letters of
alphabet, such as x, y, or z, are used to represent
variables.
A random variable is a variable whose value depends on
the outcome of a
random experiment.
Usually denote a
random variable by a
capital letter
(X, Y, Z) and the
particular value takes by a
small letter (x,y,z)
A random variable can be discrete or continuous
Discrete Random
Variable
Continuous
Mathematics QA026
Topic 8: Random Variables
Random
Variable
Example:
Indicate which of the following random variables are
discrete or continuous.
a) The number of cars sold at a dealership during a given
month
b)
c)
d)
e)
P( X
If
i 1
xi ) 1 ,
Mathematics QA026
Topic 8: Random Variables
b)
0 P( X ) 1
P( X x ) 1
i 1
Example 1
Two fair coins are tossed. X represents the number of tails
obtained.
a) Show that X is a discrete random variable
b) Construct a probability distribution table
c) Sketch a graph for the probability distribution of X
3
Mathematics QA026
Topic 8: Random Variables
Solution
Example 2
Three fair coins are tossed. X represents the number of
heads obtained.
a) Show that X is a discrete random variable
b) Construct a probability distribution table
c) Sketch a graph for the probability distribution of X
Mathematics QA026
Topic 8: Random Variables
Solution
Example 3
A fair dice is thrown. If X represents the number on the
dice, show that X is a discrete random variable. Find P( X 3)
and P(1 X 5) .
Solution
Mathematics QA026
Topic 8: Random Variables
Example 4
The probability distribution function of a discrete random
variable X is given by P( X x) k (4 x) for x 0,1,2,3 . Given that
k is a constant, find the value of k.
Solution
Mathematics QA026
Topic 8: Random Variables
Example 5
The probability distribution function of a discrete random
variable X is given by P( X x) kx for x 0,1,2,3,4 .
a) Find the value of the constant k
b) Obtain the probability distribution of X
c) Find
P ( X 1 or X 4)
i)
2
Mathematics QA026
Topic 8: Random Variables
ii)
P (| X 2 | 1)
Solution
Example 6:
A bag contains four red towels and three yellow towels. The
towels are to be drawn at random one by one without
replacement until a red towel is obtained. If X is the total
number of towels drawn from the bag:
a) Obtain the probability distribution of X
b) Find P(1 X 3)
8
Mathematics QA026
Topic 8: Random Variables
Solution
Example 7
The two unbiased spinners, one numbered of 1,2,3,4 and the
other numbered 1, 2, 3 are spun. The discrete random
variable X is the sum of the two results.
a) Tabulate the probability distribution of X
b) Find P( X 5)
Mathematics QA026
Topic 8: Random Variables
Solution
Example 8
Given the discrete random variable X has the following
probability distribution function.
2 px ,
px ,
g ( x)
x 0, 1, 2
x 3, 4
10
Mathematics QA026
Topic 8: Random Variables
p.
Hence, sketch
LECTURE 2
SUBTOPIC
: 8.2
LEARNING
OUTCOMES
Mathematics QA026
Topic 8: Random Variables
F ( x ) P( X x) P ( X x)
x1
a)
2.
P( X a)
3.
P ( a X b)
4.
P ( a X b)
5.
P ( a X b)
P ( X a ) P ( X a 1)
F (a ) F (a 1)
1 P( X a)
1 F (a )
P ( X b) P ( X a )
F (b) F ( a)
P ( X b 1) P ( X a)
F (b 1) F (a )
P ( X b) P ( X a 1)
F (b) F ( a 1)
Example 1
Find the cumulative distribution function for the random
variable X where X is the score on an unbiased dice.
Solution
The probability distribution for X is shown in the table:
x
P( X x)
12
Mathematics QA026
Topic 8: Random Variables
P( X x)
Example 2
For a discrete random variable X
distribution function F(x) is as shown :
Find
F(x)
0.2
0.32
(a) P(X = 3)
0.67 0.9
Solution
13
the
5
1
cumulative
Mathematics QA026
Topic 8: Random Variables
Example 3
The probability distribution function of a discrete random
variable X is given in the table below:
x
P( X x)
0
1
8
3
8
3
8
1
8
Mathematics QA026
Topic 8: Random Variables
Example 4
The probability distribution for random variable X is shown
in the table. Construct the cumulative distribution table
and find the cumulative distribution function, F( x).
P(X=x)
0.03
0.04
0.06
0.12
0.4
0.15
0.2
Solution
15
Mathematics QA026
Topic 8: Random Variables
Example 5
The discrete random variable X has the following
probability distribution function:
1
6 , x 0,2
1
f ( x) , x 1,3
3
0 , otherwise
Mathematics QA026
Topic 8: Random Variables
(b)
(c)
(d)
(e)
P(X < 1)
P(0 < X 3)
P(X > 2)
P(X > 1)
Solution
LECTURE 3
SUBTOPIC
LEARNING
OUTCOMES
17
Mathematics QA026
Topic 8: Random Variables
Mean, E ( X )
2)
E ( X 2 ) x 2 P( X x)
3)
E g ( X ) g x P ( X x )
x P( X
x)
Properties of Expectation
where b is constant
i)
E (b) b
ii)
E[ aX b] aE ( X ) b
iii) E[ g1 ( X ) g 2 ( X )] E[ g1 ( X )] E[ g 2 ( X )]
Example 1
Calculate the mean of this distribution
P( X x)
1
12
2
12
3
12
3
12
2
12
1
12
Solution
18
Mathematics QA026
Topic 8: Random Variables
Example 2
A discrete random variable Z has the following probability
distribution
z
P(Z=z)
1
0.1
2
0.2
t
0.7
19
Mathematics QA026
Topic 8: Random Variables
Example 3
A discrete random variable can only take the values 2 and 3
and has expectation 2.6. Find the probability P(X =2) and
P(X = 3).
Solution
20
Mathematics QA026
Topic 8: Random Variables
Example 4
A computer is programmed to produce a sequence of
integers, R in the range 0 to 5 inclusive, with probabilities
as shown below
P(R = r)
1
30
2
30
3
30
4
30
5
30
21
Mathematics QA026
Topic 8: Random Variables
i)
ii)
show that k =
calculate the mean of R
Solution
Example 5
Let X be the random variable with probability distribution
as follows:
P(X = x)
2
9
3
9
1
9
3
9
22
Mathematics QA026
Topic 8: Random Variables
Find:
(a) E(X)
(d) E(4X + 3)
(b) E(X 2)
(c) E(4X)
(e) E(2X2 + X 1)
Solution
LECTURE 4
SUBTOPIC
LEARNING
OUTCOMES
Mathematics QA026
Topic 8: Random Variables
1)
Var ( X ) E ( X ) 2 E ( X 2 ) [ E ( X )]2
2)
Var (a) 0
3)
Var ( aX ) a 2Var ( X )
4)
Example 1
Find the variance of the following distribution:
P(X = x)
1
12
2
12
3
12
3
12
2
20
1
12
Solution
24
Mathematics QA026
Topic 8: Random Variables
Example 2
A discrete random variable X has the following probability
distribution :
P(X = x)
1
0.4
2
0.2
Find :
25
3
0.3
4
0.1
Mathematics QA026
Topic 8: Random Variables
(a) Var(X)
(d) Var (2X + 4)
(b) Var(2)
Solution
Example 3
The probability distribution function of a discrete random
variable X is
x2
f x 55 , x 1, 2, 3, 4, 5
0 ,
otherwise
Find
26
Mathematics QA026
Topic 8: Random Variables
(a) E(X)
Solution
Example 4
The distribution of the number of muffins, X, bought by a
customer at a particular shop is given below
Probability
1
12
2
12
3
12
2
12
1
12
Mathematics QA026
Topic 8: Random Variables
Example 5
The table below lists all the possible values of the random
variable X, and their probabilities.
P(X = x)
1
12
2
12
3
12
3
12
2
12
1
12
Find
(a)
P ( X 5)
28
Mathematics QA026
Topic 8: Random Variables
(b)
(c)
P ( X 5)
P (3 X 5)
Solution
Example 6
The discrete random variable W has probability distribution
function as shown
w
P(W =
w)
3
0.1
2
0.25
1
0.3
Find
29
0
0.15
1
d
Mathematics QA026
Topic 8: Random Variables
(a)
(b)
(c)
(d)
the value of d,
P( 3 W 0)
P( W 1)
P( 1 W 1)
Solution
Example 7
The number of telephone calls received in 15 minutes on a
weekday at a reception counter is a discrete random
variable Y with the following probability distribution
y
P(Y = y)
0
0.1
1
0.1
2
0.2
Find
30
3
0.3
4
0.2
5
0.1
Mathematics QA026
Topic 8: Random Variables
(a)
(b)
(c)
(d)
(e)
(f)
Solution
LECTURE 5
SUBTOPIC
: 8.3
LEARNING :
OUTCOMES
31
Mathematics QA026
Topic 8: Random Variables
0 f ( x) 1
f ( x ) dx 1
P (a x b) f ( x )dx
a
P( X a) 0
P( X a) P( X a)
f ( x)dx
Example 1
Show that f ( x) 3x , 0 < x < 1 is a probability density function for a
random variable X .
2
Solution
32
Mathematics QA026
Topic 8: Random Variables
Example 2
Given the continuous random variable X has the following probability
density function:
f ( x)
Show that k =
3
64
kx 2
, 4 x 4
2
and k is a constant.
Solution
33
Mathematics QA026
Topic 8: Random Variables
Example 3
The continuous random variable X has probability density function
f(x) as follows:
2
11 (2 x),
2
f ( x)
x,
11
0,
0 x 1
1 x 3
otherwise
(a) Show that f(x) is the probability function for the continuous
random variable X.
(b) Find
X 2
2
34
Mathematics QA026
Topic 8: Random Variables
Example 4:
The continuous random variable X has probability density function
k ( x 1),
f ( x)
2k ,
0,
(a)
(b)
(c)
(d)
0 x2
2 x3
otherwise
35
Mathematics QA026
Topic 8: Random Variables
Example 5
X is a continuous random variable with probability density function
hx 2 ,
0,
g ( x)
(a)
(b)
Calculate P X 1 and
(c)
If P | X | m 0.5 , find m.
2 x 2
otherwise
P | X |
2
36
Mathematics QA026
Topic 8: Random Variables
LECTURE
SUBTOPIC
6
: 8.3 Continuous Random Variables
LEARNING :
OUTCOMES
37
Mathematics QA026
Topic 8: Random Variables
Note:
1.
F (t )
for x is defined as
F (t ) P ( X t )
f ( x ) dx
2.
P ( a X b ) P ( a X b) P ( a X b )
b
f ( x) dx
a
b
f ( x)dx
f ( x)dx
F (b) F (a )
3.
F ( ) 0
4.
f ( x)
and
F ( ) 1
d
F ( x)
dx
Example 1
X is a continuous random variable with probability density function
1
f x x , where 0 x 4 .
8
Find the cumulative distribution function
Solution
38
F (x ) .
Mathematics QA026
Topic 8: Random Variables
Example 2
X is a continuous random variable with probability density function,
1
f ( x) 4 x , 1 x 3. Find the cumulative distribution function.
4
Solution
39
Mathematics QA026
Topic 8: Random Variables
Example 3
The continuous random variable X has the cumulative distribution
function given by
; x0
0
2x
; 0 x2
5
F x
4 2
x2
3x 4 ; 2 x 3
2
5 5
1
; x3
Find
a)
P X 0 .5
40
Mathematics QA026
Topic 8: Random Variables
b)
P 1 X 2. 5
Solution
Example 4
The continuous random variable X has the probability density
function defined by:
1
2 , 0 x 1
1 x 1, 1 x 2
f ( x) 2
1
x 1, 2 x 3
2
0, otherwise
41
Mathematics QA026
Topic 8: Random Variables
Example 5
The random variable X has a cumulative distribution function given
by
x0
3
x
F x
27
1
0 x3
x3
Mathematics QA026
Topic 8: Random Variables
Solution
Example 6
The random variable X has a cumulative distribution function given
by
,x 2
ax 1 ,2 x 4
10
F ( x)
x b ,4 x 13
10
1
, x 13
43
Mathematics QA026
Topic 8: Random Variables
Find
a)
b)
c)
Solution
LECTURE
SUBTOPIC:
LEARNING
OUTCOMES :
7
8.3
Mathematics QA026
Topic 8: Random Variables
a)
E X
b)
E g X
c)
x f x dx
g x
E aX b
f x dx
ax b f x dx
Example 1
The random variables of X has probability density function:
a( x x 3 ) ; 0 x 1
f x
0 ; Otherwise
Example 2
The probability density function of the age of babies, x years being
brought to a post natal clinic is given by
3
x (2 x) 0 x 2
f(x) = 4
0
otherwise
Find the mean and
E ( X 2 ) of
Solution
45
Mathematics QA026
Topic 8: Random Variables
Example 3
The probability density function of X and Y are as follows:
f (x) = 3
0
1 x 4
otherwise
2
( y 1)
g(y) = 15
0
46
0 y3
otherwise
Mathematics QA026
Topic 8: Random Variables
Example 4
The continuous random variable X has probability density function f(x)
where
1
( x 3) 0 x 4
f(x) 20
0
otherwise
Find :
(a) E(X)
(b) E(2X + 5)
(d) E(X2 + 2X 3)
47
(c) E(X2)
Mathematics QA026
Topic 8: Random Variables
Solution
Var ( X )
If a is a constant,
a) Var (a) = 0
b) Var (aX) = a2 Var X
c) Var (aX + b) = a2Var X
Example 5
48
Mathematics QA026
Topic 8: Random Variables
kx 2 0 x 2
otherwise
Example 6
The continuous random variable X has probability density function f(x)
where
1
f (x) = ( 8 ) x, 0 x 4 .
Find :
(a) E(X)
(b) E(X2)
(c) Var(X )
(d) Standard deviation of X
(e) Var (3x + 2)
Solution
49
Mathematics QA026
Topic 8: Random Variables
50