Probability Meets Data

examined two a priori arguments that the probability of winning the game by switching is 1/2, and two a priori arguments that the probability of winning by switching is 1/3.

This chapter develops an empirical approach to resolving the issue using the observed number of wins in repeated play. Developing the approach leads to several key ideas: box models, the Law of Large Numbers, probability histograms, the binomial distribution, and the maximum likelihood method for deciding among competing models.

Introduction

This chapter uses the Let's Make a Deal problem to develop several ideas that are central to Statistics and Probability. We would like to know whether the chance of winning the game by switching is 1/2 or 2/3. The number of wins by switching in a fixed number of plays of the game is represented by a box model, a probabilistically equivalent problem involving drawing tickets at random from a box. If the chance of winning by switching is 1/2, the number of wins in 50 plays is like the sample sum of the numbers on the tickets in 50 random draws with replacement from a box that contains two tickets, one labeled "1" and one labeled "0." If the chance of winning by switching is 2/3, the number of wins in 50 plays of the game is like the sample sum of the numbers on the tickets in 50 random draws with replacement from a box that contains three tickets, two labeled "1" and one labeled "0." This leads us to study the probability distribution of the sample sum of draws with replacement from boxes of numbered tickets. For boxes that contain tickets labeled only with the numbers 0 and 1, we calculate the probability distribution of the sample sum explicitly using ideas from This distribution is called the binomial distribution. We decide whether the probability of winning by switching is 1/2 or 2/3 using maximum likelihood: whichever hypothesis assigns larger probability to the observed data.

A Box Model for the Let's Make a Deal Problem

Suppose that the chance of winning by switching really is 50%. Then if we play the game (independently) over and over, say 50 times, the number of times we win behaves like the number of heads in 50 tosses of a fair coin. Equivalently, it behaves like the number of tickets labeled "1" we get in 50 random draws with replacement from a box of tickets containing one ticket labeled "0" and one ticket labeled "1:"

Box 1

0

1

Getting the ticket labeled "1" in a given draw represents a win by switching in the corresponding play of the game; getting the ticket labeled "0" in a given draw represents a loss by switching in the corresponding play of the game.

In contrast, if the chance of winning by switching is really 2/3 (66.67%), the number of times we win by switching in 50 independent plays of the game is like the number of tickets labeled "1" we get in 50 random draws with replacement from a box of tickets containing one ticket labeled "0" and two tickets labeled "1:"

Box 2

0

1

1

We stir up the tickets in the box and draw a ticket without looking. We then record the number on the ticket drawn, replace the ticket, stir up the box again, and draw again, until we have drawn 50 times.

These are examples of box models, in which an experiment is modeled by a probabilistically equivalent problem involving drawing tickets at random from a box. We call any box of numbered tickets for which the number on each ticket is 0 or 1 a 0-1 box. Box 1 and Box 2 are 0-1 boxes.

We would expect about half of the draws from Box 1 to result in the ticket labeled "1;" we would expect about 2/3 of the draws from Box 2 to result in a ticket labeled "1." We want to decide from the number of tickets labeled "1" we get in 50 draws whether winning by switching is like drawing at random from Box 1 or like drawing at random from Box 2. Fifty draws from either box could yield a ticket labeled "1" any number of times between 0 and 50, but the chances of these possibilities are different for the two boxes.

Consider the following rule:

Any rule like this can err in two ways: It can lead us to conclude that the box is Box 1 when it is really Box 2, and vice versa. (If the box is neither Box 1 nor Box 2, the rule always suggests the wrong conclusion.)

Because we expect a larger number of tickets labeled "1" if we are drawing from Box 2, it makes sense to conclude that the box is Box 2 if sufficiently many of the draws give a ticket labeled "1." How high should we set the threshold?

In 50 repeated plays of the game, how does the number of wins by switching behave under the two hypotheses—that the chance of winning by switching is 50% and that the chance of winning by switching is 66.67%? Equivalently, how does the number of tickets labeled "1" in 50 independent draws with replacement from Box 1 compare with the number of tickets labeled "1" in 50 independent draws with replacement from Box 2?

