100% found this document useful (1 vote)
2K views32 pages

MAT097 Chapter 7 Random Variables (With Solution)

This document discusses chapter 7 on random variables from a statistics textbook. It begins by listing the learning outcomes for the chapter, which include distinguishing between discrete and continuous random variables, determining probability distribution functions, calculating expected values, and more. The document then defines random variables and provides examples of discrete and continuous random variables. It explains that a discrete random variable can take countable values while a continuous random variable takes values within an interval. Finally, it introduces the concept of a probability distribution function and provides examples of determining the probability distribution and probability values for different discrete random variables. It also shows how to represent the probability distribution as a table and graph.

Uploaded by

ARe-may Pudean
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views32 pages

MAT097 Chapter 7 Random Variables (With Solution)

This document discusses chapter 7 on random variables from a statistics textbook. It begins by listing the learning outcomes for the chapter, which include distinguishing between discrete and continuous random variables, determining probability distribution functions, calculating expected values, and more. The document then defines random variables and provides examples of discrete and continuous random variables. It explains that a discrete random variable can take countable values while a continuous random variable takes values within an interval. Finally, it introduces the concept of a probability distribution function and provides examples of determining the probability distribution and probability values for different discrete random variables. It also shows how to represent the probability distribution as a table and graph.

Uploaded by

ARe-may Pudean
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

MAT097

PUSAT ASASI
KAMPUS DENGKIL
Disember 2015 April 2016

CHAPTER 7 RANDOM VARIABLES

Learning Outcomes: Upon completion of this chapter, readers should be able to:

1. Distinguish between discrete and continuous random variables.


2. Determine the probability distribution function and cumulative distribution
function for discrete random variable.
3. Determine the probability using the probability density function for a
continuous random variable.
4. Calculate the expected values (expected mean) for discrete and
continuous random variables.
5. Calculate the variance and standard deviation for discrete and continuous
random variables.

7.1 RANDOM VARIABLES (Discrete and Continuous)

The term statistical experiment has been used to describe any process by which
several chance observations are obtained. All possible outcomes of an experiment
comprise a set that we have called the sample space. Often we are not interested in
the details associated with each sample point but only in some numerical description
of the outcome.
For instances, a coin is tossed 3 times.

S= {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}

n(S)= 8

If one is concerned with the number of heads that fall, then a numerical value of 0, 1,
2, or 3 will be assigned to each sample point.

The numbers 0, 1, 2, 3 are random quantities determined by the outcome of an


experiment. They may be thought of as the values assumed by some r.v. X which in
this case represents the number of heads when a coin is tossed 3 times.

Definition: A function whose value is a real number determined by each element in


the sample space is called a random variable.

We usually denote a random variable (r.v) by a capital letter( X, Y, R, etc) and the
particular value it takes by a small letter(x, y , r, etc)

Example : For tossing a coin 3 times,


Let X = number of heads in 3 tosses
x = 0, 1, 2, 3

1
Discrete Random Variable

Discrete random variable: a quantitative random variable that can assume a


countable number of values.

Examples of a discrete distribution are:


- The number of students in a class.
- The number of children in a family.
- The number of cars entering a carwash in a hour.

Let X have the following properties:


a) it is a discrete variable,
b) it can only assume values x1 , x2 ,, xn,
c) the probabilities associated with these values are p1, p2,, pn,
where P(X=x1) = p1 , P(X=x2) = p2 and so on,

then X is a d.r.v. if p1 + p2 ++ pn = 1

Continuous Random Variable

Continuous random variable: a quantitative random variables that do not take


exact values but are defined in an interval, such as variables concerning length,
time, height and mass.

Examples of a continuous random variables are:


- The time students spend doing homework.
- The weights of newborn babies in a country.
- The heights of 10 year olds.

7.2 PROBABILITY DISTRIBUTION FUNCTION

A probability distribution is the listing of all possible outcomes of an


experiment and the corresponding probability.

The probability distribution of a discrete random variable X is a table, graph or


formula that gives the probability of observing each of its possible values. It is called
the probability function and is denoted by the symbol f(x) or P(X =x)

Two requirement for a probability distribution of a discrete random variable:


(a) 0 P(x) 1
(b) P(x) =1

Example 1
Each of the following table lists certain value of X and their probability. Determine
whether or not each table represents a valid probability distribution.

(a) x f(x) (b) x f(x) (c) x f(x)


0 0.07 1 0.2 6 0.15
1 0.12 2 0.1 8 0.75
2 -0.05 3 0.6 10 0.1
3 0.86 4 0.05

2
Solution:
(a) For each value of x the probability is between 0 and 1 except when x 2 ,
f ( x ) 0.05 where P( x ) 0

The sum of the probabilities is:


P( x ) = p(0) + p(1) + p(2) + p(3)
= 0.07 + 0.12 + (-0.05) + 0.86
=1
Therefore, it is not a valid probability distribution even the sum of the
probabilities is 1

(b) For each value of x the probability is between 0 and 1 where 0 P( x ) 1


The sum of the probabilities is:
P( x )= P(1) + P(2) + P(3) + P(4)
= 0.2 + 0.1 + 0.6 + 0.05
= 0.95
where P( x ) 1
Therefore, it is not a valid probability distribution because the sum of the
probabilities is not 1

(c) For each value of x the probability is between 0 and 1 where 0 P( x ) 1


