0% found this document useful (0 votes)
5 views

Notes Chapter 3

Uploaded by

muzzammil
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)
5 views

Notes Chapter 3

Uploaded by

muzzammil
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/ 15

CHAPTER 3

RANDOM VARIABLE

RV

Discrete Continuous

Probability Probability
distribution density
function function

Cumulative
distribution
function

Expected
value, E(X)
Variance
and SD

Introduction
Random variable: rule to assign a number to each outcome of a sample space
Symbol/ Notation – X, Y, Z
Value of RV – x, y, z
Example 1:
Two balls are drawn without replacement from a box containing 4 red balls and 3 black balls. Y
is the number of red balls and y is the value of random variable Y.

Sample space y
RR 2
RB 1
BR 1
BB 0
So, the possible value for Y are 0, 1 or 2.
Example 2:
A shop owner asked two of his customers whether the new tom yam menu is good. The responses
recorded Y for ‘Yes’ and N for ‘No’. Let X be the ‘number of Yes responses’ recorded. Find the
value of random variable X.
Solution:
S={YY, YN, NY, NN}
𝑃(𝑌𝑌) = 2 𝑃(𝑌𝑁) = 1 𝑃(𝑁𝑌) = 1 𝑃(𝑁𝑁) = 0
So, the possible value for X are 0, 1 or 2.

Exercise:
1. Let an experiment consist of three tosses of a fair coin.
a. List down the sample space.
b. Let X be the random variable that denotes the number of heads occurring in the
three tosses. Find the possible values for X.
2. There are 3 blue marble and 4 green marbles in a box. Two marbles were selected randomly
with replacement before the second marble was taken. Let Z be the random variable that
denoted the number of blue marble selected. Find the possible values for Z.

Discrete Random Variables


 Example: number of cars, number of house, number of defective bulb etc.
 Exact values in the real number axis. 0, 1, 2, 3 and so on.

Probability Distribution Function


𝑛
𝑃(𝑋 = 𝑥) = 𝑃(𝑥)
∑ 𝑃(𝑋𝑖 ) = 1
𝑖=1
0 ≤ 𝑃(𝑋 = 𝑥) ≤ 1
 The probability distribution function is frequently given in tabular representation.

𝑥 0 1 2 3
𝑃(𝑋 = 𝑥) 1 3 3 1
8 8 8 8

Example 3:

A taxi driver randomly guesses at the answer on two true – false questions. Find the probability
distribution.
Solution: 1
C
Let X = number of correct answers 2
1 C
C = correct answer 2 1
2 W
W = wrong answer
1
1 1 1 1
2
𝑃(𝑋 = 0) = 𝑃(𝑊𝑊) = × = 2 W C
2 2 4
1 1 1
𝑃(𝑋 = 1) = 𝑃(𝑊𝐶) + 𝑃(𝐶𝑊) = × = 1
W
4 4 2 2
1 1 1
𝑃(𝑋 = 2) = 𝑃(𝐶𝐶) = × =
2 2 4
So, the probability distribution function is

𝑥 0 1 2
𝑃(𝑋 = 𝑥) 1 1 1
4 2 4

Example 4:
Determine whether the distribution is probability distribution function.

𝑥 0 1 2
𝑃(𝑋 = 𝑥) 2 3 2
7 7 7
Solution:
𝑃(0) + 𝑃(1) + 𝑃(2)
2 3 2
= + +
7 7 7
=1 Therefore, 𝑃(𝑋) is a probability distribution since ∑3𝑖=1 𝑃(𝑋𝑖 ) = 1.

Exercise:

1. Determine the value of 𝑚 if he following function is probability distribution


