0% found this document useful (0 votes)
19 views36 pages

Random Variable

Uploaded by

focusmode247
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)
19 views36 pages

Random Variable

Uploaded by

focusmode247
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/ 36

Chapter 4: Introduction to Random Variables

ASP611S
Mr. J. J. Swartz
Learning outcome
At the end of this unit, student should be able to:
• Recognize and understand discrete and continuous random variable.
• Calculate and interpret the expected value, variance, standard
deviation and coefficient of variation of the random variable.
• Find the mean and variance of a function of a random variable
• Apply the law of expectation and law of variance to find the expected
value and variance of a function of a random variable.
4.1 Definition
• Let be a sample of an event. Let us assign numbers to elementary events in the sample space. Let
stands for numerical values of the elementary events.
• is said to be a random variable because it can take on different values and the particular value it
takes on depends on the outcome of the random experiment.
• So we can now define a random variable as a numerical variable whose value is determined by the
outcome of a random experiment.
Class examples:
1. Consider the random experiment of tossing an unbiased coin three times. If the random variable
of interest is the number of heads that occur.
a) List all possible values that can take on.
b) Find the following probabilities
i)
ii)
iii)
Class example(solution)
a)
, , , , ,
, ,
Therefore
2. Consider the random experiment of rolling a die. If the random variable of interest is
the label of the face turned up.
a) List all possible values that can take on.
𝑋 = {1,2,3,4,5,6}
b) Find the following probabilities: i) , ii) iii) i) ,
iv)
i) 𝑃 𝑋 = 0 = 0
ii) 𝑃 𝑋 = 1 =
iii) 𝑃 𝑋 = 3 =
iv) 𝑃 𝑋 = 𝑒𝑣𝑒𝑛 = = 0.5
4.2 Classification of random variables

Types of Variables

Qualitative
Quantitative

E.g.
Discrete Continuous
• Brand of PC
• Marital status
• Hair colour
• Children in a family • Weight of a student
• Strikes in a golf hole • Yearly rainfall
• TV sets owned • Temperature
• No of patients • Monthly income
visiting a clinic per
day
• From the chart at previous slide, it can be noted that random variables are divided into two
categories namely Qualitative and Quantitative random variables.
• The quantitative random variables are also subdivided into two groups: Discrete and
Continuous random variables.

4.2.1 Discrete random variables (d.r.v)


A discrete random variables takes on isolates values along the real line, usually integer.
Examples:
• Number of customers entering a store between 12:00 and 14:00
• Number of students who drop out every year
• Number of clients visited by salesperson
4.2.2 Continuous random variables
Continuous random variables are random variables that can be measured to any degree of
accuracy. This means that between every two possible values and there exists another
possible value
Examples:
• Distance travelled by a car on one litre of petrol
• Time that a customer waits in the queue at fast food outlet
• Direction of a wind at mid day measured in degrees
4.3 Probability distributions

Probability mass function (p.m.f) and probability density function (p.d.f)


• We can use probability mass function to describe mathematically discrete random variables whereas
continuous random variables are modelled using probability density functions.

4.3.1 Probability mass function


A function 𝑝(𝑥) is called a probability mass function if it satisfies the following conditions:
• 𝑝(𝑥) is defined for all values of 𝑥, but 𝑝(𝑥) ≠ 0 only at finite or countable infinite set of points.
• All values of 𝑝(𝑥) lie in the unit [0,1] i.e. 0 ≤ 𝑝 𝑥 ≤ 1
• ∑ 𝑝 𝑥 = 1, where the sum is taken over all values of 𝑥 for 𝑝 𝑥 ≠ 0
Examples:
1. Unbiased die is rolled and the random variable 𝑋 consists of the number of dots appearing on the upturned
face. Find the probability mass function for this random variable.
2. A car salesperson is scheduled to see two clients today. She sells only two models of car, an executive (E) and a
basic (B) model. Each executive model sold earns the salesperson a commission of N$ 2000, while each basic
model sold earns her only N$ 1000. If the sale is lost (L), no commission is earned. Suppose 𝑃 𝐸 =
0.2, 𝑃 𝐵 = 0.3 and 𝑃 𝐿 = 0.5 and that the sales are independent of each other. Let the random variable 𝑋
be the total commission earned by the salesperson today.
a) What values can 𝑋 take on?
b) Find the probability of each value.
Solutions
,6

2.) TRY THIS


Take Note:
For discrete random variable 𝑋,

𝑃 𝑎≤𝑥≤𝑏 = 𝑝(𝑥)

i.e. sum up relevant values of probability mass function.

Example:
Check that the probability function
𝑥
𝑝 𝑥 = , 𝑥 = 1,2,3,4,5
15
=0 otherwise
Satisfies the condition for being the probability mass function.
Find the following probabilities
i. 𝑃 2 ≤ 𝑋 ≤ 4
= + + =

i. 𝑃 𝑋≥3 = + + =
4.3.2 Probability density function
A function 𝑓 𝑥 is called a probability density function if it satisfies the following conditions:
• 𝑓(𝑥) is defined for all 𝑥 values
• 0≤𝑓 𝑥 <∞
• ∫ 𝑓 𝑥 =1

HOME WORK
1. 𝑓 𝑥 = 4 0 ≤ 𝑥 ≤ 0.25
=0 otherwise
is a probability density function?
2. In a certain risk sector of share market, the proportion of companies that survive (i.e. not
deleted) a year is continuous random variable lying in the interval from zero to one. A
Statistician examine the data collected over past years and suggest that the function
𝑓 𝑥 = 20𝑥 1 − 𝑥 0≤𝑥≤1
=0 otherwise
might be useful in modelling 𝑋, the annual proportion of companies that survives.
a. Show that the area under the curve 𝑓(𝑥) is one.
b. What is the probability that between 30% and 50% of the companies survive a year?
c. What is the probability that less than 10% of companies survive a year?
Solution to H/W
1. is called a probability density function if it satisfies

2. a)
Solution to H/W cont…
b)

The probability that between 30% and 50% of the companies survive a
year is
4.4 Mean, Variance and Coefficient of variation of random variables

4.4.1 Mean
(i) Let 𝑋 be a discrete variable with probability mass function 𝑝 𝑥 = 𝑃(𝑋 = 𝑥). The mean of 𝑋,
sometimes called expectation or expected value, is given by
𝐸 𝑋 = 𝑥. 𝑝(𝑥)

=𝜇
=𝜇
where the sum is over all possible values of 𝑋.

Example:
The discrete random variable has a probability mass function given by
1
𝑝 𝑥 = 𝑥 = 1,2,3,4,5,6
6
=0 otherwise
Find the expected value of 𝑋.
Solution

(ii) Let 𝑋 be a continuous random variable with probability density function 𝑓(𝑥). The mean of 𝑋,
sometimes called expectation or expected value, is given by

𝐸 𝑋 = 𝑥 𝑓 𝑥 𝑑𝑥
=𝜇
=𝜇

Example:
Suppose the random variable 𝑋 has a probability density function
𝑓 𝑥 = 6𝑥 1 − 𝑥 0≤𝑥≤1
=0 otherwise
Find the mean value of 𝑋.
solution
4.4.2 Variance
(i) Let 𝑋 be a discrete variable with probability mass function 𝑝 𝑥 = 𝑃(𝑋 = 𝑥). The Variance of 𝑋, is given
by
𝑉 𝑋 = 𝑥 𝑝 𝑥 −𝜇

= 𝜎
=𝜎
or
𝑉 𝑋 = 𝑥−𝜇 𝑝(𝑥)

= 𝜎
=𝜎
Example:
Find the variance of 𝑋 whose probability mass function is given
1
𝑝 𝑥 = 𝑥 = 1,2,3,4,5,6
6
=0 otherwise
(ii) Let be a continuous random variable with probability density
function . The Variance of is given by

Or

NB: The standard deviation is the square root of the variance

Example:
Suppose the random variable has a probability density function

Find the variance and standard deviation of .


Solution
Solution continue…
Standard deviation ( )
4.4.3 Coefficient of variation (CV)

Sometimes, it is necessary to compare the sample of data from different random variables to establish which
sample data shows greater variability. A direct comparison of their respective standard deviations would be
misleading as the random variables may be measured in different units. Thus, a meaningful comparison should be
based on measure variability expressed in the same units. This achieved by producing a measure of relative
variability (i.e. relative to their mean) expressed in percentages terms, called coefficient of variation.

𝐶𝑉 = × 100%, This ratio describes how large the measure of dispersion is relative to the mean of
( )
observations.
A coefficient of variation close to zero indicates low variability and tight clustering of observations about mean. A
large coefficient of variation indicates that observation are spread out about their mean.

Examples:
1. Find the coefficient of variation of a random variable 𝑋 whose probability mass function is given by
1
𝑝 𝑥 = 𝑥 = 1,2,3,4,5,6
6
=0 otherwise
𝐸 𝑋 = ∑ 𝑥. 𝑝(𝑥)
𝐸 𝑋 =1 +2 +3 +4 +5 +6
=
Solution to the example
1. 𝑉 𝑋 = (1 − ) + (2 − ) + (3 − ) + (4 − ) + (5 − ) + (6 − )
=
Or
𝑉 𝑋 =∑ 𝑥 𝑝 𝑥 −𝜇