The sum of the probabilities is:
P( x )= P(6) + P(8) + P(10)
= 0.15 + 0.75 + 0.1
=1
Therefore, it is a valid probability distribution because for each value of x the
probability is between 0 and 1, and P( x ) 1

Example 2
A game consists of throwing tennis balls into a bucket from a given distance. The
probability that Ibrahim will get the tennis balls in the bucket is 0.4. A go consists of
three attempts. Construct the probability distribution for X, the number of tennis balls
that land in a basket in a go. Sketch the graph of the probability distribution function.

Solution:
Let A : the tennis ball landed in the basket
B : the tennis ball failed to land in the basket

A AAA

A B AAB

A A ABA

0.4 B B ABB

A BAA

0.6 A B BAB

B A BBA

B B BBB

3
Sample space, S = {AAA, AAB, ABA, ABB, BAA, BAB, BBA, BBB}

P(A) = 0.4 P(B) = 0.6


Let X be the number of tennis balls that land in a basket
x = 0, 1, 2, 3

P(X = 0) = P(BBB) = P(B) P(B) P(B)


= (0.6)(0.6)(0.6)
= 0.216

P(X = 1) = P(ABB) + P(BAB) + P(BBA)


= (0.4)(0.6)(0.6) + (0.6)(0.4)(0.6) + (0.6)(0.6)(0.4)
= 0.144 + 0.144 + 0.144
= 0.432

P(X = 2) = P(AAB) + P(BAA) + P(ABA)


= (0.4)(0.4)(0.6) + (0.6)(0.4)(0.4) + (0.4)(0.6)(0.4)
= 0.096 +0.096 + 0.096
= 0.288

P(X = 3) = P(AAA)
= (0.4)(0.4)(0.4)
= 0.064
Possible BBB ABB, BAB, AAB, BAA, AAA
outcome BBA ABA
x 0 1 2 3
P(X = x) 0.216 0.432 0.288 0.064

p( x) 0.216 0.432 0.288 0.064 = 1


The graph of the probability distribution function:

f (x)

0.40
0.35

0.30

0.25
0.20
0.15
0.10
0.10
0.05
x
0 1 2 3

4
Example 3
A box contains 3 white marbles and 3 black marbles. In a game, a player draws 3
marbles at random from the box. The score X is equal to ten times the number of
white marble drawn. Show that X is a discrete random variable.

Solution:
Let X 10 no. of white marbles drawn
x = 0, 10, 20

B BB
2/5
B
3/5
3/6 W BW

3/6 B WB
3/5
W
2/5
W WW

0 white marble
P(X = 0) = P(BB)
3 2 1

6 5 5

1 white, 1 black marbles


P(X = 10) = P(BW) + P(WB)
3 3 3 3

6 5 6 5
3 3 3

10 10 5

2 white, 0 black marbles


P(X = 20) = + P(WW)
3 2

6 5
1

5

x 0 10 20 Total
P(X = x) 1 3 1 1
5 5 5

1 3 1
x is a discrete random variable since P( X x)
5 5 5
=1

5
Example 4
The random variable X has the following probability distribution:
kx, x=1,2,3,4
P(X=x) = k(10-x), x=5,6,7
0 Otherwise
(k is a constant)
(a) Determine the value of k.
(b) Construct a probability distribution table for X.
(c) Find P(X =2).
(d) Find P(X =4 or 6).
(e) Find P(X =5.5).
(f) Determine the mode of X. (The mode of a discrete random variable is the
value of x when the probability P(X=x) is the highest).

Solution:
(a) P( x) 1
p(1) + p(2) + p(3) + p(4) + p(5) + p(6) + p(7) + ... =1
k(1) + k(2) + k(3) + k(4)+ k(10 - 5) + k(10 6) + k(10 7) + 0 = 1
k + 2k + 3k + 4k + 5k + 4k + 3k = 1
22k = 1
1
k=
22

Thus,
1
x, x 1, 2, 3, 4
22
P(X=x) = 1
(10 x ), x 5, 6, 7
22

0 otherwise
1 1
(b) When x = 1, P(X = 1) = (1) =
22 22

1 1
x = 2, P(X = 2) = (2) =
22 11

1 3
x = 3, P(X = 3) = (3) =
22 22

1 2
x = 4, P(X = 4) = (4) =
22 11

1 1 5
x = 5, P(X = 5) = (10 5) (5) =
22 22 22
1 4 2
x = 6, P(X = 6) = (10 6)
22 22 11

1 3
x = 7, P(X = 7) = (10 7)
22 22

6
Therefore, the probability distribution table for X is:

x 1 2 3 4 5 6 7
P(X=x) 1 2 3 4 5 4 3
22 22 22 22 22 22 22
P( X x ) 1

2 1
(c) P(X = 2) = =
22 11

(d) P(X = 4 or 6) = P(X = 4) + P(X = 6) = p(4) + p(6)

4 4
= +
22 22

8 4
=
22 11

(e) P(X =5.5) = 0


5
(f) The highest probability: P(X = 5) =
22
The mode of a discrete random variable is 5, x 5

Example 5
The random variable X has the following probability distribution:

2kx x=0,1,2
P(X=x) =
kx2 x=3,4

(a) Determine (i) the value of k (ii) the mode of X