𝑚, 𝑥=0
𝑃(𝑋 = 𝑥) = {
𝑚𝑥, 𝑥 = 1, 2, 3
Answer: 𝑚 = 1⁄7
2. A machine has 8 transistors. 3 of them are defective. If 2 transistors are selected at random
with replacement, find the probability distribution function.
Answer:
𝑥 0 1 2
𝑃(𝑋 = 𝑥) 25⁄64 30⁄64 9⁄64
3. Determine the value of 𝑐 if the following is probability dirsribution
𝑐𝑥 ,5 ≤ 𝑥 ≤ 7
𝑃(𝑋 = 𝑥) = {2𝑐(𝑥 − 1) , 𝑥 = 8
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Answer: 𝑐 = 1⁄18
32

Calculation of Probability Distribution Function


Example 5:

𝑥 0 1 2 3 4
𝑃(𝑋 = 𝑥) 0.12 0.45 0.2 0.15 0.08
Use the probability distribution function above to calculate

a) 𝑃(𝑋 ≤ 2)
b) 𝑃(𝑋 ≥ 2)
c) 𝑃(𝑋 < 3)
d) 𝑃(𝑋 > 1)
e) 𝑃(1 ≤ 𝑋 ≤ 3)
f) 𝑃(1 < 𝑋 < 4)
g) 𝑃(1 ≤ 𝑋 < 4)
h) 𝑃(0 ≤ 𝑋 ≤ 2)
Solution:
a) 𝑃(𝑋 ≤ 2) = 𝑃(𝑋 = 0) + 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2)
= 0.12 + 0.45 + 0.2
= 0.77
b) 𝑃(𝑋 ≥ 2) = 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3) + 𝑃(𝑋 = 4)
= 0.2 + 0.15 + 0.08
= 0.43
c) 𝑃(𝑋 < 3) = 𝑃(𝑋 ≤ 2) = 0.77
d) 𝑃(𝑋 > 1) = 𝑃(𝑋 ≥ 2) = 0.43
e) 𝑃(1 ≤ 𝑋 ≤ 3) = 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3)
= 0.45 + 0.2 + 0.15
= 0.8
f) 𝑃(1 < 𝑋 < 4) = 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3)
= 0.2 + 0.15
= 0.35
g) 𝑃(1 ≤ 𝑋 < 4) = 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3)
= 0.45 + 0.2 + 0.15
= 0.8
h) 𝑃(0 < 𝑋 ≤ 2) = 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2)
= 0.45 + 0.2
= 0.65
Exercise:
1) Consider the following probability distribution function
𝑥 -1 0 1 2 3 4
𝑃(𝑋 = 𝑥) 0.25 𝑝 0.14 0.23 0.1 0.05
a) Calculate 𝑝
b) Find
i) 𝑃(𝑋 < 1) ii) 𝑃(𝑋 ≤ 3) iii) 𝑃(𝑋 ≥ 0) iv) 𝑃(−1 ≤ 𝑋 < 2)
v) 𝑃(1 < 𝑋 ≤ 4) vi) 𝑃(0 ≤ 𝑋 < 3)
Answer: a) 𝑝 = 0.23 b)i) 0.48 b)ii) 0.95 b) iii) 0.75 b)iv) 0.85
b)v) 0.38 b)vi) 0.6

Cumulative Distribution Function

𝐹 (𝑥 ) = 𝑃(𝑋 ≤ 𝑥 ) = ∑ 𝑃(𝑋 = 𝑥)
−∞

Example 6:
Let the random variable 𝑋 denotes the number of heads in 3 tosses of a fair coin.
a) Find the value of 𝐹(𝑥) for 𝑥 = 0, 1, 2 and 3.
b) Find 𝐹(1.5)
Solution:

𝑥 0 1 2 3
𝑃(𝑋 = 𝑥) 1 3 3 1
8 8 8 8

a) 𝐹(0) = 𝑃(𝑋 ≤ 0) = 𝑃(𝑋 = 0)


= 1⁄8
𝐹(1) = 𝑃(𝑋 ≤ 1) = 𝑃(𝑋 = 0) + 𝑃(𝑋 = 1)
= 1⁄8 + 3⁄8
= 4⁄8
𝐹(2) = 𝑃(𝑋 ≤ 2) = 𝑃(𝑋 = 0) + 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2)
= 1⁄8 + 3⁄8 + 3⁄8
= 7⁄8
𝐹(3) = 𝑃(𝑋 ≤ 3) = 𝑃(𝑋 = 0) + 𝑃(𝑋 = 1) + 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3)
= 1⁄8 + 3⁄8 + 3⁄8 + 1⁄8
= 8⁄8 = 1

𝑥 0 1 2 3 0 ,𝑥 < 0
‫ۓ‬1
𝐹(𝑥) 1⁄ 4⁄ 7⁄ 1 ۖ ⁄8 , 0 ≤ 𝑥 < 1
8 8 8
𝐹(𝑥) = 4⁄8 , 1 ≤ 𝑥 < 2
‫۔‬
7
ۖ ⁄8 , 2 ≤ 𝑥 < 3
‫ە‬1 , 𝑥≥3

b) 𝐹(1.5) = 𝑃(𝑋 ≤ 1.5)


