0% found this document useful (0 votes)
77 views37 pages

Random Variables and Discrete Probability Distributions

This document discusses random variables and discrete probability distributions. It defines discrete and continuous random variables, and explains that a discrete probability distribution lists all possible values of a discrete random variable along with their probabilities. It provides examples of developing probability distributions and calculating probabilities of events. It also introduces concepts like expected value, variance, and the binomial distribution.

Uploaded by

wadihaahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views37 pages

Random Variables and Discrete Probability Distributions

This document discusses random variables and discrete probability distributions. It defines discrete and continuous random variables, and explains that a discrete probability distribution lists all possible values of a discrete random variable along with their probabilities. It provides examples of developing probability distributions and calculating probabilities of events. It also introduces concepts like expected value, variance, and the binomial distribution.

Uploaded by

wadihaahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 37

Chapter 7

Random Variables and


Discrete probability
Distributions
1
7.1 Random Variables and Discrete
Probability Distribution
 Many times simple events in the sample space can be assigned
numerical values. A random variable can then be defined that takes
on these values.
 The random variable reflects a certain characteristic of interest of
the experimental outcome.
 Examples:
 The number of cars entering a gas station in the next five minutes.
 The amount of gas filled in a gas tank by a driver.
 The grade in a physics test.
 The number of new employees to be hired next month.

2
7.1 Random Variables and Discrete
Probability Distribution

 There are two types of random variables:


 Discrete random variable
 Continuous random variable.

 A random variable is discrete if it can assume only a


countable number of values.
 A random variable is continuous if it can assume an
uncountable number of values.

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.

 To calculate the probability that the random variable X


assumes the value x, P(X = a),
 add the probabilities of all the simple events for which X is
equal to ‘a’, or
 Use probability calculation tools (such as tree diagram),

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

Simple event x Probability x p(x)


TT 0 1/4
HT 1 1/4 0 1/4
TH 1 1/4 1 1/2
HH 2 1/4 2 1/4 6
Requirements for a Discrete Distribution

 If a random variable can assume values xi, then


the following must be true:

1. 0  f(x i )  1 for all x i


2.  f ( x i )  1
all x i

 With the probability distribution we can more


conveniently calculate probabilities (see example 2)
next. 7
Distribution and Relative Frequencies
 Example 2
 A survey reveals the following frequencies for the
number of colored TV per household.
Number of TVs Number of Households x p(x)
0 1,218 0 1218/Total = .012
1 32,379 1 32379/Total = .319
2 37,961 2 .374
3 19,387 3 .191
4 7,714 4 .076
5 2,842 5 .028
Total 101,501 1.000

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(X2)=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

A1 and A2 and A3C X P(x)


3 = .008
3 If X.2represents
A1 and A2C and A3 the
A1c and A2 and A3 2 number
3(.032)=.096
of sales
1 made,
3(.128)=.384
then.. (click)
A1 and A1C and A3C 0 .83 = .512
A1C and A2 and A3C
A1C and A2C and A3
(.2)(.8)(.8)= .128
A1 and A2 and
C C AC
13
Expected value and Variance

Describing the Population


Probability Distribution

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

The s tan dard deviation is


  2
16
The Mean and the Variance
 Example 5
Find the mean the variance and the standard deviation for
the population of the number of colored TV per household
in example 2
 Solution
 E(X) =  = Sxip(xi) = 0p(0)+1p(1)+2p(2)+…=
0(.012)+1(.319)+2(.374)+… = 2.084
 V(X) = 2 = S(xi - )2p(xi) = (0-2.084)2p(0)+(1-2.084)2p(1) +
(2-2.084)2+… =1.107 Using a shortcut formula
  = 1.1071/2 = 1.052 for the variance

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

0 p(0)  1 p(1)  2 p(2)  ... 2.084


2 2 2 2
 1.107

18
7.4 The Binomial Distribution

 Thebinomial experiment has the following


characteristics:
 There are n trials (n is finite and fixed).
 Each trial can result in one out of two outcomes,
success or a failure.
 The probability p of a success is the same for all the
trials.
 All the trials of the experiment are independent.

19
Binomial Random Variable

 The binomial random variable counts the


number of successes in n trials of the binomial
experiment.
 The possible values of this count are 0,1, 2, …,n,
and therefore the binomial variable is discrete.

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 Since the outcome of each


F3 P(SFF)=p(1-p)
trial is independent of the 2
previous outcomes, we can
S2 replace theSconditional
3 P(FSS)=(1-p)p2

probabilities with the


unconditionalF probabilities.
P(FSF)=(1-p)P(1-p)
3
S3 P(FFS)=(1-p)2p
F1

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(X4 = p(0) + p(1) + p(2) + p(3) + p(4)
= .1074 + .2684 + .3020 + .2013 + .0881
=.9672

This is called cumulative probability


28
Mean and Variance - Binomial Variable

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.

 Use the binomial table to answer some questions


stated in the next few slides.

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(3X6)=
2 .035
P(X=3 or 4 or 5 or 6) =
. Click
6 .608 P(X6) - P(X2) .573
=.608 - .035 = .573
0 1 2 3 4 5 6

35
Binomial Distribution - summary

 Find the probability that exactly 14 customers did not


use a credit card.
Let Y be the number of customers who did not use a
credit card, while X (as before) the number of those
who did use a credit card.
P(Y=14) = P(X=6) = P(X  6) - P(X  5) = .608 - .416 = .192
 Using Excel to solve the last two questions:
• P(3  X  6) = binomdist(6,20,0.3,1) – binomdist(2,20,0.3,1)
• P(Y = 14) = binomdist(14,20,0.7,0)
36
Binomial Distribution - summary

 What is the expected number of customers who


used a credit card?
E(X) = np = 20(.30) = 6

37

You might also like