(b) The probability that an observation taken from X will be
(i) more than 5,
(ii) at most 3
(iii) between 1 and 4

Solution:

(a) (i) P( x) 1
p(0) + p(1) + p(2) + p(3) + p(4) =1
2k(0) + 2k(1) + 2k(2) + k(3) 2 + k(4) 2 = 1
0 + 2k + 4k + 9k + 16k = 1
31k = 1
1
k=
31

Thus,

7
2 ; x=0,1,2
x
31
P(X=x) =
1 2 ; x=3,4
x
31

(ii)
2
x = 0, P(X = 0) = (0) = 0
31

2 2
x = 1, P(X = 1) = (1) =
31 31

2 4
x = 2, P(X = 2) = (2) =
31 31
1 9
x = 3, P(X = 3) = (3)2 =
31 31

1 16
x = 4, P(X = 4) = ( 4)2
31 31

x 0 1 2 3 4
P( X x ) 0 2 4 9 16
31 31 31 31
16
The highest probability, P( X 4) . Therefore, the mode of X is 4, x 4
31
(b) (i) more than 5

P(X > 5) = 0

(ii) at most 3
P(X 3) = P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3)
= p(0) + p(1) + p(2) + p(3)
2 4 9
=0+ + +
31 31 31
15
=
31

(iii) between 1 and 4

P(1 X 4) = P(X = 2) + P(X = 3)


4 9
= +
31 31

13
=
31

Cumulative Distribution Function for a Discrete Random Variable

8
A cumulative distribution function (cdf) is a function giving the probability that the
random variable X is less than or equal to t for every value T.
The cumulative distribution function F(t) of a random variable X is defined to be
F(t) = P( X t)

If X is a discrete distribution with pdf P(X=x) for x = x1, x2, . . . , xn


(a) The cumulative distribution function is given by
t
F(t) = P( X t) = P(X=x); t = x1, x2, . . . , xn,
x1

(b) P(x1 < X x2) = F(x2) - F(x1)

Example 6
A discrete random variable X has the following probability distribution:

x 0 1 2 3
P(X=x) 1/6 1/3 1/6 1/3
Determine the cumulative distribution function of X.
Solution:

x 0, F(x) = 0

0
P( X 0) 6
1
0 x 1, F(0) =
0

1
1 1
P( X 0) P( X 1) 6 +
1
1 x 2 , F(1) = =
0
3 2

2
1 1 2
P( X 0) P( X 1) P( X 2) 6 +
1
2 x 3, F(2) = + =
0
3 6 3

3
1 1 1
P( X 0) P( X 1) P( X 2) P( X 3) 6 +
1
x 3, F(3) = + + =1
0
3 6 3
Thus,
0 , x0

1
, 0 x 1
6

1
F( x ) , 1 x 2
2

2
, 2x3
3

1 , x3

Example 7

9
The probability distribution for the random variable X is given by:

f(x) = x/12 for x = 1, 2, 4, 5.

(a) Find the cumulative distribution function of X, F(x).


(b) Find P(1 < X 4).
(c) Sketch F(x)

Solution:

x 1 2 4 5
P(X=x) 1/12 2/12 4/12 5/12

(a) x 1 : F( x ) = 0

1
1 x 2 : F(1) =
12
1 2 3 1
2 x 4 : F(2) = + =
12 12 12 4

1 2 4 7
4 x 5 : F(4) = + + =
12 12 12 12

1 2 4 5
x5 : F(5) = + + + =1
12 12 12 12
Thus,
0 , x 1

1
, 1 x 2
12

1
F( x ) , 2x4
4

7
, 4x5
12

1 , x5

(b) P(1 < X 4) = F(4) F(1) Or P(1 < X 4) = P(X= 2) + P(X= 4)


7 1 2 4
= - = +
12 12 12 12
6 1 6 1
= = = =
12 2 12 2

(c)
f(x
)
10
1

7/12
TUTORIAL 7.1

1 X is a random variable with probability distribution function


0.1 x = 2,4,6,8
f(x) = 0.2 x = 1,3,5
0 Otherwise

(a) Show that X is a discrete random variable


(b) Find
(i) P(X=4)
(ii) P(X<4)
(iii) P(3 X < 6) ( Ans. 0.1, 0.5, 0.5)

2. Let X be a random variable denoting the number of heads minus the number
of tails in three tosses of a fair coin.
(a) List the elements of the sample space for the three tosses of coin.
(b) Find the probability distribution function for the random variable X.
(c) Find P(X>0)

3. A newly married couple plan to have three children only, assume that the
probability of getting a girl or a boy each time is the same. If X represents the
number of boys obtained, show that X is a discrete random variable.

4. A shipment of 7 television sets contains 2 defective sets. A hotel makes a


random purchase of 3 of the sets. If X is the number of defective sets
purchase by the hotel,
(a) Find the probability distribution function for the random variable X.
(b) Graph the probability distribution function.

5. Two balls are drawn in succession without replacement from a bag containing
4 red balls and 3 white balls. If X is the number of red balls obtained,
(a) State the possible outcomes and the values of the random variable X.
(b) Write the probability distribution function for the random variable X.
(c) If the balls are drawn with replacement. Construct the cumulative
distribution of X. Hence find P(X < 2). (Ans: 33/49)

6. Find the value of k such that each of the functions defined below is a
probability function:

