Transcript Chapter 5

Lecture Slides
Elementary Statistics
Eleventh Edition
and the Triola Statistics Series
by Mario F. Triola
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 1
Chapter 5
Probability Distributions
5-1 Review and Preview
5-2 Random Variables
5-3 Binomial Probability Distributions
5-4 Mean, Variance and Standard Deviation
for the Binomial Distribution
5-5 Poisson Probability Distributions
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 2
Section 5-1
Review and Preview
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 3
Review and Preview
This chapter combines the methods of descriptive statistics presented
in Chapter 2 and 3 and those of probability presented in Chapter 4 to
describe and analyze
probability distributions.
Probability Distributions describe what will probably happen instead of
what actually did happen, and they are often given in the format of a
graph, table, or formula.
In order to fully understand probability distributions, we must first
understand the concept of a random variable, and be able to
distinguish between discrete and continuous random variables.
In this chapter we focus on discrete probability distributions.
In particular, we discuss binomial and Poisson probability
distributions.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 4
Combining Descriptive Methods
and Probabilities
In this chapter we will construct probability distributions
by presenting possible outcomes along with the relative
frequencies we expect.
xbar = (1*8 + 2*10 + 3*9 + 4*12 +5*11 + 6*10 ) / ( 8+10 + 9 + 12 + 11 + 10)
probability distribution
(die rolled infinitely many times)
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 5
Section 5-2
Random Variables
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 6

Random variable
a variable (typically represented by x) that has a single numerical value,
determined by chance, for each outcome of a procedure

Probability distribution
a description that gives the probability for each value of the random
variable; often expressed in the format of a graph, table, or formula
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 7
Example 1
Assume we have random variable x denoting a number of pets in a household.
x = 0
1
2
p = 0.6 0.3
0.1
Example 2
Assume a student has partially prepared for exam and probability
of him correctly answering each question is, say, ¾ =0.75.
Let x = # of correct answers he gets out of 5 question quiz === Just like peas problem
x depends on chance => random variable
x =
0
p = 0.00098
1
0.0146
2
0.0879
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
3
0.2637
4
0.3955
5
0.2373
5.1 - 8
Discrete and Continuous
Random Variables

Discrete random variable
either a finite number of values (1,2,3…n) or countable
number of values (1,2,3….infinity) -- whole numbers
Ex: number of defective cell phones, number of students
present in a class, number of phone calls per hour,
number of molecules in a jar…

Continuous random variable
infinitely many values, and those values can
be associated with measurements on a
continuous scale without gaps or interruptions
Ex: height, weight, temperature, electric current,
voltage…
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 9
Graphs
The probability histogram is very similar
to a relative frequency histogram, but the
vertical scale shows probabilities.
Each rectangle is 1-unit wide
=> Areas of rectangles are the
same as probabilities
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 10
Requirements for
Probability Distribution
 P(x) = 1
where x assumes all possible values.
-- sum of all probabilities is 1 – one of the events must occur
0  P(x)  1
for every individual value of x.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 11
Example 1
Assume we have random variable x denoting a number of pets in a household.
x = 0
1
2
p = 0.6 0.3
0.1
Each probability is between 0 and 1 and they sum to 1 => this is a probability distribution
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 12
Mean, Variance and Standard Deviation of a
Probability Distribution
-- same characteristics as for data, but now applied to
probability distribution.
µ =  [x • P(x)]
Mean
 =  [(x – µ) • P(x)]
Variance
 =  [x • P(x)] – µ
Variance (shortcut)
2
2
2
2
2
 =  [x 2 • P(x)] – µ 2
Standard Deviation –
just square root of variance
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 13
Example 1 – back to the number of pets in a household
   x  P( x)  x1  P1  x2  P2  ...  0  0.6  1  0.3  2  0.1  0.5
x = 0
p = 0.6
1
0.3
2
0.1
 2   ( x   ) 2  P( x)  ( x1   ) 2  P1  ( x2   ) 2  P2  .... 
(0  0.4) 2  0.6  (1  0.4) 2  0.3  (2  0.4) 2  0.1  0.45
  0.6708204
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 14
Excel
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 15
Expected Value
The mean of a discrete random variable is the
theoretical mean outcome of infinitely many trials =
expected value if trials continued indefinitely.
As we said, it is obtained by finding the value of :
E =  [x • P(x)]
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 16
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 17
Identifying Unusual Results
Range Rule of Thumb
According to the range rule of thumb, most values
should lie within 2 standard deviations of the mean.
We can therefore identify “unusual” values by
determining if they lie outside these limits:
Maximum usual value = μ + 2σ
Minimum usual value = μ – 2σ
Example:
Say, heights of men have mean 5.10 with 3 inch
standard deviation.
Then anybody below 5.4 and above 6.4 is unusual.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 18
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 19
Identifying Unusual Results Probabilities
Rare Event Rule for Inferential Statistics
If, under a given assumption (such as the assumption that a coin is
fair), the probability of a particular observed event (such as 992 heads
in 1000 tosses of a coin) is extremely small, then it is rare.
We conclude that the assumption of fair coin is probably not correct.
Using Probabilities to Determine When Results Are Unusual
 Unusually high: x successes among n trials is an unusually
high number of successes if P(x or more) ≤ 0.05.
 Unusually low: x successes among n trials is an unusually low
number of successes if P(x or fewer) ≤ 0.05.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 20
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 21
Benford's law, also called the first-digit law, states that
in lists of numbers from many (but not all) real-life sources
of data, the leading digit is distributed in a specific, nonuniform way.
According to this law, the first digit is 1 about 30% of the
time, and larger digits occur as the leading digit with lower
and lower frequency, to the point where 9 as a first digit
occurs less than 5% of the time.
This distribution of first digits is the same as the widths of
gridlines on the logarithmic scale.
This counter-intuitive result has been found to apply to a
wide variety of data sets, including electricity bills, street
addresses, stock prices, population numbers, death rates,
lengths of rivers, physical and mathematical constants,
and processes described by power laws (which are very
common in nature).
It tends to be most accurate when values are distributed
across multiple orders of magnitude (logarithms are
uniformly distributed).
-- was successfully used to detect financial fraud,
because when humans make up numbers they tend to
distribute them uniformly.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
The distribution of first digits,
according to Benford's law.
Each bar represents a digit, and the
height of the bar is the percentage
of numbers that start with that digit.
1
2
3
4
5
6
7
8
9
30.1%
17.6%
12.5%
9.7%
7.9%
6.7%
5.8%
5.1%
4.6%
5.1 - 22
Section 5-3
Binomial Probability
Distributions
Motivating example:
Flip a fair coin three times and count the number of heads.
Let x be this number of heads.
The distribution of x is a binomial distribution with n = 3 and p = 1/2.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 23
Binomial Probability Distribution
A binomial probability distribution results from a
procedure that meets all the following
requirements:
1. The procedure has a fixed number of trials.
2. The trials must be independent. (The outcome
of any individual trial doesn’t affect the
probabilities in the other trials.)
3. Each trial must have all outcomes classified
into two categories (commonly referred to as
success and failure).
4. The probability of a success remains the same
in all trials.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 24
Notation (continued)
n
denotes the fixed number of trials.
x
denotes a specific number of successes in n
trials, so x can be any whole number between
0 and n, inclusive.
p
denotes the probability of success in one of
the n trials.
q
denotes the probability of failure in one of the
n trials (q = 1- p).
P(x)
denotes the probability of getting exactly x
successes among the n trials.
Flip a coin three times and count the number of heads.
The distribution of this random variable is a binomial
distribution with n = 3 and p = 1/2, q = 1-p = 1/2.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 25
Important Hints
 Be sure that x and p both refer to the
same category being called a success.
 When sampling without replacement,
