0% found this document useful (0 votes)
31 views53 pages

Lu8 Random Variables (Students Version)

a) 0.12 b) 0.27 c) 0.06 d) 3

Uploaded by

Farrell Ng
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
0% found this document useful (0 votes)
31 views53 pages

Lu8 Random Variables (Students Version)

a) 0.12 b) 0.27 c) 0.06 d) 3

Uploaded by

Farrell Ng
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/ 53

PRP1046 MATHEMATICS 2

Session 2022/2023 ⋅ Semester 2

LU 8: RANDOM VARIABLES

NUR FAZLIANA RAHIM


AHMAD DEEDAT IBRAHIM
PRP1046 MATHEMATICS 2

• Introduction to Random Variables


8.1

• Discrete Random Variables


8.2

• Continuous Random Variables


8.3

• Expectation and Variance of Random Variables


8.4

2
8.1 INTRODUCTION TO RANDOM
VARIABLES PRP1046 MATHEMATICS 2

3
Learning Outcomes PRP1046 MATHEMATICS 2

At the end of this unit, students should be able to:

✓ define random variables.


✓ identify discrete and continuous variables

4
Definition PRP1046 MATHEMATICS 2

• A Random Variable is a variables whose numerical values


depend on the outcomes of a random experiment.
• Random variables are denoted by capital letters X, Y, ...
• The values of Random variables are denoted by small letters
such as 𝑥1 ,𝑥2 for two values of 𝑋.
• Probability is written as 𝑷 𝑿 = 𝒙 and read as ‘the probability
when the random variable 𝑋 takes the value 𝑥.

5
Discrete and Continuous Variables PRP1046 MATHEMATICS 2

Discrete Continuous
Random variables whose values Random variables whose values are
can be arranged in a finite list and continuum of real numbers such as
can be counted. an interval and cannot be counted.

Example : The number of cars sold Example : Amount of water


at a dealership during a given consumed by a family in each
month. month of a year.

6
EXAMPLE 1 PRP1046 MATHEMATICS 2

Here are two related random variables :

• Let 𝑿 be the number of heads showing when the coin comes to


rest. Then 𝑿 takes the value 0 if the coins finishes up ‘tails’ or 1 if
the coin finishes up ‘heads’.

• Let 𝒀 be the time between the commencement of the spin and


the coin coming to rest, measured in seconds.

7
8.2 DISCRETE RANDOM VARIABLE PRP1046 MATHEMATICS 2

8
Learning Outcomes PRP1046 MATHEMATICS 2

At the end of this unit, students should be able to:

❑DISCRETE RANDOM VARIABLES


✓ construct the probability distribution function
✓ find the cumulative distribution function for discrete
random variable.
✓ find probabilities from: (a) probability distribution function
or (b) cumulative distribution function.
9
Basic principle PRP1046 MATHEMATICS 2

For discrete random variable X,

✓ the values of the variable, x, are countable.


✓ the probability distribution is described using probability distribution
function, denoted by 𝑷 𝑿 = 𝒙 .
✓ the probability is the exact value of the function of 𝑷 𝑿 = 𝒂 at
𝑥 = 𝑎 (i.e. direct substitution).

10
Properties PRP1046 MATHEMATICS 2

❖ All probability for each x must be greater than or equal to 0;


𝑃 𝑋=𝑥 ≥0
❖The sum of probability of all x is 1;
σ𝑃 𝑋 = 𝑥 = 1
❖The cumulative frequency distribution is denoted by 𝐹 𝑥 , given by
𝐹 𝑥 =𝑃 𝑋≤𝑥

11
EXAMPLE 2 PRP1046 MATHEMATICS 2

Consider an experiment where three coins are tossed


simultaneously

Let 𝑋 denote the number of heads obtained when three


coins are tossed. The diagram shows the possible outcomes
where H denoted head and T denoted tail.

12
PRP1046 MATHEMATICS 2
TTT 0

TTH
THT 1
a) Construct a probability
HTT distribution table for 𝑋.
THH
HTH 2 b) Show that the sum of
HHT
probability of all x is equal to 1.
HHH 3

Sample space Value of 𝑿


(number of heads)