11
(a) f(x) = kx2 , x= -2, -1, 0, 1, 2 (b) h(x) = k( 6 C x ) x =0,1,6
0 , otherwise 0 , otherwise

7. X is a discrete random variable with the following probability function:


0.1, if x=0
kx, if x=1,2,3
g(x) = k(6-x), if x = 4,5
0, Otherwise
Find
(a) the value of k,
(b) P( X<3),
(c) P( 1< X 4)
(d) P(X > 2)

8. Find the cumulative distribution function of the discrete random variable X with
the following probability distribution:

(a) 1/8 x = 0, 3 (b) x2 x = 1,2,3,4,5


25
f(x)= 3/8 x = 1, 2 f(x)=

0 otherwise 0 otherwise

(c) 1/3 x = -1, -2


f(x)= 1/6 x = 1, 2
0 otherwise

7.3 PROBABILITY DENSITY FUNCTION

Probability Density Function (pdf) for a Continuous Random Variable

A continuous random variable X is defined by its probability density distribution


function f(x) with f(x) 0 for all values of X which are valid in this interval.

If X is a continuous random variable with pdf f(x), then it must satisfy the following
conditions:

(a) f(x) 0 for all values of x


(b) f ( x)dx = 1
all x
x2
(c) P(x1 X x2) = P(x1 < X x2) =P(x1 X < x2) =P(x1 < X < x2) = f ( x)dx
x1

12
Example 8
X is a random variable which represents "time delay" for a train depart from Johor
Bahru ( in minute), with function f(x) = 0.2 - 0.02x, 0 X 10
(a) Show that f(x) is the probability density function for the continuous random
variable X.
(b) Find the probability that the train will be delayed by between 2 to 5 minutes.

Solution:
(a) f(x) 0 for 0 x 10

10
10 0.02 x 2
(0.2 0.02 x ) dx 0.2x
2
0 0


= 0.2x 0.01x 2 0
10

= [0.2(10) 0.01(10)2 ] 0

= (2 1) 0
=1
Hence, f ( x ) is the probability density function for the continuous random
variable x

Thus, f ( x)dx = 1
all x

(b) The probability the train will be delayed by between 2 to 5 minutes:


5
P( 2 x 5 ) = (0.2 0.02x) dx
2
5
0.02 x 2
= 0.2x
2
2
0.02(5)
2
0.02(2) 2
= 0.2(5) 0.2(2)
2 2

= 0.75 0.36
= 0.39

Example 9
The continuous random variable X has a probability density function f(x) as follows:
2( 2-x)/11, 0 < x 1
f(x) = 2x/11, 1 < x 3
0 Otherwise

(a) Sketch the graph of f(x).


(b) Show that f(x) is the probability density function for the continuous random
variable X.
(c) Find P(0.5 < X 2.5)

13
Solution:
2 4 2 2 2 6
(a) f (0 ) ( 2 0) f (1) (2 1) f (3 ) (3 )
11 11 11 11 11 11
2 4
f(2) = ( 2)
11 11

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

f(x)

6/11

4/11

2/11

x
1 2 3

1 3
2 1 2 3 2 x2 2 x2
(b)
11 0
(2 x ) dx
11 1
x dx = 2x
11

2 11 2
0 1
2 1 2 9 1
= 2
11 2 11 2 2
2 3 2
= 4
11 2 11
3 8
=
11 11
= 1 (shown)
Hence, f ( x ) is the probability density function for the continuous random
variable X

(c) P(0.5 < X 2.5):


1 2.5
2 x2 2 x2
2 .5
2 1 2

11 0.5
(2 x ) dx
11 x dx = 2x
11

2

11 2
1 0.5 1

14
2 1 (0.5) 2 2 (2.5) 2 1
= 2(1) 2(0.5)
11 2 2 11 2 2

2 3 7 2 25 1
=
11 2 8 11 8 2

5 21 13
= = = 0.591
44 44 22

Example 10
The continuous random variable X has a probability density function f(x) as follows:

a(1+x) 2 < x 5
f(x) =
0 Otherwise

Find
(a) the value of a.
(b) P(2 < X 3).

Solution:
5
(a) 2 a(1 x) dx 1
5
a 2 (1 x) dx =1
5
x2
a x =1
2
2

25 4
a 5 2 =1
2 2
35
a 4 = 1
2
27
a =1
2
2
a =
27
3
2 3 2 x2
27 2
(b) P(2 < X 3) = (1 x ) dx = x
27 2 2

2 (3 ) 2 ( 2) 2
= 3 2
27 2 2
2 15
= 4
27 2
7
=
27

15
Example11
The continuous random variable X has a probability density function f(x) as follows:
kx, 0 < x 2
f(x) = k(4-x), 2 < x 4
0 Otherwise
(a) Find the value of k
(b) Sketch the graph of f(x).
(c) Determine the value of P(1< X 5)
Solution:
2 4
(a) 0 kx dx 2 k(4 x) dx = 1
2 4
k 0 x dx k 2 (4 x) dx =1
2 4
x2 x2
k k 4 x =1
2 0 2
2
2 2
42 2 2
k 0 k 4( 4) 4(2) = 1
2 2 2

k ( 2) k ( 8 6 ) = 1
2k 2k =1
4k 1 ,
1
k
4
(b)
1 0 < x 2
x,
4
f(x) = 1 2 < x 4
(4-x),
4
0 Otherwise
f (x)