consider events to be independent if
n < 0.05N.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 26
Examples:
1)
Roll a standard die ten times and count the number of 4’s.
The distribution of this random number is a binomial distribution with
n = 10 and p = 1/6.
2)
Mendel’s pees experiment.
Probability of green offspring is 0.75 (yellow 0.25).
There are n = 4 (n - fixed) independent trials.
Each trial -> Success (p = 0.75 - fixed), Failure (q = 1 – p = 0.25)
=> Binom(n=4,p=0.75)
Question: What is the probability of getting exactly 2 green offspring pods?
x=2
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 27
Method 1: Using the Binomial
Probability Formula
P(x) =
n!
•
(n – x )!x!
= nCx
Number of outcomes with
exactly x successes
among n trials.
Number of arrangements
of n items with x items
identical & (n-x) items
identical (combinations)
where
n = number of trials
x = number of successes among n trials
p = probability of success in any one trial
q = probability of failure in any one trial (q = 1 – p)
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
px
•
qn-x
The probability of x
successes among n
trials for any one
particular order.
-- uses multiplication
rule and independence
There are n independent trials.
Each trial – S(prob = p) or F(q=1-p).
Prob(x successes) =
Prob(x successes and n-x failures)
Indep => multiplication rule gives px
Any order => there are nCx of them
•
qn-x
5.1 - 28
TI calculator:
2nd VARS -> DISTR (distributions) ->
binomialpdf(n,p,x)
-gives probability of getting n successes among n
trials
binomialcdf(n,p,x) gives cumulative probabilities
-- sum of all probabilities from x=0 to specified x
binomialpdf(5,0.75,3)
binomialcdf(5,0.75,3)
STATDISK
Analysis -> Probability Distribution -> Binomial Distribution
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 29
Excel
note absolute reference for B$1 and D$1, or just type in numbers
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 30
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 31
Extra examples, may skip
TI calculator:
2nd VARS -> DISTR (distributions) -> binomialpdf(n,p,x)
-gives probability of getting n successes among n trials
> # Binomial distribution
binomialcdf(n,p,x) gives cumulative probabilities
> # Genetics example
-- sum of all probabilities from x=0 to specified x
>n=4
>x=2
> p = 0.75
binomialpdf(4,0.75,2)
binomialcdf(4,0.75,2)
> choose(n,x)*p^x*(1-p)^(n-x)
[1] 0.2109375
binomialpdf(10,1/6,3)
binomialcdf(10,1/6,2)
> # or using built in functions
> dbinom(x, size=n, prob=p)
# d stands for distribution
[1] 0.2109375
>
> # Probability of getting 2 or fewer = P(0 or 1 or 2) = no intersection =
> # = P(0) + P(1) + P(2)
> choose(n,0)*p^0*(1-p)^(n-0) + choose(n,1)*p^1*(1-p)^(n-1) + choose(n,2)*p^2*(1-p)^(n-2)
[1] 0.2617188
> # alternatively using cumulative probability distribution (later)
> pbinom(x, size=n, prob=p)
STATDISK
[1] 0.2617188
Analysis -> Probability Distribution -> Binomial Distribution
>
Once you set up n and p it gives all the values of x, P(x) as
> # Roll a standard die ten times and count the number of fours.
well as all cumulative probabilities.
> # The distribution of this random number is a binomial distribution with
> # n = 10 and p = 1/6. Find prob of getting exactly 3 fours
> n = 10
>x=3
> p = 1/6
> choose(n,x)*p^x*(1-p)^(n-x)
[1] 0.1550454
> # or using built in functions
> dbinom(x, size=n, prob=p)
[1] 0.1550454
>
# Probability of getting 2 or less
> choose(n,0)*p^0*(1-p)^(n-0) + choose(n,1)*p^1*(1-p)^(n-1) + choose(n,2)*p^2*(1-p)^(n-2)
[1] 0.7752268
> # alternatively:
> pbinom(2, size=n, prob=p)
[1] 0.7752268
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 32
Section 5-4
Mean, Variance, and Standard
Deviation for the Binomial
Distribution
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 33
For Any Discrete Probability
Distribution: Formulas
Mean
µ = [x • P(x)]
Variance
 = [ x2 • P(x) ] – µ2
Std. Dev
2
 =
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
[ x2 • P(x) ] – µ2
5.1 - 34
Binomial Distribution: Formulas
Mean
µ
=n•p
Variance  2 = n • p • q
Std. Dev. 
=
n•p•q
Where
n = number of fixed trials
p = probability of success in one of the n trials
q = probability of failure in one of the n trials
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 35
Interpretation of Results
It is especially important to interpret results.
The range rule of thumb suggests that values
are unusual if they lie outside of these limits:
Maximum usual values = µ + 2 
Minimum usual values = µ – 2 
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 36
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 37
Mendel Genetics Experiment
Mendel generated 580 offspring peas and according to his theory 75% of
them (i.e. 435) should have green pods.
In reality he got 428, is this unusual if his theory is true?
> n = 580
> p = 0.75
> mu = n*p
> mu
[1] 435
> sigma = sqrt(n*p*(1-p))
> sigma
[1] 10.42833
> c(mu-2*sigma,mu+2*sigma) # range of usual values
[1] 414.1433 455.8567
428 is within this range => it is not unusual
In reality, we have to take variation into account – we
can NOT get exactly 75%.
=> as long as the results do NOT vary too far from the
predicted value, they are NOT unusual.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 38
Color blindness
The frequency of color blindness (dyschromatopsia) in the Caucasian
American male population is estimated to be about 8%.
We take a random sample of size 25 from this population.
The population is definitely larger than 20 times the sample size (the sample is
< 5% of population) => approximate sampling distribution by B(n = 25, p =
0.08).
> n = 25
> p = 0.08
> mu = n*p # p is a proportion of color blind people => it makes sense that there are n*p of them on average among n people
> mu
[1] 2
> sigma = sqrt(n*p*(1-p))
> sigma
[1] 1.356466
> c(mu-2*sigma,mu+2*sigma) # range of usual values
[1] -0.712932 4.712932
=> It would be unusual to have 0 color blind people (cannot be negative) and more than 4.7 (like 5) would be unusual.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 39
skip
Section 5-5
Poisson Probability
Distributions
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 40
Key Concept
skip
The Poisson distribution is another discrete probability
distribution which is important because it is often used
for describing the behavior of rare events (with small
probabilities).
Examples: probability for a particular radioactive
particle to decay, probability of an earthquake in
particular area, arrival of patients to an emergency
room, arrival of people in line, internet logs to a
particular site.
Suppose some area in California experiences a mean of
12 earthquakes in a year.
We can use Poisson distribution to find probability that
for a randomly selected year, exactly 10 earthquakes
occurs.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 41
Poisson Distribution
skip
The Poisson distribution is a discrete probability
distribution that applies to occurrences of some
event over a specified interval.
The random variable x is the number of
occurrences of the event in an interval.
The interval can be time, distance, area, volume,
or some similar unit.
The probability of the event occurring x times
over an interval is:
P(x) =
µ •e
x
–µ
x!
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
where e  2.71828
5.1 - 42
Requirements of the
Poisson Distribution
skip
 The random variable x is the number of