13
EXERCISE 1 PRP1046 MATHEMATICS 2

In a Recreation club, 20% of its members always pay the club membership fee
early. Three names are randomly selected from the club members list and
checked to see whether they paid their fees early or not.

a) If 𝐸 represents the members who pay early and 𝐿 represents the members
who pay late, what is the sample space for the selection?
b) 𝑌 is the random variable which represents the number of members who pay
early.
(i) Find the possible values of 𝑌.
(ii) Show that 𝑌 is a discrete random variable.

Ans: a) LLL, LLE, LEL, ELL, EEL, ELE, LEE, EEE , b)i) 0, 1, 2, 3 14
EXAMPLE 3 PRP1046 MATHEMATICS 2

Given that 𝐶 = 2, 4, 5 with probability distribution function


defined as

7−𝑐
𝑃 𝐶=𝑐 =
10

Tabulate the probability distribution function of 𝐶.

15
EXAMPLE 4 PRP1046 MATHEMATICS 2

Show that 𝑇 is a discrete random variable with probability


distribution function.

0.3 , 𝑡=3
0.2 , 𝑡 = 1 ,4
𝑓 𝑡 =
0.1 , 𝑡 = 2 ,5 ,6
0 , 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒

16
EXAMPLE 5 PRP1046 MATHEMATICS 2

A discrete random variable 𝑋 has integer values between 3 and 6


inclusive with probabilities function given by

𝑓 𝑥 = 𝑘𝑥 8 − 𝑥

a) Find the value of 𝑘.


b) Find 𝑃 𝑋 = 4 𝑜𝑟 𝑋 = 5 .

17
EXERCISE 2 PRP1046 MATHEMATICS 2

𝑤 2 −1
Given that 𝑃 𝑊 = 𝑤 = for 𝑤 = 1, 2, 3, 6.
46

a) Show that 𝑃 𝑊 = 𝑤 is a probability distribution function of 𝑊.


b) Hence, find
(i) 𝑃 𝑊 = 2
(ii) 𝑃 1 < 𝑊 < 3
(iii) the probability that 𝑊 is more than or equal to 3.

Ans: b)i) 3/46 b)ii) 3/46 b)iii) 43/46 18


EXERCISE 3 PRP1046 MATHEMATICS 2

𝑄 is a discrete random variable with probability distribution function

𝑐 𝑞+1 ,𝑞 = 1 ,3 ,5
𝑔 𝑞 =൝
where 𝑐 is a constant. 𝑐 𝑞−1 2 , 𝑞 = 4,6
1
a) Show that 𝑐 = .
46
b) Hence find
(i) 𝑃 2 < 𝑄 < 4
(ii) 𝑃 𝑄 − 2 ≤ 2
c) What is the probability that 𝑄 is an even number?
d) What is the mode?
Ans: b)i) 2/23 b)ii) 15/46 c) 17/23 d) 6 19
Cumulative Distribution Function for
Discrete Random Variables PRP1046 MATHEMATICS 2

The cumulative distribution function of a discrete random variable


𝑋 is defined as 𝑃 𝑋 ≤ 𝑥 = 𝐹 𝑥 , where 𝑥 is any real number.

𝑭 𝒙 = 𝑷 𝑿 ≤ 𝒙 = ෍𝑷 𝑿 = 𝒖
𝒖≤𝒙

where the sum on the right-hand side includes all the values of 𝑢,
𝑢 ≤ 𝑥.

20
Important Properties PRP1046 MATHEMATICS 2

For all 𝑎 ≤ 𝑏,

a) 𝐹 𝑎 = 0 and 𝐹 𝑏 = 1
b) 𝑃 𝑎 < 𝑥 ≤ 𝑏 = 𝐹 𝑏 − 𝐹(𝑎)
c) If 𝑚 is a median of a discrete random variable, then
𝐹 𝑚 = 𝑃 𝑥 ≤ 𝑚 = 0.5

21
EXAMPLE 6 PRP1046 MATHEMATICS 2

A probability distribution for the discrete random variable 𝑋 is as


shown.

𝑋 1 2 3 4 5
𝑃 𝑋=𝑥 0.10 0.25 0.25 0.32 0.08