1/2 x

1/4

x x x
1 2 3 4

2 1 41 5
(c) P(1 < X 5) = 1 4
x dx 4
2
( 4 x ) dx 0 dx
4

16
1 2 1 4
=
4 1
x dx
4 2
( 4 x ) dx 0

2 4
1 x2 1 x2
= 4 x
4 2 1 4 2 2

1 22 1 1 42 22
= 4( 4) 4(2)
4 2 2 4 2 2

1 1 1
= 2 (16 8) (8 2)
4 2 4

1 3 1
= ( ) ( 2)
4 2 4

3 1
=
8 2

7
=
8

TUTORIAL 7.2

1. Let X be a continuous random variable with the following probability density


function.

k(x+2) 0<x<1
f(x)=
0 otherwise

(a) Find the value of k.


(b) Determine the value of
(i) P(X > 0.5) (ii) P(0.2 < X < 0.8).

2. Let X be a continuous random variable with the following probability density


function.

k(x-1)3 1<x<3
f(x) =
0 otherwise

(a) Find the value of k.


(b) Determine the value of
(i) P(X > 2.5) (ii) P(1 < X < 2.5).

17
3. Y is a continuous random variable with probability density function.

m(y+1)2 0y2
f(y) =
0 otherwise

(a) Find
(i) m (ii) P( 1 y 2 ) (iii) P(| y | 1)

(b) Sketch the graph of f(y)

4. The continuous random variable X has probability density function f(x) where
k(6-x) 0x3
f(x) =
0 Otherwise

a) Find the value of k.


b) Find P(1.5 X 2.5)
c) Find m if P( X m) 0.5

5. A random variable X has a probability density function

2k 1 x 2
f(x) = k 2x3
0 otherwise

(a) Find the value of constant k.


(b) Calculate P(1.5 < X < 2.5)

6. A random variable X has a probability density function


0x2
3
f(x) = 2 2x3
2
3
0 otherwise

Find the value of


(a) P(1 < X < 2.5)
(b) P(1.5<X<3.5)

EXPECTATION OF RANDOM VARIABLES (Discrete and Continuous)

Experimental approach:

Suppose we throw an unbiased dice 120 times and record the results:
Score, x 1 2 3 4 5 6 Total
Frequency, f 15 22 23 19 23 18 120

We can calculate the mean score obtained where

x
fx = (15 + 44 + 69 + 76 + 115 + 108) 120 = 3.558 (3 d.p.)
f
18
Theoretical approach:

The probability distribution for the r. v, X where X is the number on the dice is thrown
as:
Score,x 1 2 3 4 5 6 Total
Frequency, f 1/6 1/6 1/6 1/6 1/6 1/6 1

The expectation of X (or the expected value), written E(X) is given by

E(X) = all x x P(X=x) or E(X) = xi pi , i = 1,2,n.

Hence, the expected value or the expected mean is obtained as:

E(X) = x P( X x)
= 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6)
= 21/6
= 3.5

Comparing the two approaches, we have


i) a practical approach results in a frequency distribution and a mean value
ii) a theoretical approach results in a probability distribution and an expected value.

Expected Value

(i) Expected value (or the mean) of a discrete random variable


The expected value ( or the mean) of a discrete random variable with
probability
distribution P(X=x) for x = x1, x2, . . . , xn is given by
E(X) = all x x P(X=x) =
x P( X x )

(ii) Expected value (or the mean) of a continuous random variable


The expected value ( or the mean) of a continuous random variable with
probability density function f(x) is given by
E(X) = xf ( x) dx

Example 12
The r.v. X has the p.d.f. P(X=x) for x = 1, 2, 3.
x 1 2 3 total
P(X=x) 0.1 0.6 0.3 1
Find E(X)

Solution:
E( X) =
x P( X x )
= 1(0.1) + 2(0.6) + 3(0.3)
= 2.2

Example 13
A continuous random variable X has a probability density function f(x) as follows:
(4-x) / 4 1 x 3
f(x) =
0 Otherwise
Find E(X).

19
Solution:


E( X) x f ( x ) dx
3 4x
= 1 x dx
4
3
3 4x x2 1
= 1 4
dx
4
( 4 x x 2 ) dx
1
3
1 4x 2 x 3
=
4 2 3
1
1 1
= (18 9) 2
4 3
11
=
6

The expectation of any function of X, E[g(X)].

The definition of expectation can be extended to any function of the random variable
such as 10X, X2, (X-2)3 , etc.

In general, if g(X) is any function of a random variable X then


E[g(X)] = all x g(x)P(X=x) If X is a discrete random variable
E[g(X)] = g( x)f ( x) dx If X is a continuous random variable

Example 14
The r.v. X has the p.d.f. P(X=x) for x = 1, 2, 3, 4, 5

x 1 2 3 4 5 Total
P(X=x) 0.1 0.3 0.4 0.1 0.1 1

Calculate a) E(3), b) E(X), c) E(5X), d) E(5X +3), e) E(X 2), f) E(4X2-3).

Solution:
a) E(3) = 3

b) E( X) = x P( X x)
= 1(0.1) + 2(0.3) + 3(0.4) + 4(0.1) + 5(0.1)
= 2.8