= 𝑃(𝑋 = 0) + 𝑃(𝑋 = 1)
= 1⁄8 + 3⁄8 = 4⁄8

Example 7:
Suppose a random variable 𝑋 has the following cumulative distribution function

𝑥 1 2 3 4 5
𝐹(𝑥) 0.11 0.25 0.64 0.77 1
a) Find 𝑃(𝑋 = 3).
b) Find 𝑃(𝑋 ≥ 4)
c) Find the distribution of 𝑋.

11.4.21
Solution:

a) 𝑃(𝑋 = 3) = 𝐹(3) − 𝐹(2)


= 0.64 − 0.25
= 0.39
b) 𝑃(𝑋 ≥ 4) = 1 − 𝐹(3)
= 1 − 0.64
= 0.36
c)
0.64 – 0.25 = 0.39

𝑥 1 2 3 4 5
𝑃(𝑋 = 𝑥) 0.11 0.14 0.39 0.13 0.23

0.25 - 0.11 = 0.14

Exercise:
1) Suppose a random variable 𝑌 has the following cumulative distribution function:
0 ,𝑦 < 3
‫ ۓ‬0.01 , 3 ≤ 𝑦 < 4
ۖ
0.23 , 4 ≤ 𝑦 < 5
𝐹(𝑦) =
‫ ۔‬0.6 , 5 ≤ 𝑦 < 6
ۖ0.86 , 6 ≤ 𝑦 < 7
‫ە‬1 , 𝑦≥7
a) Find 𝑃(𝑌 = 7)
b) Find 𝑃(𝑌 ≥ 6)
c) Find 𝑃(𝑋 < 4)
d) Find the distribution of 𝑌
Answer: a) 0.14 b) 0.36 c) 0.01
2) For discrete random variable 𝑊, the cumulative distribution functions are as follow:
1 𝑤
𝐹(𝑤) = 1 − (1 − 𝑤) , 𝑤 = 1, 2, 3, 4
4
a) Find 𝐹(3)
b) Find 𝑃(𝑊 = 3)
c) Find 𝑃(2 ≤ 𝑤 ≤ 4)
Answer: a) 63/64 b) 15/64 c) 3 / 4
Expected value (MEAN), VARIANCE and Standard Deviation (SD)

𝐸(𝑋) = ∑ 𝑥 𝑃(𝑋 = 𝑥) Mean


𝑥=0

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

𝑆𝑑(𝑋) = ඥ𝑉𝑎𝑟 (𝑋)


SD

Example 8:
Suppose that the number of handphone sold in a day has the following probability distribution:

𝑥 0 1 2 3 4 5
𝑃(𝑋 = 𝑥) 0.2 0.1 0.3 0.1 0.3 0.2
Based on this probability distribution, find the average of number of handphone sold in a day,
variance and standard deviations.
Solution:
𝑛

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

= 0 (0.2) + 1(0.1) + 2(0.3) + 3(0.1) + 4(0.3) + 5(0.2)


= 3.2
𝐸(𝑋 2 ) = 02 (0.2) + 12 (0.1) + 22 (0.3) + 32 (0.1) + 42 (0.3) + 52 (0.2)
= 12

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


= 12 − (3.2)2
= 1.76

𝑆𝑑(𝑋) = √1.76
= 1.3266
Exercise:
1) Suppose that the probability distribution of 𝑍 is as follow:
𝑧 1 2 3 4 5
𝑃(𝑍 = 𝑧) 0.1 0.2 0.4 0.2 0.1
Find the mean, variance and standard deviation.
Answer: 3, 1.2 and 1.0955

2) Suppose that the probability distribution of 𝑌 is defined as


𝑦 1 2 3 4 5 6
𝑃(𝑌 = 𝑦) 0.13 0.21 0.11 0.18 𝑟 0.17
a) Find the value of 𝑟
b) Find 𝑃(1 ≤ 𝑟 ≤ 3)
c) Find 𝑃(1 < 𝑟 < 6)
d) Find the 𝐸(𝑋), 𝑉𝑎𝑟(𝑋)𝑎𝑛𝑑 𝑆𝑑(𝑋)
e) Find the cumulative distribution function 𝐹(𝑦)
Answer: a) 0.2 b) 0.45 c) 0.7 d) 3.62, 2.8556, 1.6899

Continuous Random Variables


 Example: height, weight, force etc.
 Can have decimal point. 0.4532, 1.2398 and so on.

Probability Density Function