Notice that the number of tickets labeled "1" in n draws is just the sum of the numbers on the tickets drawn: Each ticket labeled "1" contributes 1 to the sum; each ticket labeled "0" leaves the sum unchanged. That is, we get a ticket labeled "1" on exactly k of the n draws if and only if the sum of the numbers on the tickets we draw is k. The sum of the numbers on the tickets drawn at random is called the sample sum.

The sample sum of 50 draws with replacement from Box 1 or Box 2 is not perfectly predictable: It depends on the luck of the draw. There is a calculable probability that the sample sum of 50 random draws with replacement from Box 1 equals 0, that it equals 1, … , and that it equals 50. Those probabilities comprise the sampling distribution of the sample sum for a random sample of size 50 with replacement from Box 1. lets us study this sampling distribution:

The text area at the right of the tool shows the contents of the box of tickets: initially, two tickets, one labeled "0" and one labeled "1," just as in Box 1. We shall call this text area the "population box" to distinguish it from the other boxes in the figure that accept input. The number of tickets to draw with replacement is the sample size, which is given near the bottom of the figure, and is set to 50 initially. Every time you click Take Sample, the computer draws 50 tickets with replacement from the population box, computes their sample sum, and updates a histogram in the middle of the figure. The histogram displays the frequency distribution of the values of the sample sum so far. Click Take Sample a few times. You will see the distribution of the sample sum of 50 draws from Box 1 evolve.

The numbers at the left of are properties of the numbers in the population box and the sample values. Starting from the bottom, Samples is the number of samples of size 50 that have been drawn from the population box—the number of values of the sample sum displayed in the histogram. SD(values) is the standard deviation of the Samples observed values of the sample sum. Mean(values) is the mean of the Samples observed values of the sample sum. SE(sum) is the standard error of the sample sum of 50 random draws with replacement from the population box; standard error is introduced in The standard error of the sample sum is a measure of how scattered the values of the sample sum tend to be in repeated experiments. E(sum) is the expected value of the sample sum; expected value is introduced in The expected value of the sample sum is the long-run average value of the sample sum in repeated experiments. SD(box) is the standard deviation of the list of numbers on the tickets in the population box. The population box initially contains one ticket labeled "1" and one ticket labeled "0." The mean of these two values is (0 + 1)/2 = 0.5, so the SD of the list is

SD(box) = ( ((0-0.5)2 + (1 - 0.5)2)/2 )½ = 0.5.

Ave(box) is the mean of the numbers on the tickets in the population box, which is 0.5 initially.

Change the number of samples to take (in Take__________samples) from 1 to 1000. This will speed things up: Every time you click Take Sample, the computer will draw 50 tickets with replacement from the population Box 1000 times, and include the 1000 new values of the sample sum in the histogram. Click Take Sample a few times. Note that the histogram of the sample sum changes rapidly at first, then stabilizes: Once you have taken a few thousand samples, the shape of the histogram does not change much when you draw even more samples of size 50. ( will not allow you to take more than 10,000 samples of size 50.) The distribution is centered at 25: on the average, in 50 draws with replacement from Box 1, one gets 25 tickets labeled "1." However, the entire range of values between 0 and 50 is possible, and a range of about 15 values around 25 occurs fairly frequently.

Now delete the contents of the population box on the right and replace them with 0, 1, 1, so that the population box is like Box 2 instead of Box 1. Click Take Sample a few times, leaving Take_________samples set to 1000. The histogram of the observed values of the sample sum stabilizes to a different shape than it had for draws from Box 1. This histogram is centered near 50×2/3=33.33. That the shape of the histogram stabilizes as the number of samples of size 50 grows illustrates the Law of Large Numbers, which states that the relative frequency with which an event occurs in repeated, independent trials is increasingly likely to be close to the probability of the event. The Law of Large Numbers is extremely important for the Frequency Theory of Probability, because it says we can estimate the probability of an event by the relative frequency of its occurrence in repeated trials. We shall look at the Law of Large Numbers in more detail in

When samples of size 50 with replacement are drawn over and over from a box of tickets, the frequency histogram of the sample sum converges to the probability histogram of the sample sum: The area of each bin converges to the probability that the sample sum is in the bin. Previously in this text, histograms were used to represent data (observations) graphically. A probability histogram is different: It represents probabilities graphically. It gives the probability of each possible value of the random quantity in question. The probabilities of all possible values of a random quantity (such as the sample sum) are called a probability distribution. shows the probability histogram for the sample sum of 50 independent draws with replacement from Box 1:

The area of each bin is the probability that the sample sum of 50 independent draws with replacement from Box 1 is in the class interval that forms the base of the bin. This particular probability histogram represents a probability distribution we shall find explicitly. The area of the bin centered at k is the chance of getting k of tickets labeled "1" in 50 independent draws with replacement from Box 1.

The Binomial Probability Distribution

 

The sample sum of 50 random draws with replacement from Box 1 is a special case of the sample sum of n random draws with replacement from a box of tickets of which a fraction p are labeled "1" and the rest are labeled "0." The probability distribution of such a sample sum has a name: the binomial distribution with parameters n and p. For k=0, 1, 2, … , n, the binomial distribution with parameters n and p gives the chance that the sample sum equals k. The probability distribution of the sample sum of 50 random draws with replacement from Box 1 has a binomial distribution with parameters n = 50 and p = 50%. Let us figure out what that distribution is.

The sample sum of 50 draws with replacement from Box 1 equals k if we draw k tickets labeled "1" and (50-k) tickets labeled "0." How many ways can that occur? There are 50Ck ways to specify k of 50 draws to be the draws that give tickets labeled "1." We can find the total chance of getting "1" on k of the draws by adding the chances of getting k "1"s each of those 50Ck possible ways, because those ways are mutually exclusive.

Consider one particular way to get k "1"s: the first k draws give the ticket labeled "1," and the rest give the ticket labeled "0." Because the draws are independent, the chance of

"1" on the first draw and "1" on the second draw and … and "1" on the kth draw and "0" on the k+1st draw and "0" on the k+2nd draw and … and "0" on the 50th draw

is the product of the chance of getting "1" on the first draw, the chance of getting "1" on the second draw, … and the chance of getting "0" on the 50th draw, namely

(chance of getting "1")k × (chance of getting "0")50-k = (50%)k × (50%)50-k = (50%)50.

The chance of getting "1" k times and "0" 50-k times in any other order is the same: Because the draws are independent, we would get the same factors in a different order. The product does not depend on the order of the factors (multiplication is commutative), so the product would still be (50%)50.

Thus the chance of getting "1" k times and "0" 50-k times is

50Ck(50%)50.

By similar reasoning, if we were drawing from Box 2, the chance of getting "1" k times and "0" 50-k times in any particular order would be (2/3)k(1/3)50-k, and because there are 50Ck possible orders for the k "1"s, the overall chance of getting k tickets labeled "1" (the chance that the sample sum is k) is

50Ck × (chance of getting "1")k × (chance of getting "0")50-k = 50Ck(2/3)k × (1/3)50-k.

These are instances of a general rule:

The Binomial Distribution

Suppose a box of tickets has a proportion p of tickets labeled "1" and a proportion 1-p of tickets labeled "0." The probability of drawing exactly k tickets labeled "1" (the chance that the sample sum is k) in n independent random draws with replacement from the box is

nCk×pk×(1-p)n-k,

for k = 0, 1, … , n. The probability is zero for every other value of k.

This is called the binomial distribution with parameters n and p.

shows the probability histogram of the binomial distribution with parameters n=50 and p=50%.

The sample sum of 50 independent draws with replacement from Box 2 has a binomial distribution with parameters n=50 and p=2/3=66.67%. is its probability histogram:

Dependence of the Binomial Distribution on n and p

How does the binomial distribution depend on n and p? The larger the number of trials n, the wider the range of possible outcomes: The range of possible outcomes is from zero to n (one cannot draw fewer than 0 tickets labeled "1," nor more than n tickets labeled "1" in n draws). If the fraction p of tickets labeled "1" in the box is zero, all the draws must result in a ticket labeled "0," so the chance that the sample sum is zero equals 100%, and the chance of any other value is zero. If p is small, the number of times a ticket labeled "1" is drawn is likely to be small, so the distribution is skewed to the right (most of the probability is at the left end of the histogram, with a long, thin right tail).

If p = 50%, the chances of drawing a ticket labeled "0" and of drawing a ticket labeled "1" are the same in every trial. The chance the sample sum is k thus must equal the chance that the sample sum is n-k, so the probability histogram must be symmetrical.

If p is very large (close to 100%), it is likely that a large proportion of the draws will yield a ticket labeled "1," so the probability histogram will be skewed to the left. If p = 100%, all the tickets are labeled "1," so the chance that the sample sum is n is 100%, and the chance of any other value is zero.

The probability histogram is most spread out when p = 50%. When p is larger or smaller, the probability tends to be more concentrated in a smaller range of values, becoming increasingly concentrated as p approaches 0% or 100% (then the probability becomes completely concentrated at 0 or n, respectively).

Experiment for yourself using : Change the value of n to 5, 20, 50, and 100, and change the value of p to 1%, 10%, 50%, 90%, and 99%. Note how the shape of the binomial probability histogram varies.

When the Binomial Distribution Does not Apply

We can identify drawing a ticket labeled "1" with "success," and drawing a ticket labeled "0" with "failure." In repeated independent draws with replacement, the number of tickets labeled "1" drawn from the box in n draws (the sample sum of n draws) can be thought of as the number of "successes" in n independent trials that each have the same probability p of success (p is the proportion of tickets in the box labeled "1," which does not change from draw to draw if the tickets are replaced). If a quantity is not equivalent to the sample sum of n independent draws with replacement from a box of tickets of which a proportion p are labeled "1" and the rest are labeled "0," the quantity does not have a binomial distribution.

If the box contains tickets labeled with numbers other than 0 and 1, the sample sum does not have a binomial distribution. If the number n of draws is not fixed in advance, the sample sum does not have a binomial distribution. If the draws are not independent, the sample sum does not have a binomial distribution. If the chance of drawing a ticket labeled "1" is not the same value p in each draw, the sample sum does not have a binomial distribution.

For example, suppose we draw from a box that contains five tickets in it: three with "0" written on them and two with "1" written on them. If we stir up the tickets in the box and draw one at random, the chance that it says "1" is 40% (2/5). If we draw five times in succession, with replacement and stirring the tickets thoroughly between draws, the number of times we get a ticket labeled "1" has a binomial distribution with parameters n=5 and p=40%. If we do not stir the tickets up between draws, we're more likely to draw the same ticket over and over (it stays on top): The draws are not independent, so the binomial distribution does not apply. Similarly, if we do not replace the tickets between draws, the draws are dependent, and the probability of drawing a ticket labeled "1" is not constant from trial to trial, so the binomial distribution does not apply.

The binomial distribution does not apply if the number of draws is not fixed in advance. For example, suppose we draw with replacement from the box just described, mixing the tickets thoroughly between draws, and continue drawing until we see "1" twice in a row. Then the number of draws is random, not fixed, and the sample sum of the draws does not have a binomial distribution. illustrates the issue.

Using the Binomial Distribution

The following examples hint at the range of problems that can be solved using the binomial distribution.

What is the chance that the sum of 50 independent draws with replacement from Box 2 is at least 35 and no larger than 40?

Solution. We break the event into mutually exclusive outcomes whose chances we know how to compute. For the sample sum to be at least 35 and no larger than 40 means that the sample sum is 35, 36, 37, 38, 39, or 40.

The chance that the sample sum is 35 is 50C35(2/3)35(1/3)15. The chance that the sample sum is 36 is 50C36(2/3)36(1/3)14, etc. Adding these 6 numbers together gives the chance that the sample sum is at least 35 and no larger than 40.

Alternatively, we can read the chance from by highlighting the range of bins centered at 35 to 40. That range is from 34.5 to 40.5; the tool shows that the area from 34.5 to 40.5 of the binomial probability histogram for n=50 draws and a proportion p=2/3 of tickets labeled "1" is 35.6%.

 

A box contains 3 tickets. One of the tickets is labeled "0," one is labeled "1," and  1 is labeled "2." What is the chance that the sample sum of two draws with replacement from the box is 2?

Solution: Because the tickets are labeled with numbers other than just "0" and "1," the sample sum does not have a binomial distribution. However, we can still find the chance using the kind of reasoning that led to the binomial distribution.

How can the sample sum of two draws with replacement from this box equal 2? There are three mutually exclusive ways:

Because the draws are independent and the chance of getting each of the three tickets is the same (1/3), the chance of each of these mutually exclusive ways that the sample sum can equal 2 is (1/3)(1/3)=1/9. That is, the chance of getting the ticket labeled "1" on the first and second draws is (1/3)(1/3); the chance of getting the ticket labeled "0" on the first draw and the ticket labeled "2" on the second draw is (1/3)(1/3); and the chance of getting the ticket labeled "2" on the first draw and the ticket labeled "0" on the second draw is (1/3)(1/3). The overall chance that the sample sum of two draws with replacement from this box is 2 is thus 1/9+1/9+1/9 = 1/3.

 

A box contains 10 tickets labeled "0" and 5 tickets labeled "1." Tickets are drawn at random, independently with replacement from the box until three draws in a row give tickets labeled "0." What is the chance that the sample sum of numbers on the tickets is 2?

Solution: In we shall solve problems like this one. The important thing to note here is that the number of draws is random, so the sample sum does not have a binomial distribution, even though the draws are independent and the tickets are labeled "0" and "1."

 

A box of tickets contains three tickets labeled "-1" and seven tickets labeled "5." What is the chance that the sample sum of 5 independent random draws with replacement from this box is 7?

Solution: Because the labels on the tickets are not just "0" and "1," we cannot use the binomial distribution directly. However, we can transform the problem to one in which the binomial distribution can be used. Suppose we added 1 to the label of each ticket in the box. Then the labels on the tickets would be "0" and "6." That would add 5 to the sample sum of 5 draws, because no matter which ticket we got, it would contribute 1 more than its counterpart in the original problem. Suppose we divided the labels on the tickets in this new box by 6. That would divide the sample sum by six, for the same reason. However, now the transformed labels are "0" and "1." The sample sum of 5 draws from the original box equals 7 if and only if the sample sum of the relabeled tickets equals (7+5)/6 = 2. For the sample sum of 5 draws from the original box to equal 7, we need to get the ticket labeled "5" twice, and the ticket labeled "-1" thrice. The chance of this occurring is

5C2×(70%)2(30%)3  = 13.23%.

 

A box contains five tickets, labeled "1," "2," "3," "4," and "5." Ten tickets will be drawn at random with replacement from the box. What is the chance that more than 2 and fewer than 6 of the draws give tickets with even numbers on them?

Solution: The number of even-numbered tickets in 10 independent draws from this box is like the number of tickets labeled "1" in 10 draws from a box of tickets containing two tickets labeled "1" and three tickets labeled "0." Drawing a ticket labeled "1" from this box has the same chance as drawing a ticket labeled with an even number from the original box (2/5 = 40%), and drawing a ticket labeled "0" from this box has the same chance as drawing a ticket labeled with an odd number from the original box (3/5 = 60%). Thus the number of even-numbered tickets in 10 independent draws from the original box has a binomial distribution with n = 10 and p = 40%. The chance of drawing more than 2 and fewer than 6 even numbers is the chance of drawing 3, 4, or 5 even numbers, which is

10C3×(40%)3(60%)7 + 10C4×(40%)4(60%)6 + 10C5×(40%)5(60%)5  = 66.6%.

show that a problem stated in terms of a box of labeled tickets where the labels are not just "0" and "1" sometimes can be re-expressed as a box model in which the tickets have different and possibly fewer labels; in this case, just "0" and "1."

A quarter, a dime, and a nickel are tossed together 10 times. Suppose that the coins are fair, so that the chance of "heads" on each coin is 50%, and suppose that the tosses are all independent.

  1. What is the chance that in every toss, at least two of the coins show the same face (at least two heads or at least two tails)?
  2. What is the chance that all three coins land showing the same face in at least 5 of the ten tosses?