c) E(5 X ) = 5x P( X x)
= 5(0.1) + 10(0.3) + 15(0.4) + 20(0.1) + 25(0.1)
= 14

d) E(5 X 3) = (5 x 3) P( X x)
= 8(0.1) + 13(0.3) + 18(0.4) + 23(0.1) + 28(0.1)
= 17

20
e) E( X2 ) = x 2 P( X x)
= 12(0.1) + 22 (0.3) + 32 (0.4) + 42 (0.1) + 52 (0.1)
=9

f) E( 4 X2 3) = 4 E( X2 ) 3
= 4(9) - 3
= 33

Example 15
A continuous random variable X has a probability density function f(x) as follows:

5x4 0 x 1
f(x) =
0 Otherwise
Calculate
(a) E(X) (b) E(2X) (c) E(X2)

Solution:
1
0 x(5x
4
(a) E( X) ) dx
1
0 5x
5
= dx
1
5x 6 5
= =
6 0 6

(b) E(2 X) 2 E( X)
5 5
= 2 =
6 3

1 2
(c) E( X 2 ) 0
x (5x 4 ) dx
1 6
= 0 5x dx
1
5x 7 5
= =
7 0 7

Rules of Expectation
(a)
(i) E(a) = a, where a is a constant
(ii) E(aX) = a E(X), where a is a constant
(iii) E(aX+b) = a E(X) + b, where a and b are constants.

(b) If X and Y are independent random variables, then


E(X + Y) = E(X) + E(Y)
E(aX + bY) = a E(X) + b E(Y)

21
Example 16
The random variable X has mean 2. Find a) E(3), b) E(5X), c) E(5X-3).

Solution:
Given E(X) = 2

a) E(3) = 3

b) E(5 X) 5 E( X)
= 5(2)
= 10

c) E(5 X 3) 5 E( X) 3 = 5(2) 3 = 7

Example 17
X and Y are independent variables such that E(X) = 4 and E(Y) = 5,find
(a) E(2X + 6Y) (b) E(7X- 4Y)

Solution:
(a) E(2 X 6 Y ) 2 E( X) 6 E( Y )
= 2(4) + 6(5)
= 8 + 30
= 38

(b) E(7 X 4 Y ) 7 E( X) 4 E( Y )
= 7(4) - 4(5)
= 28 - 20
=8

Example 18
A bicycle shop's records show that X, the number of bicycles sold per week has the
following distribution:

Number of bicycles 0 1 2 3 4
Relative frequency 0.04 0.24 0.33 0.36 0.03

(a) Calculate E(X), the mean number of bicycles sold per week.
(b) Suppose the profit per bicycle is RM160 and weekly fixed cost of running the
shop is RM 50. Express the profit function f(X) in terms of X. Find E(f(X))

Solution:
(a) E( X) = x P( X x)
= 0(0.04) + 1(0.24) + 2(0.33) + 3(0.36) + 4(0.03)
= 2.1

(b) f ( X) 160 X 50
E(f ( X)) E(160 X 50 )
160 E( X) 50
= 160(2.1) 50
= 286

22
7.5 VARIANCE OF RANDOM VARIABLES (Discrete and Continuous)

Consider the d.r.v. X and let E(X) = . The variance of X, written Var(X), is
given by
Var(X) = E( X - )2.
We can write the alternative form for the formula for Var(X) as
Var(X) = E(X2) [E(X)]2

Standard deviation of X = Var ( X)

Example 19

A discrete random variable X has the following probability distribution:


x 0 1 2 3 4
P(X=x) 0.1 0.2 0.4 0.2 0.1
Find (a) E(X) (b) Var(X)

Solution:
(a) E( X) = x P( X x)
= 0(0.1) + 1(0.2) + 2(0.4) + 3(0.2) + 4(0.1)
=2

(b) Var(X) = E( X 2 ) E( X)2


Find E( X2 ) first

E( X2 ) = x 2 P( X x)
= 02(0.1) + 12(0.2) + 22 (0.4) + 32 (0.2) + 42 (0.1)
= 5.2

E( X)2 = 22 = 4

Var(X) = 5.2 4 = 1.2


Example 20
A continuous random variable X has a probability density function f(x) as follows:

3x2/8 0 x 2
f(x) =
0 Otherwise
Calculate
(a) E(X) (b) E(X2) (c) Var(X)

Solution:
3x 2
2
2
x dx 3 x 3 dx
(a) E( X)
0 8
8
0
2
3 x4 3 16 3
= = =
8 4 8 4 2
0

23
2 2 3x 2
(b) E( X 2 ) x dx
0 8

2 2
3x 4 3 4
= 8
dx
8
x dx
0 0

2
3 x5
=
8 5
0

3 32 12
= =
8 5 5

(c) Var(X) = E( X 2 ) E( X)2


2
12 3
=
5 2

12 9
=
5 4

3
=
20

Rules of Variance of X

(a) For the r.v. X and the constants a and b,


(i) Var (a) = 0
(ii) Var (aX) = a2 Var (X)
(iii) Var (aX + b) = a2 Var (X)

(b) If X and Y are two independent random variables, then


(i) Var(X+Y) = Var(X) + Var(Y)
(ii) Var(aX+bY) = a 2 Var(X) +b2 Var(Y)

Example 21
The random variable X has variance 2, find
(a) Var (3), (b) Var (2X),
(c) Var (2X+ 3), (d) Var (2X-3).

