Download Notes

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Statistics wikipedia , lookup

History of statistics wikipedia , lookup

Inductive probability wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
The Practice of Statistics, 2nd ed.
Yates, Moore, and Starnes
Chapter 8 – The Binomial and Geometric Distributions
Introduction
We are often more interested in experiments in which there are two outcomes of interest
(success/failure, make/miss, yes/no, etc.). In this chapter we study two types of
probability distributions that are used in this case, namely the geometric and binomial
distributions.
8.1 – The Binomial Distributions
A binomial setting has the following characteristics:
1. Each observation can be a “success” or a “failure”
2. The variable of interest is the number of “successes” in a fixed number of
observations
3. The n observations are all independent
4. The probability of success, typically named p, is the same for each observation
If data are produced in a binomial setting, then the random variable
X = number of successes
is called a binomial random variable, and its probability distribution is called the
binomial distribution with parameters n and p.
1. The parameter n is the number of observations
2. The parameter p is the probability of a success on any one observation (remember
that this is the same for each of the observations)
3. The possible values of X are the whole numbers from 0 to n.
4. We typically denote a binomial random variable with X ~ B ( n, p ) .
Note on “success” and “failure” – this is somewhat unfortunate nomenclature. You
should look at a “success” as observing what you were counting, and a “failure” as not
observing what you were counting. For example, if X is the number of light bulbs out of
a bin of 20 bulbs that fail after 100 hours of use, we would consider each light bulb that
fails a “success” as far as our binomial distribution is concerned. Make sure you
understand that “success” and “failure” do not have the typical connotations.
Binomial Probabilities
The actual probability that P ( X = k ) for any k in the range {0, 1, 2, …, n} is given by
the formula
n
n−k
P ( X = k ) =   p k (1 − p ) ,
k 
n
n!
where   =
and n ! = 1 ⋅ 2 ⋅ 3 ⋅⋯ ⋅ n .
 k  k !( n − k ) !
This formula makes sense – in order to have k successes, we must have n − k failures.
The probability of each success is p, and so the probability of each failure is 1 − p . Since
each trial is independent and we want the probability of all these successes and failures
happening at the same time, we multiply these probabilities, so we have k factors of p and
Page 1 of 6
The Practice of Statistics, 2nd ed.
Yates, Moore, and Starnes
Chapter 8 – The Binomial and Geometric Distributions
n − k factors of 1 − p . Finally, we must account for the number of arrangements of each
n
of the successes and failures, and the binomial coefficient, or   , takes care of this.
k 
We derived this in class – look in your class notes for further explanation.
Note that the probability formula only gives the probability that X equals a given value.
If we want the probability that X is less than, less than or equal to, greater than, or greater
than or equal to a given value, we must use the formula to find individual probabilities
and then add those together. The following table shows some examples of this for the
binomial distribution of the variable X that has the possible values X = {0,1, 2,3, 4} .
Desired Probability
P ( X < 2)
Calculation
P ( X = 0 ) + P ( X = 1)
P ( X > 2)
P ( X = 3) + P ( X = 4 )
P ( X ≤ 2)
P ( X ≥ 2)
P ( X = 0 ) + P ( X = 1) + P ( X = 2 )
P ( X = 2 ) + P ( X = 3) + P ( X = 4 )
If X could take on more values, such as X = {0,1, 2,..., 50} , then we might find ourselves
calculating probabilities such as P ( X > 40 ) = P ( X = 41) + P ( X = 42 ) + ⋯ + P ( X = 50 ) ,
n
n−k
each term of which requires the unwieldy formula P ( X = k ) =   p k (1 − p ) . Yikes!
k 
Thankfully, our calculators can help us out with this. They have two built-in functions
that are quite useful – binompdf( ) and binomcdf( ). These are found under the 2ND –
VARS (DISTR) menu on the TI-83 and TI-84. The former, binompdf( ), stands for
binomial probability distribution function and is used when we want the probability that
X equals a given value. The latter, binomcdf( ), stands for cumulative probability
distribution function and is used when we want the probability that X is less than or
equal to a given value. The table on the following page gives an example of how these
work:
Page 2 of 6
The Practice of Statistics, 2nd ed.
Yates, Moore, and Starnes
Chapter 8 – The Binomial and Geometric Distributions
Suppose we are given a binomial distribution with n = 5 and p = 0.25. Then:
Desired
Probability
P ( X = 3)
P ( X ≤ 1)
Formula
 5