occurrences of an event over some interval.
 The occurrences must be random.
 The occurrences must be independent of each
other.
 The occurrences must be uniformly distributed
over the interval being used.
Parameters
 The mean is µ.
 The standard deviation is  = µ .
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 43
Difference from a
Binomial Distribution
skip
The Poisson distribution differs from the
binomial distribution in these fundamental ways:
 The binomial distribution is affected by
the sample size n and the probability p,
whereas the Poisson distribution is
affected only by the mean μ.
 In a binomial distribution the possible
values of the random variable x are 0, 1, .
. . n, but a Poisson distribution has
possible x values of 0, 1, 2, . . . , with no
upper limit.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 44
Example: Earthquakes (book)
skip
For a recent period of 100 years there were 93 major earthquakes.
The Poisson distribution applies because we are dealing with an occurrence
of an event over some interval (a year).
The mean number of earthquakes is:
mu = # of earthquakes / # of years = 93/100 = 0.93
> numberOfEvents = 93
> numberOfIntervals = 100
> mu = numberOfEvents/numberOfIntervals
> mu
[1] 0.93
>
> # Like calculator
> P = rep(0,8) # just to create an array of zeros
>P
[1] 0 0 0 0 0 0 0 0
> P[1] = mu^0 * exp(-mu) / factorial(0) # Prob of 0 earthquakes in 1 year
> P[2] = mu^1 * exp(-mu) / factorial(1) # Prob of 1 earthquakes in 1 year
> # etc....
>
> # The easiest way is just to use R's built-in function
> P = dpois(0:7,lambda = mu)
>P
[1] 3.945537e-01 3.669350e-01 1.706248e-01 5.289367e-02 1.229778e-02
[6] 2.287387e-03 3.545450e-04 4.710383e-05
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
> Freq = P*numberOfIntervals
> Freq
[1] 39.455371037 36.693495065 17.062475205 5.289367314
1.229777900
[6] 0.228738689 0.035454497 0.004710383
>
> # Compare to actual frequencies
> # number of Earthquakes 0 1 2 3 4 5 6 7
> # number of years
47, 31, 13, 5, 2, 0, 1, 1
> # They are not very far from the ones predicted by Poisson
> # => Poisson is a good model
>
>
5.1 - 45
Poisson as an Approximation
to the Binomial Distribution
skip
The Poisson distribution is sometimes used
to approximate the binomial distribution
when n is large and p is small.
Rule of Thumb
 n  100
 np  10
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 46
Poisson as an Approximation
to the Binomial Distribution - μ
skip
If both of the following requirements are
met,
 n  100
 np  10
then use the following formula to calculate
µ,
Value for μ
= n • p
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 47
skip
Example (book):
In Illinois pick 3 game, you pay 50c to select a sequence of 3 digits.
If you play it once every day, find the probability of winning exactly once
in a whole year of 365 days.
Time interval is 365 days => n = 365 – there are 365 trials
There is one winning set of numbers among 000 to 999 – 1000 possible
 p = 1/1000
n independent trials, each trial success (p), failure (1-p) -- binomial
Can do it directly, but oftentimes this produces very large factorials
n >= 100 and n*p = 0.365 <= 10 => can try Poisson approximation.
> n = 365
> p = 1/1000
>
> # Directly using Binomial
> choose(n,1)*p^(1)*(1-p)^(n-1)
[1] 0.2535891
>
>
> # Poisson approximation
> mu = n*p
> mu
[1] 0.365
>x=1
> P = mu^x*exp(-mu)/factorial(x)
>P
[1] 0.2533818
# very close to exact
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved.
5.1 - 48