Solution:
Given Var(X) = 2

a) Var(3) = 0

b) Var(2X) = 22 Var(X)
=4(2)
=8

24
c) Var(2X+3) = 22 Var(X)
=4(2)
=8

d) Var(2X-3) = 22 Var(X)
=4(2)
=8

Example 22
x2
The discrete random variable has p.d.f. P(X=x) = where x takes the values of
18
1, 2, 9. Find
(a) E(X), E(X2), (b) Var(X),
(c) the standard deviation of X (d) Var (1+7X), Var ( 2+ 5X).

Solution:
X 1 2 9
P(X=x) 1 2 11
6 9 18

a)
E( X) xP( X x)
1 2 11
1 2 9
6 9 18
55
=
9

E( X2 ) x2 P( X x)
1 2 11
12 22 92
6 9 18
455
=
9

b) Var ( X) E( X 2 ) E( X)2
2
455 55 455 3025

9 9 9 81
1070

81
1070
c) Std Deviation of X = ( X) Var ( X)
81
= 3.6345

d) Var (1 7X) Var (7X 1) 72 Var ( X)

1070
49
81
= 647.284

25
Var (2 5X) Var (5X 2) 52 Var ( X)
1070
25
81
= 330.25

Example 23
A continuous random variable X has a probability density function f(x) as follows:

2 0 x< 3
7
2
f(x) = (4 x) 3 x<4
7

0 Otherwise

Calculate
(a) mean of X (b) standard deviation of X (c) Var(7-2X) (d) Var (2+5X)

Solution
32 42
(a) Mean of X , E( X) x dx + x( 4 x ) dx
0 7 3 7
2 3 2 4
x dx + 4 x x 2 dx
7 0 7 3

3 4
2 x2 2 x3
2 x 2
7 2 0 7 3 3

2 9 2 64 27
0 + (32 ) 18

7 2 7 3 3
29 25

7 2 7 3
37

21

32 42
(b) E( X 2 ) x 2 dx + x 2 ( 4 x ) dx
70 7 3

2 3 2 2 4 2
x dx + 4 x x 3 dx
7 0 7 3

3 4
2 x3 2 4x 3 x 4

7 3 0 7 3 4 3

2 27 2 256 256 108 81


0 + ( )
7 3 7 3 4 3 4
2 2 67 25
(9 )
7 7 12 6

26
Var ( X) E( X 2 ) E( X)2
25 31
( )2
6 27
= 2.8484

( X) 1.688

(c) Var (7 2X) Var ( 2X 7)


( 2)2 Var ( X)
4(2.8484 )
= 11.394

(d) Var (2 5 X) Var (5 X 2)


(5)2 Var ( X)
= 25 (2.8484)
= 71.21

Example 24
X and Y are independent variables such that E(X2) = 10, E(Y2) = 20, Var(X) = 5 and
Var(Y) = 6. Find
(a) E(4X+3Y) (b) Var (4X + 3Y)

Solution
(a) E(4X + 3Y) = 4E(X) + 3E(Y)

Find E(X) first


Var ( X) E( X2 ) E( X)2
5 = 10 [E(X)]2
[E(X)]2 = 5
E( X) 5 = 2.236

Find E(Y)
Var ( Y ) E( Y 2 ) E( Y )2
6 = 20 [E(Y)]2
[E(Y)]2 = 14
E( Y) 14 = 3.742

E(4X + 3Y) = 4E(X) + 3E(Y)


= 4(2.236) + 3(3.742)
= 20.169

(b) Var(4X + 3Y) = 42 Var(X) + 32 Var(Y)


= 16(5) + 9(6)
= 134

27
TUTORIAL 7.3

1. A random variable X is such that P(X=1)=P(X=2) =P(X=3) = a, P(X =4) = 2a.


Find the value of E(X) and Var(X).

2. Discrete random variable X has the probability distribution P(X=x) given by


x 5 6 7 8 9
P(X=x) 0.2 0.25 0.38 0.1 0.07
Find E(X), E(X2), E(2X-3), E(3X2+2X-2), Var(X), Var(5X+1)

3. A bank vice president feels that each saving account customer has, on
average three credit cards. The following probability distribution represents
the number of credit cards that each customer owns, find the mean, variance
and standard deviation. Is the vice president correct?
Number of credit cards,x 0 1 2 3 4
P(X=x) 0.18 0.44 0.27 0.08 0.03

4.
x 1 2
P(X=x) a b
If E(X)=1.2, find the
(a) values of a and b in the probability distribution above.
(b) E(X), E(2X-5), Var(X), Var(-4X)

5. Discrete random variable X has the probability distribution P(RX=r) given by


x
1
, x = 1, 2, 3
2
P(X=x) = k , x=4

0 , otherwise
where k is a constant. Find
(a) the value of the constant k,
(b) the expectation of X, E(X), and the variance of X, Var(X),
(c) the expected value and variance of 4X+9

6. Find E(X) and Var (X) for the continuous random variable X with the probability
density function given by
(a) x/8 0x<4 (b) x/16 0 x <2
f(x) = f(x) = 1/8 2x<9
0 otherwise 0 otherwise

7. The continuous random variable X has the following probability density function
k(x-3)(x-1) 1x<3
f(x)=
0 otherwise