3
2
P ( X = 3) =   (.25 ) (.75 ) = 0.0879
 3
P ( X ≤ 1) = P ( X = 0 ) + P ( X = 1)
Calculator
binompdf(5, 0.25, 3) = 0.0879
5
5
0
5
1
4
=   (.25 ) (.75 ) +   (.25 ) (.75 )
0
1
binomcdf(5, 0.25, 1) = 0.6328
5
4
 5! 
 5! 
=
1
.75
+
.25
.75
(
)(
)
(
)(
)



 0!5! 
 1!4! 
= .6328
Clearly the calculator version is much easier, especially in the second case. However,
you will be expected to know how to calculate binomial probabilities without your
calculators – so be sure you know the formulas and understand the binomial coefficient
notation.
What do we do for the cases where we want <, >, or ≥ ? The formula versions are much
the same – we just add up the appropriate probabilities. However, we have to “trick” our
calculators to do these calculations correctly. In the context of the above example, think
about P ( X > 2 ) . Our calculator doesn’t have a function that calculates this probability
directly. However, isn’t this the same as P ( X = 3) + P ( X = 4 ) + P ( X = 5 ) ? Wouldn’t
this probability be the same as 1 − ( P ( X = 0 ) + P ( X = 1) + P ( X = 2 ) ) ? But isn’t the
probability being subtracted here just P ( X ≤ 2 ) ? This last probability is one our
calculators can do, i.e., P ( X > 2 ) = 1 − P ( X ≤ 2 ) = 1 – binomcdf(5, 0.25, 2).
Now consider P ( X ≥ 2 ) . Isn’t this just P ( X = 2 ) + P ( X = 3) + P ( X = 4 ) + P ( X = 5 ) ?
Isn’t this probability just 1 − ( P ( X = 0 ) + P ( X = 1) ) ? And finally, isn’t this just
1 − P ( X ≤ 1) = 1 – binomcdf(5, 0.25, 1).
Finally, consider P ( X < 2 ) . This is the same as P ( X ≤ 2 ) , but without the 2. Isn’t this
also the same as P ( X ≤ 1) ? So here we can just take binomcdf(5, 0.25, 1).
Adding these to the previous table gives us
Page 3 of 6
The Practice of Statistics, 2nd ed.
Yates, Moore, and Starnes
Desired
Probability
Chapter 8 – The Binomial and Geometric Distributions
Formula
 5
3
2
P ( X = 3) =   (.25 ) (.75 ) = 0.0879
 3
P ( X ≤ 1) = P ( X = 0 ) + P ( X = 1)
P ( X = 3)
5
5
0
5
1
4
=   (.25 ) (.75 ) +   (.25 ) (.75 )
0
1
5
4
 5! 
 5! 
=
 (1)(.75 ) + 
 (.25 )( .75 )
 0!5! 
 1!4! 
