• No results found

6. Discrete Random Variables and Probability Models 55

6.4 Binomial Distribution

Physical Setup:

Suppose an “experiment" has two types of distinct outcomes. Call these types “success” (S) and

“failure” (F ), and let their probabilities be p (for S) and 1− p (for F ). Repeat the experiment n independent times. Let X be the number of successes obtained. Then X has what is called a binomial distribution. (We write X ∼ Bi(n, p) as a shorthand for “X is distributed according to a binomial distribution with n repetitions and probability p of success”.) The individual experiments in the process just described are often called “trials”, and the process is called a Bernoulli6 process or a binomial process.

Illustrations:

1. Toss a fair die 10 times and let X be the number of sixes that occur. Then X∼ Bi(10, 1/6).

2. In a microcircuit manufacturing process, 60% of the chips produced work (40% are defec-tive). Suppose we select 25 independent chips and let X be the number that work. Then X ∼ Bi(25, .6).

Comment: We must think carefully whether the physical process we are considering is closely approximated by a binomial process, for which the key assumptions are that (i) the probability p of success is constant over the n trials, and (ii) the outcome (S or F ) on any trial is independent of the outcome on the other trials. For Illustration 1 these assumptions seem appropriate. For Illustration 2

6After James (Jakob) Bernoulli (1654 – 1705), a Swiss member of a family of eight mathematicians, who started his professional life in the ministry, and is responsible Bernoulli’s Theorem as well as many of the combinatorial results in these notes.

−50 0 5 10 15 20 25

Figure 6.3: The Binomial(20, 0.3) probability histogram.

we would need to think about the manufacturing process. Microcircuit chips are produced on “wafers”

containing a large number of chips and it is common for defective chips to cluster on wafers. This could mean that if we selected 25 chips from the same wafer, or from only 2 or 3 wafers, that the

“trials” (chips) might not be independent.

Probability Function: There are x!(n−x)!n! = ¡n

x

¢different arrangements of x S’s and (n− x) F ’s over the n trials. The probability for each of these arrangements has p multiplied together x times and (1 − p) multiplied (n − x) times, in some order, since the trials are independent. So each arrangement has probability px(1 − p)n−x.

We graph in Figure 6.3 the probability function for the Binomial distribution with parameters n = 20 and p = 0.3. Although the formula for f (x) may seem complicated this shape is typically, increasing to a maximum value near np and then decreasing thereafter.

Computation: Many software packages and some calculators give binomial probabilities. In R we use the function dbinom(x, n, p) to compute f (x) and pbinom(x, n, p) to compute the corresponding c.d.f. F (x) = P (X≤ x).

Example Suppose that in a weekly lottery you have probability .02 of winning a prize with a single ticket. If you buy 1 ticket per week for 52 weeks, what is the probability that (a) you win no prizes, and (b) that you win 3 or more prizes?

Solution: Let X be the number of weeks that you win; then X∼ Bi(52, .02). We find (a) P (X = 0) = f (0) =¡52 Comparison of Binomial and Hypergeometric Distributions:

These distributions are similar in that an experiment with 2 types of outcome (S and F ) is repeated n times and X is the number of successes. The key difference is that the binomial requires independent repetitions with the same probability of S, whereas the draws in the hypergeometric are made from a fixed collection of objects without replacement. The trials (draws) are therefore not independent. For example, if there are n = 10 S objects and N− r = 10 F objects, then the probability of getting an S on draw 2 depends on what was obtained in draw 1. If these draws had been made with replacement, however, they would be independent and we’d use the binomial rather than the hypergeometric model.

If N is large and the number, n, being drawn is relatively small in the hypergeometric setup then we are unlikely to get the same object more than once even if we do replace it. So it makes little practical difference whether we draw with or without replacement. This suggests that when we are drawing a fairly small proportion of a large collection of objects the binomial and the hypergeometric models should produce similar probabilities. As the binomial is easier to calculate, it is often used as an approximation to the hypergeometric in such cases.

Example: Suppose we have 15 cans of soup with no labels, but 6 are tomato and 9 are pea soup. We randomly pick 8 cans and open them. Find the probability 3 are tomato.

Solution: The correct solution uses hypergeometric, and is (with X = number of tomato soups picked) f (3) = P (X = 3) =

If we incorrectly used binomial, we’d get f (3) =

As expected, this is a poor approximation since we’re picking over half of a fairly small collection of cans.

However, if we had 1500 cans - 600 tomato and 900 pea, we’re not likely to get the same can again even if we did replace each of the 8 cans after opening it. (Put another way, the probability we get a tomato soup on each pick is very close to .4, regardless of what the other picks give.) The exact, hypergeometric, probability is now (6003 )(9005 )

(15008 ) = .2794. Here the binomial probability, µ8

3

¶ µ 600 1500

3µ 900 1500

5

= 0.279 is a very good approximation.

Problems:

6.4.1 Megan audits 130 clients during a year and finds irregularities for 26 of them.

a) Give an expression for the probability that 2 clients will have irregularities when 6 of her clients are picked at random,

b) Evaluate your answer to (a) using a suitable approximation.

6.4.2 The flash mechanism on camera A fails on 10% of shots, while that of camera B fails on 5% of shots. The two cameras being identical in appearance, a photographer selects one at random and takes 10 indoor shots using the flash.

(a) Give the probability that the flash mechanism fails exactly twice. What assumption(s) are you making?

(b) Given that the flash mechanism failed exactly twice, what is the probability camera A was selected?