Find (a) the value of k


(b) the expectation of X, E(X), and the variance of X, Var(X),
(c) the expected value and variance of -3X+4

8. X and Y are independent variable such that E(X) = 2, E(Y) = 3, Var(X) = 1,


Var(Y) = 2. Find E(3X+2Y), E(3X-2Y), Var(3X+2Y), Var(-3X-2Y).

28
9. If E(X) = Var(X) = E(Y) = Var(Y) = 1, E(aX+bY) = 10, Var(aX+bY) = 52, a > b,
find the values of a and b.

Summary

If X is a discrete random variable with probability distribution function P(X=x)

(a) 0 P(X=x) 1
(b) P(X=x)=1

If X is a continuous random variable with pdf f(x), then it must satisfy the
following conditions:

(a) f(x) 0 for all values of x

(b) f ( x)dx = 1
all x
x2
(c) P(x1 X x2) = P(x1 < X x2) =P(x1 X < x2) =P(x1 < X < x2) = f ( x)dx
x1

If X is a discrete distribution with pdf P(X=x) for x = x1, x2, . . . , xn


The cumulative distribution function is given by
t
F(t) = P( X t) = P(X=x); t = x1, x2, . . . , xn,
x1

Expected Value (or the mean)

(a) discrete random variable


The expected value of a discrete random variable with probability
distribution P(X=x) for x = x1, x2, . . . , xn is given by
E(X) = all x x P(X=x) = x P( X x )
(b) continuous random variable
The expected value of a continuous random variable with probability
density function f(x) is given by
E(X) = xf ( x) dx

The expectation of any function of X, E[g(X)].


E[g(X)] = all x g(x)P(X=x) If X is a discrete random variable
E[g(X)] = g( x)f ( x) dx If X is a continuous random variable

Rules of Expectation
(a) (i) E(a) = a, where a is a constant
(ii) E(aX) = a E(X), where a is a constant
(iii) E(aX+b) = a E(X) + b, where a and b are constants.

(b) If X and Y are independent random variables, then


E(X + Y) = E(X) + E(Y)
E(aX + bY) = a E(X) + b E(Y)

29
Variance of Random Variables (Discrete and Continuous)

Var(X) = E( X - )2, E(X) =


Var(X) = E(X2) [E(X)]2
Standard deviation of X = Var ( X)

Rules of Variance of X

(a) For the r.v. X and the constants a and b,


(i) Var (a) = 0
(ii) Var (aX) = a2 Var (X)
(iii) Var (aX + b) = a2 Var (X)

(b) X and Y are two independent random variables,


(i) Var(X+Y) = Var(X) + Var(Y)
(ii) Var(aX+bY) = a 2 Var(X) +b2 Var(Y)

30
Selected Exercise 7

1. A random variable X has a probability distribution function S(x) given by


x 1
S( x ) x 2,3,4,5,6 where k is a constant
k
a) Find the value of k.
b) Construct the cumulative distribution function of X.
c) Find P( 3 X5)
d) Find E(X), Var(X), Hence determine E(7-2X) and Var(7-2X)

2. A person has four 1 sen and five 10 sen, and one 20 sen coins in her purse.
Two coins are taken at random from the purse, one after another without
replacement. Let X be the total value of the two coins.
a) Find the probability distribution of X.
b) What is the expected value of X?

3. A box contains nine numbered balls. Two balls are numbered 2, three balls
are numbered 3 and four balls are numbered 4. Two balls are selected at
random without replacement. Let x be the sum of the numbers on the
selected balls. The probability distribution for X, is shown in the table below:

x 4 5 6 7 8

P(X = x) a b c 1 1
3 6

1 1
a) Show that a and b . Hence, find the value of c.
36 6
58
Use your results in a) to show that the mean of X is .
b) 9
1
Hence, find E 4 X .
2

4. a) A random variable Y has the following distribution:

y -3 -1 0 1
P(Y=y) 0.25 0.25 0.25 0.25

Construct the probability distribution for the random variable


Q=Y(Y-1). Find the expectation of Q.

b) A random variable X has a probability density function f(x)= b(3x+2)


for 0 x 4. Find the value of b and the mean of the distribution.

31
5. The random variable X has a probability density function

1
, 0 x 2 where is a positive cons tan t
f ( x ) 2

0 otherwise

2
Show by integration that the variance of X is .
3

6. A continuous random variable X has the probability density function given by


1
f(x) = (k x ) , 0<x<k
2
0 Otherwise.

a) Determine the value of k.


b) Find the value of b, such that P(X > b) = 1/4 .
c) Find the mean and variance of X. Deduce the value of E(3X2 + 6X).

7. The total number of hours, measured in units of 10 hours that a student


spends on reading books over a period of one week is a continuous
random variable X that has a density function
x 2; 0 x 1

f(x) = k x; 1 x 2
0; elsewhere

a) Find the value of k.

b) Find the probability that over a period of one week, a student will
spend on reading books less than 15 hours.

c) Calculate the expected number of hours that a student will spend on


reading books over a period of one week.

8. The continuous random variable X has a probability density function given by

ax + bx3 0x1
f(x) =
0 otherwise

1
Given that E(X2) = , find:
3

i) the values of the constants a and b.

ii) the variance of X.

iii) the expected value and standard deviation for Y, where Y = - 5X + 4.

32

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy