Lecture 6.
Chapter 7
Random variables and discrete
probability distributions
7.1 Random variables and
probability distributions
7.2 Discrete probability distributions
7.3 Expected value and variance
1
7.1 Random Variables and
Probability Distributions
A random variable is a function or a rule that assigns a
numerical value to each outcome of an experiment, i.e. it
can take different values depending on which outcome
occurs as the result of the random experiment.
Random variables are denoted by uppercase letters X, Y, Z...
Their lowercase counterparts x, y, z… represent the values of
the random variables
Example: Consider the random experiment of rolling a die.
X - the number observed is a random variable. Why? S =
{O1, O2, O3, O4, O5, O6} = {1, 2, 3, 4, 5, 6}. So X takes
different values 1, 2, 3, 4, 5, 6 depending on which of the six
outcomes occurs. Say, if outcome O3 occurs (the top face of
the die shows 3 spots) then X = 3.
2
.
1
Random Variables and Probability
Distributions (Contd.)
Examples, pages 252 – 253:
1. Flip two balanced coins. Denote X – the total number
of heads observed. X can take values x = 0, 1, 2
depending on which of the following 4 outcomes
occurs: HH, HT, TH, TT.
2. Toss two dice (like in the game of craps). Denote X –
the total of two dice. X can take values x = 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12 depending on which of the
following 36 outcomes occurs: (1, 1), (1, 2), …, (6, 5)
and (6, 6). Outcome (1, 1) means the number
observed on the first die is 1 and the number on the
second die is 1.
3
Random Variables and Probability
Distributions (Contd.)
Examples, pages 252 – 253:
3. Consider the experiment of random selection of two
from a box containing 4 coins: a dollar coin, two 50-
cent coins and a 20-cent coin. If X denotes the total
sum of money observed then possible values of X are
x = $0.70, $1.00, $1.20 and $1.50.
Explanation: S = {DF, DT, FD, FF, FT, TD, TF}, there
are 7 outcomes, where D, F, T mean the dollar coin,
50-cent coin and 20-cent coin have been selected.
Depending on which if these outcomes occurs, the
total sum of money observed may be: $1.50, 1.20,
1.50, 1.00, 0.70, 1.20 and 0.70.
4
2
Random Variables and Probability
Distributions (Contd.)
Examples, page 254:
4. If X denotes the number of customers served at a
hotel reception desk on a particular day, then X can take
any one of the values x = 0, 1, 2, 3, … (countably
infinite).
5. If X is the number of students in a statistics class of
200 students who pass the subject then the possible
values of X are x = 0, 1, 2, 3, …, 200 (finite).
6. Let X be the time taken by a student to complete a
statistics exam, where the time limit is 180 minutes and
students cannot leave before 30 minutes. X can take on
any one of infinitely many possible values 30 x 180.
5
Two Types of Random Variables
There are two types of random variables:
discrete random variable
continuous random variable.
Discrete random variable has a finite or countably
infinite number of possible values
Examples 1, 2, 3, 4, 5 as shown above
(pages 252, 253, 254).
Continuous random variable has an uncountably
infinite number of possible values, that is, it can take on
any value in one or more intervals of values.
Example 6 as shown above (page 254).
3
Probability Distributions
A probability distribution is a table, formula, or
graph that describes the values of a random variable
and the probability associated with these values.
An upper-case letter will represent the name of the
random variable, usually X. Its lower-case counterpart
will represent the value of the random variable. The
probability that the random variable X will equal x is:
P(X = x) or more simply p(x).
There are two types of probability distributions:
discrete probability distribution (this chapter) when X
is discrete random variable, and
continuous probability distribution (chapter 8) when
X is continuous random variable.
7.2 Discrete Probability Distribution
A table, formula or graph that lists all possible
values a discrete random variable can assume,
together with their associated probabilities, is
called a discrete probability distribution.
To calculate P(X = x), the probability that the
random variable X assumes the value x, add the
probabilities of all the simple events for which X is
equal to x.
Example 1.
Find the probability distribution of the random
variable describing the number of heads that turn
up when a coin is flipped twice.
4
Solution
Possible outcomes: {HH, HT, TH, TT}
X = Number of heads = {0, 1, 2}
Simple event x Probability x p(x) x %
TT 0 1/4
HT 1 1/4 0 1/4 0 25%
TH 1 1/4 1 1/2 1 50%
HH 2 1/4 2 1/4 2 25%
1/4 if x = 0 or 2
p(x) =
X 1/2 if x = 1
0 1 2
Interpreting probabilities: In the long run (say, the
experiment of flipping a coin twice is repeated 100
times) about 25%, 50% and 25% of the time X takes
value 0, 1 and 2 correspondingly. 9
Requirements of a
Discrete Probability Distribution
• If a random variable can take values X = xi, then
the following must be true:
1. 0 p(xi ) 1 for all x i
2. p(x ) 1
all xi
i
• The probability distribution can be used to calculate
probabilities of different events.
Example 1 (contd.): Find the probability of the
event: X - the number of heads that turn up is from 1
to 2 when a coin is flipped twice.
1 1 3
P(1 X 2) P( X 1) P( X 2)
2 4 4
10
5
Probabilities as Relative Frequencies
• In practice, probabilities are often estimated from
relative frequencies.
Example 2.
The number of cars a dealer is selling weekly was
recorded over the last 100 weeks. The data are
summarized as follows:
Weekly sales Frequency
0 15 • Estimate the probability
1 15 distribution.
2 35 • State the probability of
3 25 selling more than 2 cars a
4 10 week.
100
11
Solution
From the table of frequencies we can calculate the
relative frequency, which becomes our estimated
probability distribution.
0.35
Weekly sales Relative frequency 0.25
0 15/100 = 0.15 0.15 0.15 0.10
1 15/100 = 0.15
2 35/100 = 0.35
3 25/100 = 0.25 0 1 2 3 4 X
4 10/100 = 0.10
1.00
The probability of selling more than 2 cars a week is
P(X>2) = P(X=3) + P(X=4) = 0.25 + 0.10 = 0.35
12
6
Developing a Probability Distribution
• Probability calculation techniques can be used to
develop probability distributions.
Example 3 (example 7.2, page 257)
A mutual fund salesperson knows that there is a
20% chance of closing a sale on each call she
makes.
What is the probability distribution of the
number of sales if she plans to call three
customers?
13
Solution
Use probability rules and trees.
Define event S = {A sale is made}.
(0.2)(0.2)(0.8) = 0.032
P(S) = 0.2 SSS
P(S) = 0.2 x p(x)
P(S) = 0.8 SSS
P(S) = 0.2 S SS 3 0.23 = 0.008
P(S) = 0.2
P(S) = 0.8 2 3(.032) = 0.096
P(S) = 0.8
S SS 1 3(.128) = 0.384
P(S) = 0.2 SS S
0 0.83 = 0.512
P(S) = 0.8 P(S) = 0.2
P(S) = 0.8 SS S 1.000
P(S) = 0.2 SSS
P(S) = 0.8
P(S) = 0.8 SSS
14
7
7.3 Expected Value and Variance
In chapter 5 we measured the central location and variability
of a population of measurements by calculating mean and
variance: N
i1 f i x i N 2
i 1 f i (x i μ)
μ σ2
N N
where fi is the frequency of measurement xi .
Example 7.3, page 262 (see example 2 in section 7.2)
The total number xi of cars a car dealership sold / per week in
the last 100 weeks is recorded:
xi 0 1 2 3 4 xi 0 1 2 3 4
fi 15 15 35 25 10 ri .15 .15 .35 .25 .10
( fi denotes the frequency, ri denotes the relative frequency of xi namely ri = fi / N)
Determine mean, variance and standard deviation of the
population of the given measurements (of the total numbers).
15
Solution
xi 0 1 2 3 4
ri 0.15 0.15 0.35 0.25 0.10
5
xi ri 0(0.15) 1(0.15) 2(0.35) 3(0.25) 4(0.10) 2.0 cars
i 1
5
2 ( xi 2.4) 2 ri (0 2.0) 2 (.15) (1 2.0) 2 (.15) (2 2.0) 2 (.35)
i 1
(3 2.0) 2 (.25) (4 2.0) 2 (.10) 1.40 (cars)2
1.40 1.18 cars
The mean is 2.0, the variance is 1.40 and the
standard deviation is 1.18.
16
8
Expected Value and Variance
Example 7.3, page 262:
The example is now restated as follows:
A car dealership has lowered the prices on last year’s
models in order to clear its holdover inventory. With
prices slashed, a salesman estimates the following
probability distribution of X, the total number of
cars that he will sell next week:
xi 0 1 2 3 4
p(xi) .15 .15 .35 .25 .10
Where p(xi) denotes the probability / relative frequency
of the event X = xi.
17
Expected Value and Variance (contd.)
A discrete probability distribution
represents a population.
Example 7.3 (contd.):
The discrete probability distribution
xi 0 1 2 3 4
p(xi) .15 .15 .35 .25 .10
represents the population of number of cars sold per
week
Since we have a population, we can describe it by
computing various parameters, namely, the
population mean, population variance and standard
deviation.
18
9
The Population Mean
(or Expected Value)
• Population mean is also known as the expected
value of X, denoted by E(X).
• The expected value of a random variable X is the
weighted average of the possible values it can
assume, where the weights are the corresponding
probabilities of each xi.
• Given a discrete random variable X with values xi,
that occur with probabilities p(xi), the expected
value of X is
E( X )
x i p( x i )
all xi
19
Variance
• The population variance 2 is also known as the
variance of X, denoted by V(X).
• The variance is the weighted average of the
squared deviations of the values of X from their
mean , where the weights are the corresponding
probabilities of each xi.
• Let X be a discrete random variable with possible
values xi that occur with probabilities p(xi), and let
the mean E(xi) = . The variance of X is defined to
be
2 E ( X ) 2
(x ) p(x )
all xi
i
2
i
20
10
Standard Deviation
• The standard deviation of a random variable X,
denoted , is the positive square root of the
variance of X.
Example 7.3 (contd.)
The total number of cars to be sold next week is
described by the following probability distribution.
x 0 1 2 3 4
p(x) 0.15 0.15 0.35 0.25 0.10
Determine the expected value, variance and
standard deviation of X, the number of cars sold.
21
Solution
x 0 1 2 3 4
p(x) 0.15 0.15 0.35 0.25 0.10
5
E ( X ) xi p( xi )
i 1
0(0.15) 1(0.15) 2(0.35) 3(0.25) 4(0.10)
2.0 cars
5
V ( X ) 2 ( xi 2.0) 2 p( xi )
i 1
(0 2.0) 2 (.15) (1 2.0) 2 (.15) (2 2.0) 2 (.35)
(3 2.0) 2 (.25) (4 2.0) 2 (.10) 1.40 (cars)2
1.40 1.18 cars
22
11
Example 7.3 (contd.)
With the probability distribution of cars sold per
week, assume a salesman earns a fixed weekly wage
of $150 plus $200 commission for each car sold.
What is his expected wage, and the variance of the
wage, for the week?
Solution
• The weekly wage Y = 200X + 150
• E(Y) = E(200X + 150) = 200E(X) + 150
= 200(2.0) + 150 = $550
• V(Y) = V(200X + 150) = 2002V(X)
= 2002(1.40) = $2 56000
The standard deviation = (Y) = $236.64
23
Laws of Expected Value and
Variance
Laws of expected value
E(c) = c
E(X + c) = E(X) + c
E(cX) = cE(X)
E(cX + b) = cE(X) + b Laws of variance
V(c) = 0
V(X + c) = V(X)
V(cX) = c2V(X)
V(cX + b) = c2V(X)
24
12
Example 7.4, page 264
The monthly sales at a computer store have a mean of
$25 000 and a standard deviation of $4 000. Profits are
30% of the sales less fixed costs of $6 000. Find the
mean and standard deviation of the monthly profit.
Solution
Profit = 0.30(sales) – 6 000
E(Profit) = E[0.30(sales) – 6 000]
= E[0.30(sales)] – 6 000 E(X + c) = E(X) + c
E(cX) = cE(X) = 0.30E(sales) – 6 000
= (0.30)(25 000) – 6 000 = $1 500
V(Profit) = V(0.30(sales) – 6 000]
= V[(0.30)(sales)] V(X + c) = V(X)
V(cX) = c2V(X) = (0.30)2V(sales) = $2 1 440 000
Profit = [1 440 000]1/2 = $1 200
25
Summary: page 295
Home assignment:
- Section 7.1 & 7.2 Exercises pages 259 - 260: 7.1,
7.3, 7.5, 7.7, 7.12, 7.13
- Section 7.3 Exercises pages 265-266: 7.14, 7.16,
7.20, 7.21
- Additional reading (optional): section 7.4 Bivariate
distributions and section 7.5 Application in finance:
Portfolio diversification and asset allocation.
26
13