𝑏
𝑃(𝑎 ≤ 𝑥 ≤ 𝑏) = ∫ 𝑓(𝑥) 𝑑𝑥
𝑎

𝑓(𝑥) ≥ 0, ∀𝑥

𝑎
𝑃(𝑋 = 𝑎) = 𝑃(𝑎 ≤ 𝑥 ≤ 𝑎) = ∫ 𝑓(𝑥) 𝑑𝑥
𝑎


∫ 𝑓(𝑥) 𝑑𝑥 = 1
−∞
Example 9:
Show that the following function is a continuous random variable:

3𝑥 2 , 0 ≤ 𝑥 ≤ 1 ;
𝑓(𝑥) = {
0 , otherwise.
Solution:
∞ 0 1 ∞
2
∫ 𝑓(𝑥) 𝑑𝑥 = ∫ 0 𝑑𝑥 + ∫ 3𝑥 𝑑𝑥 + ∫ 0 𝑑𝑥
−∞ −∞ 0 1

= [𝑥 3 ]10
= 1−0=1

Since ∫−∞ 𝑓(𝑥) 𝑑𝑥 = 1, then this function is continuous RV.

Calculation of Probability Density Function


𝑎
𝑃(𝑥 < 𝑎) = 𝑃(𝑥 ≤ 𝑎) = ∫ 𝑓(𝑥) 𝑑𝑥
−∞

𝑃(𝑥 > 𝑎) = 1 − 𝑃(𝑥 ≤ 𝑎)


𝑎
= 1 − ∫ 𝑓(𝑥) 𝑑𝑥
−∞

𝑃(𝑎 < 𝑥 ≤ 𝑏) = 𝑃(𝑎 ≤ 𝑥 ≤ 𝑏) = 𝑃(𝑎 ≤ 𝑥 < 𝑏)


𝑏
= ∫ 𝑓(𝑥) 𝑑𝑥
𝑎

Example 10:
Let 𝑀 have the probability density function:

4𝑚3 , 0 ≤ 𝑚 ≤ 1
𝑓(𝑚) = {
0 , otherwise.
a) Find 𝑃(0.25 ≤ 𝑀 ≤ 0.75)
b) Find 𝑃(𝑀 > 0.5)
Solution:

a) 𝑃(0.25 ≤ 𝑀 ≤ 0.75)
0.75
=∫ 4𝑚3 𝑑𝑚
0.25
= [𝑚4 ]0.75
0.25
= (0.75)4
− (0.25)4
= 0.3125
b) 𝑃(𝑀 > 0.5)
1
= ∫ 4𝑚3 𝑑𝑚
0.5
= [𝑚4 ]10.5
= 14 − (0.5)4 = 15⁄16

Exercise:

The total number of hours, measured in units of 10, that a student spends on reading book over
a period of one week is a continuous random variable 𝑋 with density function,
𝑥2 , 0<𝑥<1
𝑓(𝑥) = { 𝑘 − 𝑥 , 1 ≤ 𝑥 < 2
0 , elsewhere.
a) Find the value of 𝑘.
b) Find:
i) 𝑃(𝑋 < 1.5)
ii) 𝑃(𝑋 > 1.5)
iii) 𝑃(1 ≤ 𝑋 < 1.8)
Answer: a) 𝑘 = 13⁄6 b) i) 0.792 b)ii) 0.208 b)iii) 0.6133

Expected value (MEAN), VARIANCE and Standard Deviation (SD)


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

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

SD 𝑆𝑑(𝑋) = ඥ𝑉𝑎𝑟 (𝑋)


𝐸(𝑎) = 𝑎
𝐸(𝑎𝑋) = 𝑎 𝐸(𝑋) 𝐸(4) = 4
𝐸(𝑎𝑋 + 𝑏) = 𝑎 𝐸(𝑋) + 𝑏 𝐸(5𝑋) = 5 𝐸(𝑋)
𝑉𝑎𝑟 (𝑎) = 0 𝐸(2𝑋 + 3) = 2 𝐸(𝑋) + 3
2
𝑉𝑎𝑟(𝑎𝑋) = 𝑎 𝑉𝑎𝑟(𝑋) 𝑉𝑎𝑟 (5) = 0
𝑉𝑎𝑟(𝑎 + 𝑋) = 𝑉𝑎𝑟(𝑋) 𝑉𝑎𝑟(7𝑋) = 72 𝑉𝑎𝑟(𝑋)
𝑉𝑎𝑟(4 + 𝑋) = 𝑉𝑎𝑟(𝑋)