𝑉 𝑋 = − =

𝐶𝑉 = ( )
× 100%,
.
X100%

𝐶𝑉 = 48.80%
Examples
1. Suppose the random variable 𝑋 has a probability density function
𝑓 𝑥 = 6𝑥 1 − 𝑥 0≤𝑥≤1
=0 otherwise
Find the coefficient of variation of 𝑋.
Example cont…
( )
.
.
4.5 Properties of expectations
Theorem 1:
• 𝐸 𝑎 = 𝑎, where 𝑎 is a constant E(4)=4
• If 𝑌 = 𝑎𝑋 + 𝑏, then 𝐸 𝑌 = 𝐸 𝑎𝑋 + 𝑏 = 𝑎𝐸 𝑋 + 𝑏
Where 𝑎 and 𝑏 are constants

Theorem 2:
If 𝑋 , 𝑋 , … , 𝑋 are random variables such that the expectation of 𝐸(𝑋 ) exists for 𝑖 = 1,2, … 𝑛,
then

𝐸 𝑋 + 𝑋 + ⋯+ 𝑋 =𝐸 𝑋 +𝐸 𝑋 + ⋯+ 𝐸 𝑋 = 𝐸(𝑋 )

Theorem 3
It follows from theorem 1 and 2 that for any constants 𝑎 , 𝑎 , … , 𝑎 , then

𝐸 𝑎 𝑋 + 𝑎 𝑋 + ⋯+ 𝑎 𝑋 = 𝑎 𝐸(𝑋 )
Theorem 4 (Expectation of a product)
If 𝑋 , 𝑋 , … , 𝑋 are independent random variables such that the expectations of 𝐸(𝑋 ) exists for 𝑖 =
1,2, … 𝑛,
then

E 𝑋 = 𝐸 𝑋 × 𝑋 × ⋯× 𝑋

=𝐸 𝑋 ×𝐸 𝑋 × ⋯× 𝐸 𝑋

= 𝐸(𝑋 )

Theorem 5: Expectation of non negative distribution

Let 𝑋 be a discrete random variables that takes values 0,1,2, … , then


𝐸 𝑋 = 𝑛𝑝 𝑋 = 𝑛 = 𝑛𝑝(𝑋 = 𝑛)
4.6 Properties of Variance

Definition
Let 𝑋 be a random variable with expected value 𝐸 𝑋 = 𝜇. The variance of 𝑋, denoted by 𝑉𝑎𝑟 𝑋 ,
is given by 𝑉𝑎𝑟 𝑋 = 𝐸[(𝑋 − 𝜇) ]

Theorem 1:
• 𝑉 𝑎𝑋 + 𝑏 = 𝑎 𝑉𝑎𝑟 𝑋 , where 𝑎 and 𝑏 are constants
• 𝑉𝑎𝑟 𝑎 = 0, 𝑎 is any constant

Theorem 2
For any random variables 𝑋, the variance of 𝑋 is 𝑉𝑎𝑟 𝑋 = 𝐸 𝑋 − [𝐸(𝑋)]

Theorem 3

If 𝑋 , 𝑋 , … , 𝑋 are independent random variables, then


𝑉𝑎𝑟 𝑋 + 𝑋 + ⋯ + 𝑋 = 𝑉𝑎𝑟 𝑋 + 𝑉𝑎𝑟 𝑋 + ⋯ + 𝑉𝑎𝑟 𝑋
Class Examples

1. Let 𝑋 be a random variable with the following probability distributions:


𝒙 -3 6 9
𝒑(𝒙) 1 1 1
6 2 3
Find 𝐸 𝑋 and 𝐸(𝑋 ) and then use these values to evaluate 𝐸[(2𝑋 + 1) ]

2. If 𝑋 and 𝑌 are independent random variables with variances 𝜎 = 5 and 𝜎 = 3, find the variance of
the random variable 𝑍 = −2𝑋 + 4𝑌 − 3

3. The discrete random variable 𝑋 has the probability distribution function

a. Show that 𝑘 =
b. Find 𝐸(𝑋) and 𝐸(𝑋 )
c. Find 𝐸 3𝑋 + 5 , 𝐸(2𝑋 − 3) and V𝑎𝑟(5𝑋 + 6)
Solutions
1.
From the table
+

+
You can expand algebraically and find , since you know
the values of .
Solution cont…
Solution 2
2. The variance of a random variable can be
obtained as:`

Var
Solutions
3.
a) For any discrete random variable x

X -1 0 1 2
P(X) 2 1 0 1
3 6 6
Solution cont…
b)
Solution cont…
c)
Solution cont…

We know that:

Therefore,

You might also like