Solution.

  1. The chance is 100%. In every toss, at least two of the three coins must show the same face.
  2. The chance that all three coins land showing the same face in a given toss can be broken into two mutually exclusive events: All three coins show heads, and all three coins show tails. Because the tosses are independent, the chance that all three coins show heads on a given toss is (1/2)(1/2)(1/2) = 1/8. This is also the chance that all three coins show tails on a given toss. The chance that all three coins show the same face on a given toss is thus 1/8+1/8 = 1/4. The number of times the three coins show the same face in 10 tosses is like the sample sum of 10 independent random draws with replacement from a box that contains three tickets labeled "0" and one ticket labeled "1:"

    Box

    0

    0

    0

    1

    The sample sum of 10 draws with replacement from this box has a binomial distribution with parameters n = 10 and p = 25%. We can find this probability using , the binomial probability histogram, by changing n to 10, p to 25%, and highlighting the range 4.5 to 10.5. We also can find the sum directly:

    10C5×(25%)5(75%)5 + 10C6×(25%)6(75%)4 + 10C7×(25%)7(75%)3 +
    10C8×(25%)8(75%)2 + 10C9×(25%)9(75%) + 10C10×(25%)10
     = 7.8%.

is another example of translating a problem involving repeated trials into one that involves drawing numbered tickets independently at random from a box.

The following exercises test your understanding of the binomial distribution and your ability to use the probabilistic reasoning used to derive it.

We now know that the distribution of the sample sum of 50 random draws with replacement from Box 1 has a binomial distribution with parameters n=50 and p=50%, and that the distribution of the sample sum of 50 random draws with replacement from Box 2 has a binomial distribution with parameters n=50 and p=66.67%. These two distributions are quite different: The sample sum is likely to be much larger if we are drawing from Box 2. Armed with the binomial distribution, we can analyze the proposed rule for deciding whether switching improves one's chance of winning the Let's Make a Deal problem: conclude switching helps if the number of wins by switching in 50 plays is greater than or equal to 30; otherwise, conclude switching does not help.

Continuation of the "Let's Make a Deal" Problem

The chance of drawing k tickets labeled "1" from Box 1 or Box 2 is given by a binomial distribution with appropriate values of the parameters n and p. How can we use this fact to decide which box we are drawing from (how shall we infer whether the chance of winning by switching is 1/2 or 2/3)? There are many ways to proceed. In we shall take a different approach, called a "statistical hypothesis test" or a "test of significance." Here we shall do something similar but simpler.

I am going to draw 10 tickets at random with replacement from a box of tickets. I do not know exactly what the box contains, but I do know that either it contains one ticket labeled "0" and one ticket labeled "1," or it contains one ticket labeled "0" and one ticket labeled "5." That is, either I shall draw from Box 3 or from Box 4 below, but I do not know which. From the labels on the tickets I draw, I want to conclude whether the box is Box 3 or Box 4. Before I draw the tickets, I want to choose a rule for deciding between the hypothesis that the box is Box 3 and the competing hypothesis that the box is Box 4. The rule will say, for each possible collection of 10 tickets that might be drawn, whether to conclude the box is Box 3 or Box 4.

Box 3

0

1

Box 4

0

5

If I draw even one ticket labeled "1," I must be drawing from Box 3, so I should conclude I am drawing from Box 3. Similarly, if I get even one ticket labeled "5," I must be drawing from Box 4, so I should conclude I am drawing from Box 4. In either case, my conclusion is that I am drawing from the box for which it is more likely to observe what I do observe. If I get only tickets labeled "0," the data do not tell me anything about which box I am drawing from, so I might as well toss a coin to make the decision.

Now suppose the two possible boxes are Box 5 and Box 6 below, instead of Box 3 and Box 4. Again, I shall draw 10 tickets at random with replacement, but this time I will compute the sample sum of the draws. I want to use the value of the sample sum to draw a conclusion about whether the box is Box 5 or Box 6.

Box 5

0

1

1

1

1

1

Box 6

0

0

0

0

0

1

Whether the box is Box 5 or Box 6, the sample sum of 10 independent random draws could be 0, 1, 2, … , or 10. However, if the sample sum turns out to be 9, it is much more plausible that the box is Box 5 than that it is Box 6, because the chance that the sample sum is 9 is much larger if the box is Box 5 than if it is Box 6. It would be reasonable to decide that if the sample sum turns out to be 9, the box is Box 5. Similarly, if the sample sum turns out to be 1, it is much more plausible that the box is Box 6 than that it is Box 5, because the chance that the sample sum is 1 is much larger if the box is Box 6 than if the box is Box 5. It would be reasonable to decide that if the sample sum turns out to be 1, I am drawing from Box 6.

This thought experiment suggests the following decision rule for the "Let's Make a Deal" problem: Suppose that the sample sum of 50 random draws with replacement from the box turns out to be k. If the probability that the sample sum of 50 random draws with replacement from Box 1 is k is larger than the probability that the sample sum of 50 random draws with replacement from Box 2 is k, conclude that the box is Box 1. Conversely, if the probability that the sample sum of 50 random draws with replacement from Box 2 is k is larger than the probability that the sample sum of 50 random draws with replacement from Box 1 is k, conclude that the box is Box 2. Equivalently, if the ratio

P(sample sum = k in 50 draws from Box 1)
------------------------------------------------------------ > 1,
P(sample sum = k in 50 draws from Box 2)

conclude that the box is Box 1; if the ratio is less than one, conclude that the box is Box 2. (If the ratio equals 1 exactly, we could toss a coin to make the decision.)

Let's look at the ratio between the chance that the sample sum is k if the box is Box 1 and the chance that the sample sum is k if the box is Box 2:

P(sample sum = k in 50 draws from Box 1) 50Ck(1/2)50 (1/2)50
-------------------------------------------------- = ---------------------------- = ---------------------------- =
P(sample sum = k in 50 draws from Box 2) 50Ck(2/3)k(1/3)50-k (2/3)k(1/3)50-k
(1/2)50 (3/2)50
--------------- = --------------- .
2k(1/3)50 2k

The numerator is a number greater than 1, and the denominator grows with k, so the ratio decreases with k. The ratio is largest for k = 0, when it is (3/2)50 = 6.38×108, and is smallest for k = 50, when it is (3/4)50 = 5.66×10-7. For small values of k the ratio is larger than 1 and for large values of k it is less than 1. It crosses 1 at 50(log2(3) - 1) = 29.24. That is, for k = 0, 1, 2, … , 29, the chance that the sample sum is k is larger if the box is Box 1 than if the box is Box 2, and for k = 30, 31, … , 50, the chance that the sample sum is k is larger if the box is Box 2 than if the box is Box 1.

Verify that this is correct by using to calculate the probabilities that the sample sum is 28, 29, and 30 for a binomial distribution with n = 50 and p = 50%, and for a binomial distribution with n = 50 and p = 66.67%. Begin by making sure that n is set to 50. Set Area from to 27.5 (either by deleting the number in the textbox and typing in 27.5, or by using the scrollbar), and set to to 28.5. The probability histogram bin centered at 28 should be the only yellow bin. Set p(%) to 50 and note selected area; it should be 7.9%. Reset p(%) to 66.67 and note selected area; it should be 3.3%. This shows that the probability that the sample sum of 50 random draws with replacement from Box 1 equals 28 is 7.9%, while the probability that the sample sum of 50 draws with replacement from Box 2 equals 28 is only 3.3%.

Set p(%) back to 50. Set Area from text box to 28.5 and the to text box to 29.5 to highlight just the bin centered at 29. Selected area should be 6%. Change p(%) to 66.67; selected area should be 5%: The probability that the sample sum of 50 random draws with replacement from Box 1 equals 29 is 6%, and the probability that the sample sum of 50 random draws with replacement from Box 2 equals 28 is 5%.

Highlight the bin centered at 30 and repeat the two calculations. You should find that the probability that the sample sum of 50 random draws with replacement from Box 1 equals 30 is 4.2%, and the probability that the sample sum of 50 random draws with replacement from Box 2 equals 30 is 7%.

A reasonable rule for deciding whether the box is Box 1 or Box 2 is to conclude that the box is the box for which the observed result is more likely. That is, we might reasonably adopt the decision rule "conclude we are drawing from Box 1 if the sample sum is less than 30; conclude we are drawing from Box 2 if the sample sum is 30 or more."

That rule will sometimes lead to the wrong conclusion: whether we are drawing from Box 1 or from Box 2, the sample sum is random and has possible values 0, 1, 2, … , 50, so there is a chance that if the box is Box 1, the sample sum will be 30 or more, and we will conclude erroneously that the box is Box 2. Similarly, if the box is Box 2, there is a chance that the sample sum will be 29 or less, and we will conclude erroneously that the box is Box 1.

What are those chances? We can find them using the binomial probability histogram. The chance we incorrectly conclude that the box is Box 2 when the box is in fact Box 1 is the chance that the sample sum is 30 or more if the box is Box 1. shows that the area of the binomial probability histogram with n = 50 and p = 50% between 29.5 and 50.5 is 10.1%:

Conversely, the chance we incorrectly conclude that we are drawing from Box 1 when we are really drawing from Box 2 is the chance that the sample sum is 29 or less if we are drawing from Box 2. That is the area of the binomial probability histogram with n = 50 and p = 66.67%, from -0.5 to 29.5, which is 12.6%, as shown in .

The chance we err using this approach is thus at most 12.6%, if the only possibilities are that we are drawing from Box 1 or Box 2. Of course, if the probability of winning by switching is neither 1/2 nor 2/3, this rule can never give the right conclusion, so it is not a substitute for the kind of reasoning we explored in

Now let's apply this rule to try to determine empirically whether switching is a better strategy than sticking with the original guess.

Here, again, is the game:

click to reveal contents click to reveal contents click to reveal contents

Play the game 50 times, switching each time. Keep track of the number of times you win by switching. What do you conclude?

The following exercise tests your ability to generalize the probability calculations we have just performed.

The rule we have explored in this chapter—pick the model for which the probability of the data is larger—generalizes to situations where there are more than two models, even an infinite number of models. In the general case, it is called maximum likelihood. The likelihood of a model is the probability that the experiment would result in the observed data if that model is true. The maximum likelihood method picks the model for which the likelihood is largest.

Summary

Some experiments can be modeled as drawing tickets at random from a box of numbered tickets. This analogy is called a box model. For example, a box model for the number of times a fair coin lands heads in 10 independent tosses is the sample sum of the numbers on the tickets in 10 random draws with replacement from a box that contains one ticket labeled "1" and one ticket labeled "0."

If one repeats an experiment over and over again, independently, the Law of Large Numbers says that the fraction of times each possible outcome occurs is increasingly likely to be close to the probability of the outcome. Thus if an experiment has numerical outcomes, the histogram of outcomes in repeated experiments will tend to stabilize, getting ever closer to the probability histogram of the experiment. The area of each bin in a probability histogram is the probability that the outcome is in the bin, much as the area of each bin in a histogram is the relative frequency of data in the bin.

In repeated trials the sample sum of n random draws with replacement from a box of tickets of which a fraction p are labeled "1" and a fraction (1 − p) are labeled "0" has a binomial probability distribution with parameters n and p. For such an experiment, the chance that the sample sum equals k is

nCk×pk × (1-p)n-k, for k=0, 1, 2, … , n.

If the number n of draws is not fixed in advance, if the draws are not independent, if the fraction p of tickets in the box labeled "1" varies for different draws, or if the box contains tickets with labels other than "0" and "1," the sample sum does not have a binomial distribution.

Some scientific questions can be posed as decisions among competing box models for a phenomenon. One way to use data to decide among models is to conclude that the model that explains the data best—that is, the model for which the probability of the observed data would be highest—is correct. This is called maximum likelihood. Maximum likelihood generally is fallible: There is a chance that it will come to the wrong conclusion; that chance depends on which of the models is correct. If none of the models is correct, it always reaches the wrong conclusion.

Key Terms