= .6328
P ( X > 2) = 1 − P ( X ≤ 2)
P ( X ≤ 1)
P ( X > 2)
P ( X ≥ 2) = 1 − P ( X < 2)
P ( X ≥ 2)
= 1 − P ( X ≤ 1)
P ( X < 2)
P ( X < 2 ) = P ( X ≤ 1)
Calculator
binompdf(5, 0.25, 3) = 0.0879
binomcdf(5, 0.25, 1) = 0.6328
1 – binomcdf(5, 0.25, 2) = 0.1035
1 – binomcdf(5, 0.25, 1) = 0.3672
binomcdf(5, 0.25, 1) = 0.6328
Make sure you understand all of the above uses of the binompdf and binomcdf
commands on your calculator, as well as how to write out the appropriate formulas for
calculating these without your calculator.
Binomial mean and standard deviation
We derived these in class – get someone’s notes if you’re interested in how it is done.
The mean and standard deviation of a binomial random variable X are given by
µ X = np
and
σ X = np (1 − p ) ,
where n is the number of trials and p is the probability of success on each trial.
Because calculating probabilities with the binomial probability formula is quite
cumbersome, it is nice to know we have alternatives. One such alternative was the use of
the binomcdf( ) and binompdf( ) functions on your calculator. One other alternative is to
use a normal approximation to the binomial distribution.
It turns out that if the number of trials is large enough, we can approximate a binomial
distribution with an appropriate normal distribution. One general rule of thumb is that n
is “large enough” if np ≥ 10 and n (1 − p ) ≥ 10 . If the binomial distribution meets these
conditions, we can then approximate X ~ B ( n, p ) with the normal distribution
(
)
X ~ N np, np (1 − p ) . This is just the normal curve with the same mean and standard
deviation as the binomial variable X. Study and understand Example 8.13.
Page 4 of 6
The Practice of Statistics, 2nd ed.
Yates, Moore, and Starnes
Chapter 8 – The Binomial and Geometric Distributions
8.2 – The Geometric Distributions
A binomial distribution has a fixed number of trials, and the variable of interest is the
number of successes in n trials. A geometric distribution, on the other hand, does not
have a fixed number of trials, and the variable of interest is the number of trials until the
first success is obtained. The possible values of a binomial random variable are
X = {0,1, 2, 3,..., n} , whereas the possible values for a geometric random variable are
X = {1, 2,3,...} . In other words, there are an infinite (albeit countable) number of possible
outcomes for a geometric distribution.
A geometric setting has the following characteristics:
1. Each observation can be a “success” or a “failure”
2. The n observations are all independent
3. The probability of success, typically named p, is the same for each observation
4. The variable of interest is the number of trials required to obtain the first success
The above list is very similar to the list given for the binomial setting. The only
difference is that in the binomial setting we are interested in the number of successes
while in the geometric setting we are interested in the number of trials required to obtain
the first success. Theoretically, in a geometric setting, the number of trials could range
anywhere from 1 to infinity!
If data are produced in a geometric setting, then the random variable
X = number of trials required to obtain the first success
is called a geometric random variable and its probability distribution is called the
geometric distribution.
Geometric Probabilities
If X has a geometric distribution with probability p of success and (1 − p ) of failure on
each observation, the possible values of X are 1, 2, 3, .... If n is any one of these values,
the probability that the first success occurs on the nth trial is
n −1
P ( X = n ) = (1 − p ) p .
Again, this probability formula makes sense. If we want our first success to occur on the
nth trial, we need the first n − 1 trials to be failures. Each of the failures occurs
independently with probability of (1 − p ) , so we multiply these n − 1 probabilities
together to get (1 − p ) . Finally, we want the last trial to be a success, and this success
occurs independently of the trials preceding it with probability p, and so we multiply by p
to get the above formula.
n −1
By the way, there is a formula that may come in handy when calculating geometric
probabilities without a calculator, and it involves finding the probability that it takes more
than a given number of trials before we obtain our first success. That formula, which is
derived in the textbook, is
P(it takes more than n trials to obtain first success) = P ( X > n ) = (1 − p ) .
n
Page 5 of 6
The Practice of Statistics, 2nd ed.
Yates, Moore, and Starnes
Chapter 8 – The Binomial and Geometric Distributions
Again, our calculator has built-in functions that help us calculate these probabilities.
They are much like the binompdf and binomcdf commands. However, we no longer have
a fixed number of trials, so the syntax of the geometric commands are P ( X = k ) = P(first
success occurs on kth trial) = geometpdf(p, k) and P ( X ≤ k ) = P(first success occurs on
or before kth trial) = geometcdf(p, k).
The table above for binomial probabilities and the use of binomcdf or binompdf would
also apply to geometric distributions and the use of geometcdf and geometpdf.
Geometric mean and standard deviation
You can look in your textbook to see how the mean is derived. The derivation of the
standard deviation involves second derivatives (from calculus) and so we won’t study it
in our class.
The mean (expected value) and standard deviation of the geometric random variable X
are given by
1
µX =
p
and
1− p
σX =
,
p2
where p is the probability of a success on any one trial. Note that the above formulas do
not involve n like they did for the binomial random variable. The reason should be
obvious – we do not know what n will be ahead of time!
Helpful hints
1. When confronted with a probability question involving a random variable X, be
sure to take the time to define what X represents. It often makes the problem a
whole lot easier! Similarly, make sure you clearly understand which probability
applies to a “success.”
2. Make sure you check all four conditions: success/failure, independent trials, equal
probabilities, and either looking for the trial on which we have our first success
(geometric) or for the number of successes in n trials (binomial).
3. Remember the rule of thumb for using a normal approximation to a binomial
distribution, namely that n and p have to satisfy both of the following:
np ≥ 10 and n (1 − p ) ≥ 10 .
Plots of probability and cumulative distribution functions (pdf and cdf)
Make sure you work through and understand the “Technology Toolboxes” on pages 455457 and 471-472 regarding how to plot binomial and geometric probability and
cumulative distribution functions, and review the difference between them.
Page 6 of 6