Random Variables and Discrete Probability Distributions
Random Variables and Discrete Probability Distributions
2
7.1 Random Variables and Discrete
Probability Distribution
3
A short demonstration:
Discrete and Continuous Random Variables
Discrete random variable Continuous random variable
Only certain values can be Any value within the range where the
assigned to the random variable is defined can be selected
variable
0 1 2 3 ... 0
Therefore, the number of Therefore, the number of
values is countable values is uncountable
4
Discrete Probability Distribution
A table, formula, or graph that lists all possible values a
discrete random variable can assume, together with the
probabilities associated with each value, is called a
discrete probability distribution.
5
Discrete Probability Distribution
Example 1
Find the probability distribution of the random variable
describing the number of heads that turn-up when a coin is
flipped twice.
Solution H HH (½)(½)=1/4
H
T HT (½)(½)=1/4
H TH (½)(½)=1/4
T
T TT (½)(½)=1/4
8
Determining Probability of Events
Example 2 – continued
Calculate the probability of the following events:
P(The number of colored TVs is 3) = P(X=3) =.191
P(The number of colored TVs is two or more) =
P(X2)=P(X=2)+P(X=3)+P(X=4)+P(X=5)=
.319+.374+…= .669
9
Determining the Probability Distribution
and the Probability of Events
Example 3
The number of cars a dealer is selling daily were
recorded in the last 100 days. This data was
summarized as follows:
Daily sales Frequency Estimate the probability
0 5 distribution.
1 15
2 35 State the probability of
3 25 selling more than 2 cars
4 20 a day.
100
10
Determining the Probability Distribution
and the Probability of Events
Example 3 - Solution
From the table of frequencies we can calculate the
relative frequencies, which becomes .35
.25
our estimated probability distribution .20
.15
.05
Daily sales Relative Frequency
0 5/100=.05 0 1 2 3 4 X
1 15/100=.15 The probability of selling
2 35/100=.35 more than 2 cars a day is
3 25/100=.25
4 20/100=.20 P(X>2) = P(X=3) + P(X=4)
1.00 = .25 + .20 = .45 11
Developing a Probability Distribution
Example 4
A mutual fund sales person knows that there is 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?
Solution
Let us use probability rules and probability tree
Define event Ai = {a sale is made in the iit phone call}.
12
Developing a Probability Distribution
Assuming each phone call is independent of all other phone calls,
we can assign the following probabilities to each branch on the tree:
(.2)(.2)(.8)= .032
A1 and A2 and A3
14
The Expected Value (Mean)
Given a discrete random variable X with values xi,
that occurs with probabilities p(xi), the population
mean of X is.
E( X ) x i p( x i )
all x i
15
The Population Variance
LetX be a discrete random variable with possible
values xi that occur with probabilities p(xi), and let
E(xi) = . The variance of X is defined by
V( X) E( X ) ( x i ) p( x i )
2 2 2
all xi
17
The Mean and the Variance
Solution – continued
The variance can also be calculated as follows:
V( X ) 2 E( X 2 ) 2 x i2 p( x i ) 2
all xi
18
7.4 The Binomial Distribution
19
Binomial Random Variable
20
The Binomial Probability Distribution
The binomial probability distribution is described by
the following closed form formula:
P(X x) p( x) p (1 p)
n
x
x n x
n!
where n
x! (n x)!
x
21
Developing the Binomial Probability
Distribution (n = 3)
S2
S1
F2
S2
F1
F2
22
Developing the Binomial Probability
Distribution (n = 3) P(SSS)=p 3
S3
S2
S1 F3 P(SSF)=p2(1-p)
S3 P(SFS)=p(1-p)p
F2
F3 P(FFF)=(1-p)3
23
Developing the Binomial Probability
Distribution (n = 3)
P(X = 3) = P(Three successes) = P(SSS) = p3
P(X = 2) = P(Two successes, one Failure) = P(SSF) + P(SFS) +
P(FSS) = p2(1-p) + p(1-p)p + (1-p)pp =
p2(1-p) + p2(1-p) + p2(1-p) =
3 p2(1-p).
P(X = 1) = P(One success, two failures) = P(SFF) + P(FSF) +
P(FFS) = p(1-p)2 + (1-p)p(1-p) + (1-p)2p =
p(1-p)2 + p(1-p)2 + p(1-p)2 =
3 p(1-p)2
P(X = 0) = P(Three failures) = P(FFF) = (1-p)3
24
Calculating the Binomial Probability
Example 10
Pat Statsdud takes a course in statistics, and intends to rely on
luck to pass the next quiz.
The quiz consists on 10 multiple choice questions with 5
possible choices for each question, only one is the correct
answer.
Pat will guess the answer to each question
Find the following probabilities
• Pat gets no answer correct
• Pat gets two answer correct?
• Pat fails the quiz
25
Calculating the Binomial Probability
Solution
Checking the conditions:
• Only one out of two outcomes can occur
(An answer can be either correct or incorrect).
• There is a fixed finite number of trials
(There are 10 questions in the test, n=10).
• Each answer is independent of the others.
• The probability p of a correct answer does not change
from question to question
(20% chance that an answer is correct).
26
Calculating the Binomial Probability
Solution – Continued
Determining the binomial probabilities:
Let X = the number of correct answers
10!
P(X 0) (.20) 0 (.80)10 .1074
0! (10 0)!
10!
P(X 2) (.20) 2 (.80)10 2 .3020
2! (10 2)!
27
Calculating the Binomial Probability
Solution – Continued
Determining the binomial probabilities:
Pat fails the test if she gets less than 5 correct
answers.
P(X4 = p(0) + p(1) + p(2) + p(3) + p(4)
= .1074 + .2684 + .3020 + .2013 + .0881
=.9672
E(X) = = np
V(X) = 2 = np(1-p)
29
Mean and variance of binomial variable
Example 11
If all the students in Pat’s class practice the same
learning behavior like she does, what is the mean
and the standard deviation of the quiz mark?
Solution
= np = 10(.2) = 2.
= [np(1-p)]1/2 = [10(.2)(.8)]1/2 = 1.26.
30
Binomial Distribution - summary
Example 12
Records show that 30% of the customers in a shoe
store make their payments using a credit card.
This morning 20 customers purchased shoes.
31
Binomial Distribution - summary
Solution
First we verify that this is a binomial experiment:
• There are two possible outcomes of which only one will take
place (paid with the credit card or not)
• There is a finite number of trials (20 customers are
observed)
• Customers pay independently
• Each customer has the same probability to pay with a credit
card (. 30).
32
Binomial Distribution - summary
Solution – continued
Find the probability that at most 11 customers use a
credit card.
n = 20
p
k In what
.01……….. .30 follows
we demonstrate the
0
.
usage of the Binomial Table
. P(X 11) = .995
11 .995
33
Binomial Distribution - summary
To calculate P(X 11) when p = 0.3 and n = 20,
type in an empty cell the following:
=binomdist(11,20,0.3,1). Then click outside the
cell.
In what follows we demonstrate how
to
Touse Excel P(X
calculate to determine
= 11) typebinomial probabilities
the following:
=binomdist(11,20,0.3,0)
To calculate P(X 11) type the following:
= 1 - binomdist(10,20,0.3,1)
34
Binomial Distribution - summary
What is the probability that at least 3 but not more
than 6 customers used a credit card?
At least 3 but
p not more than 6
Not
k .01……….. .30
0
P(3X6)=
2 .035
P(X=3 or 4 or 5 or 6) =
. Click
6 .608 P(X6) - P(X2) .573
=.608 - .035 = .573
0 1 2 3 4 5 6
35
Binomial Distribution - summary
37