a) Find the cumulative distribution function of 𝑋.


b) Draw the graph of cumulative distribution function of 𝑋.

22
EXERCISE 4 PRP1046 MATHEMATICS 2

Discrete random variable 𝑌 has the probability distribution


function of
4+𝑦
, 𝑦 = 0 ,1 ,2 ,3
𝑃(𝑌 = 𝑦) = ൞ 22
0 , 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒

Find the cumulative distribution function.

23
EXAMPLE 7 PRP1046 MATHEMATICS 2

The cumulative distribution function for a discrete random


variable 𝑅 is as follows.

𝑹 1 2 3 4 5
𝐹(𝑟) 0.34 0.46 0.73 0.79 1
Find
a) 𝑃 𝑅 = 2
b) 𝑃 𝑅 > 3
c) 𝑃 2 < 𝑅 < 5
d) the median
24
EXAMPLE 8 PRP1046 MATHEMATICS 2

Determine whether the following is a probability distribution


function or not. Justify your answer.
𝑿=𝒙 −𝟏 𝟑𝟐𝟗𝟗 1999 999
𝑷(𝑿 = 𝒙) 0.9997 0.0001 0.0001 0.0001

25
EXERCISE 5 PRP1046 MATHEMATICS 2

Identify whether the following function is a probability distribution


function or not. Justify your answer.

𝟎. 𝟒 , 𝒙=𝟏
𝟎. 𝟕 , 𝒙=𝟐
𝑷 𝑿=𝒙 =
−𝟎. 𝟑 , 𝒙=𝟑
𝟎. 𝟐 , 𝒙=𝟒

26
EXERCISE 6 PRP1046 MATHEMATICS 2

Figure 1 shows the graph of 𝐹(𝑥) . Identify the cumulative


distribution function, 𝐹(𝑥) of this graph.
F(x)
1.00
0.80
0.60
0.40
Figure 1
0.20
0.00 x
0 1 2
27
8.3 CONTINUOUS RANDOM
VARIABLE PRP1046 MATHEMATICS 2
Learning Outcomes PRP1046 MATHEMATICS 2

❑CONTINUOUS RANDOM VARIABLES


✓ find the probability density function and the cumulative
distribution function for continuous random variable.
✓ find probabilities from probability density function or
cumulative distribution function.
✓ convert the probability density function from a cumulative
distribution function and vice versa.

29
Basic principle PRP1046 MATHEMATICS 2

For continuous random variable 𝑋,

✓ the values of the variable, x, are uncountable.


✓ the probability distribution is described using probability
density function, denoted by 𝒇(𝒙).
✓ the probability always belong to an interval (i.e. definite integral
of 𝒇(𝒙)).

30
Properties PRP1046 MATHEMATICS 2

❖ 𝑓 𝑥 ≥ 0 for all values of 𝑿


❖ The total area under 𝑓(𝑥) is equal to 1
❖ The probability that 𝑋 is between two numbers 𝑎 and 𝑏 is equal to
the area under 𝑓 𝑥 between 𝑎 and 𝑏.

31
EXAMPLE 9 PRP1046 MATHEMATICS 2

The figure shows a probability density function for a continuous


random variable 𝑋.
F(x)
1.00
Find
a) 𝑃 𝑋 < 2.5 0.50
b) 𝑃 𝑋 > 2.25
0.00 x
c) 𝑃 1.25 < 𝑋 < 1.75 0 1 2 3

32
EXAMPLE 10 PRP1046 MATHEMATICS 2

A probability density function of 𝑋 is given below.


1
𝑓 𝑥 = ቐ 14 2𝑥 + 3 , 1≤𝑥≤3
0 , 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒

a) Show that 𝑋 is a continuous random variable.


b) Sketch the probability density function of 𝑋.
c) 𝑃 𝑋 > 2
1
d) Find the value of 𝑘 such that 𝑃 𝑋 < 𝑘 =
3
33
EXERCISE 7 PRP1046 MATHEMATICS 2

𝑋 is a continuous random variable with the probability density


function defined as