Example 11:
Given 𝑥 is continuous random variable with probability density function as follow:
𝑥 , 0≤𝑥<1
𝑓(𝑥) = {2 − 𝑥 , 1 ≤ 𝑥 < 2
0 , others.
Find:
a) 𝐸(𝑋)
b) 𝑉𝑎𝑟 (𝑋)
c) 𝐸(2𝑋 + 3)
d) 𝑉𝑎𝑟 (3𝑋 − 1)
Solution:
1 2
a) 𝐸(𝑋) = ∫0 𝑥(𝑥) 𝑑𝑥 + ∫1 𝑥(2 − 𝑥) 𝑑𝑥
1 2
= ∫ 𝑥 𝑑𝑥 + ∫ 2𝑥 − 𝑥 2 𝑑𝑥
2
0 1
3 1 2
𝑥 2
𝑥3
= [ ] + [𝑥 − ]
3 0 3 1
1 4 2
= +( − )=1
3 3 3
1 2 2
b) 𝐸(𝑋 = ∫0 𝑥 (𝑥) 𝑑𝑥 + ∫1 𝑥 2 (2 − 𝑥) 𝑑𝑥
2)

1 2
= ∫ 𝑥 𝑑𝑥 + ∫ 2𝑥 2 − 𝑥 3 𝑑𝑥
3
0 1
1 2
𝑥4 2𝑥 3 𝑥 4
=[ ] +[ − ]
4 0 3 4 1
1 4 5 7
= +( − )=
4 3 12 6

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


7 1
= − 12 =
6 6

c) 𝐸(2𝑋 + 3) = 2𝐸(𝑋) + 𝐸(3)


= 2(1) + 3 = 5
d) 𝑉𝑎𝑟 (3𝑋 − 1) = 32 𝑉𝑎𝑟(𝑋) − 𝑉𝑎𝑟(1)
1
= 9 ( ) − 0 = 1.5
6
Exercise:
Given 𝑧 is continuous random variable with probability density function as follow:
2(1 − 𝑧) , 0 ≤ 𝑧 ≤ 1
𝑓(𝑧) = {
0 , others.
Find:
a) 𝑃 (𝑍 < 0.45)
b) 𝑃 (0.1 < 𝑍 < 0.79)
c) 𝐸(𝑍) and 𝑉𝑎𝑟 (𝑍)
d) Determine 𝐸(4𝑍), 𝐸(5𝑍 + 2) and 𝑉𝑎𝑟 (2𝑍 − 2)
Answer: a) 0.6975 b) 0.7659 c) 1⁄3, 1⁄18 d) 4⁄3, 11⁄3, 4⁄18
Cumulative Density Function


𝐹 (𝑋) = 𝑃(𝑋 ≤ 𝑥 ) = ∫ 𝑓(𝑥 ) 𝑑𝑥
−∞

𝑃(𝑋 ≤ 𝑎) = 𝐹(𝑎)

𝑃(𝑋 > 𝑎) = 1 − 𝐹(𝑎)

𝑃(𝑎 < 𝑋 < 𝑏) = 𝑃(𝑎 ≤ 𝑋 ≤ 𝑏)


= 𝑃(𝑎 ≤ 𝑋 < 𝑏)
= 𝑃(𝑎 < 𝑋 ≤ 𝑏)
= 𝐹(𝑏) − 𝐹(𝑎)

Example 12:
The following is cumulative distribution for continuous random variable 𝑇:
0 , 𝑡<0
1
𝐹(𝑡) = { (𝑡 3 + 2𝑡) , 0 ≤ 𝑡 ≤ 4
72
1 , 𝑡≥4
Find:
1) 𝑃(1 ≤ 𝑇 ≤ 2)
2) 𝑃(𝑇 > 3)
3) 𝑃(2 < 𝑇 < 4)
Solution:
1 1
a) 𝑃(1 ≤ 𝑇 ≤ 2) = 72 (23 + 2(2)) − 72 (13 + 2(1))
1
=
8
b) 𝑃(𝑇 > 3) = 1 − 𝐹(3)
1 3
= 1− (3 + 2(3))
72
13
=
24
c) 𝑃(2 < 𝑇 < 4) = 𝐹(4) − 𝐹(2)
1 3 1
= (4 + 2(4)) − (23 + 2(2))
72 72
5
=
6
Exercise:
1) Using the same problem as in Example 12, find 𝑃(𝑇 > 1.5).
Answer: 0.9115

You might also like