𝑎 2+𝑥 , 2≤𝑥≤5
𝑓 𝑥 =ቊ
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
a) Find 𝑎.
b) Sketch the graph of 𝑓 𝑥 .
c) Hence, find the following probabilities.
(i) 𝑃 𝑋 > 3
(ii) 𝑃 4 ≤ 𝑋 ≤ 6
Ans: a) 2/33 c)i) 8/11 c)ii) 13/33 34
EXERCISE 8 PRP1046 MATHEMATICS 2

The probability density function of 𝑋 for a continuous random


variable defined as

4 3
𝑥 , 1≤𝑥≤2
𝑓 𝑥 = ൞15
0 , 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Find the following probability
3
a) 𝑃 𝑋 <
2
b) 𝑃 𝑋 > 1
Ans: a) 13/48 b) 1 35
Cumulative Distribution Function for
Continuous Random Variables PRP1046 MATHEMATICS 2

The cumulative distribution function of a continuous random


variable 𝑋 with probability density function 𝑓(𝑥) for 𝑎 ≤ 𝑥 ≤ 𝑏 is
given by
𝑿
𝑭 𝒙 = 𝑷 𝑿 ≤ 𝒙 = න 𝒇 𝒕 𝒅𝒕
−∞

36
Important Properties PRP1046 MATHEMATICS 2

a) 𝐹 𝑎 = 0 and 𝐹 𝑏 = 1
b) 𝑃 𝑎 < 𝑥 < 𝑏 = 𝐹 𝑏 − 𝐹(𝑎)
𝑑𝐹(𝑥)
c) 𝑓 𝑥 =
𝑑𝑥
d) If m is a median of a continuous random variable, then
𝑚
𝐹 𝑚 = ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 = 0.5

37
EXAMPLE 11 PRP1046 MATHEMATICS 2

A continuous random variable 𝑋 has a probability density function


of
4𝑥 3 , 0≤𝑥≤1
𝑓 𝑥 =ቊ
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

a) Find the cumulative distribution function.


1
b) Find 𝑃 𝑋−1 ≥ .
2

38
EXAMPLE 12 PRP1046 MATHEMATICS 2

The continuous random variable 𝑈 has probability density


function
𝑎 2−𝑢 , 1≤𝑢≤2
𝑓 𝑢 =ቊ
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Where 𝒂 is a constant.
a) Find the value of 𝒂.
b) Find the cumulative distribution function.
3
c) Find 𝑃 ≤𝑈≤2 .
2
39
EXERCISE 9 PRP1046 MATHEMATICS 2

𝑌 is a continuous random variable with probability density


function
𝑚 4−𝑦 , 0≤𝑦≤4
𝑓 𝑦 =ቊ
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

a) Find the value 𝑚, where 𝑚 is a constant.


b) Find the cumulative distribution function.

Ans: a) 1/8 40
EXAMPLE 13 PRP1046 MATHEMATICS 2

The cumulative distributive function 𝐹 𝑥 is given by

0 , 𝑥<0
1
2𝑥 2 , 0≤𝑥<
𝐹 𝑥 = 2
1
1 , 𝑥≥
2

Find the probability density function 𝑓 𝑥 .

41
8.4 EXPECTATION AND VARIANCE
OF RANDOM VARIABLES PRP1046 MATHEMATICS 2

42
Learning Outcomes PRP1046 MATHEMATICS 2

❑EXPECTATION AND VARIANCE OF RANDOM VARIABLES


✓ calculate the expectation and variance for discrete random
variables.
✓ calculate the expectation and variance for continuous random
variables.

43
Basic principle PRP1046 MATHEMATICS 2

❖ Expected value is denoted by 𝐸(𝑋); related to statistical mean.


❖ Variance is given by,
2
𝑉𝑎𝑟 𝑋 = 𝐸 𝑋 − 𝜇 = 𝐸 𝑋2 − 𝐸 𝑋 2
,
where 𝜇 = 𝐸 𝑋 ; related to statistical variance.

44
Properties of Expectation and Variance PRP1046 MATHEMATICS 2

Expectation Variance

𝑬 𝒂 =𝒂 Var 𝒂 = 𝟎

𝑬 𝑿±𝒂 =𝑬 𝑿 ±𝒂 Var 𝑿 ± 𝒂 = 𝑽𝒂𝒓 𝑿

𝑬 𝒂𝑿 = 𝒂𝑬 𝑿 Var 𝒂𝑿 = 𝒂𝟐 𝑽𝒂𝒓 𝑿

45
𝑬 𝑿 ,𝑬 𝒈 𝑿 and 𝑬 𝑿 𝟐
PRP1046 MATHEMATICS 2

• For Discrete Random Variable,


❖ 𝐸 𝑋 = σ𝑥𝑃 𝑋 = 𝑥
❖ 𝐸 𝑔 𝑋 = σ𝑔 𝑥 𝑃 𝑋 = 𝑥
❖ 𝐸 𝑋2 = σ 𝑥2 𝑃 𝑋 = 𝑥

• For Continuous Random Variable,


❖ 𝐸 𝑋 = ‫𝑥𝑑 𝑥 𝑓 𝑥 ׬‬
❖ 𝐸 𝑔 𝑋 = ‫𝑥𝑑 𝑥 𝑓 𝑥 𝑔 ׬‬
❖ 𝐸 𝑋 2 = ‫ 𝑥 ׬‬2 𝑓 𝑥 𝑑𝑥

46
EXAMPLE 14 PRP1046 MATHEMATICS 2

The table below gives the probability distribution of a discrete random


variable 𝑋.

𝑋 1 2 3 4 5
𝑃(𝑋 = 𝑥) 0.2 0.2 0.3 0.2 0.1
Find the
a) expected value
b) variance
c) standard deviation
47
EXAMPLE 15 PRP1046 MATHEMATICS 2

The probability distribution table of a discrete random


variable 𝑌 is shown as below.
𝑌 0 1 2 3 4
𝑃(𝑌 = 𝑦) 0.1 0.2 0.25 0.35 0.1

Find the following values


a) 𝐸 𝑌
b) 𝐸 𝑌 + 3
c) 𝐸 𝑌 − 1
d) 𝑉𝑎𝑟 3𝑌 − 3
48
EXAMPLE 16 PRP1046 MATHEMATICS 2

The probability density function of 𝑋 is given by

𝑎𝑥 2 , 0≤𝑥<1
𝑓 𝑥 =ቊ
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

where 𝒂 is a constant.
a) Find the value of 𝒂
b) Hence, find
(i) 𝐸 𝑋 and 𝑉𝑎𝑟 𝑋
(ii) 𝐸 4𝑋 − 1 and 𝐸 2𝑋 + 4
(iii) 𝑉𝑎𝑟 𝑋 − 1 and 𝑉𝑎𝑟 4𝑋 − 1
49
EXERCISE 10 PRP1046 MATHEMATICS 2

The probability density function of 𝑋 is given by


3 2
𝑓 𝑥 = ቐ16 4 − 𝑥 , 0≤𝑥<2
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Find the
a) expected value
b) the standard deviation of 𝑋.

Ans: a) 3/4 b) 0.4873 50


EXAMPLE 17 PRP1046 MATHEMATICS 2

A bicycle shop’s records show that 𝑋, 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

Suppose the profit per bicycle is RM160 and the weekly fixed cost
of running the shop is RM50.
a) Express the profit function 𝑓(𝑥) in terms of 𝑋.
b) Find 𝐸 𝑓(𝑥) .
51
EXERCISE 11 PRP1046 MATHEMATICS 2

A continuous random variables 𝑋 represent the time in minutes that a taxi


takes to fetch a students to school with the probability density function
𝑓 𝑥 given by

0.04𝑥 − 0.4 , 10 ≤ 𝑥 < 15


𝑓 𝑥 =ቊ
0.8 − 0.04𝑥 , 15 ≤ 𝑥 ≤ 20

In addition to a rate of RM0.50 per minute, the taxi fare includes a basic
charge of RM2.00.
Find the
a) function for the taxi fare
b) calculate the mean taxi fare.

Ans: b) RM9.50 52
PRP1046 MATHEMATICS 2
Session 2022/2023 ⋅ Semester 2

THANK YOU

NUR FAZLIANA RAHIM


AHMAD DEEDAT IBRAHIM

You might also like