The box model, popularised by Freedman, Pisani, and Purves (1978), is a conceptual tool used in statistics to represent chance processes involving
random draws. The 'box' contains tickets, each labelled with a possible outcome of a single trial. By imagining drawing tickets at random (with or
without replacement), the model helps us simulate and understand the behaviour of random processes.
This may seem quite abstract, so in this page, we will break down the box model through the lens of flipping a coin. We know that if you flip one coin,
that is, we perform one trial of flipping a coin, the coin will land on either a 'head' or a 'tail' (see the box part in the model to the right). Hence,
inside the box, we would place two tickets, a 'head' ticket, and a 'tail' ticket. You can think of the box as the population of all possible outcomes of
a single trial (in this case, the trial is flipping a coin).
A sample is where we do more than one trial. For example, if we were flipping a coin, you would flip it multiple times — say, 5 flips — and record
the outcome each time. In terms of the box model, this is like drawing 5 tickets at random from the box (with replacement), where each ticket represents
either a head or a tail.
Why use the box model? As we will soon see, it helps us reason about random variation, expected values, and the role of chance in statistics. In particular,
when learning about different hypothesis tests on this website, where it makes conceptual sense, the hypothesis test will be motivated through the lens of the box model. The goal with
this is to develop your conceptual understanding of the hypothesis tests we study. However, it is still possible to engage with most of the content in this
web app without understanding/studying the box model!
For the example we are using in this section, consider that our sample involves flipping a coin 5 times and recording the number of heads and tails
observed. We could think of our sample as 1 experiment with 5 trials, that is, 5 flips of a coin.
For example, in one experiment, we might find that after 5 coin flips, we see 3 heads and 2 tails (HHHTT). Perhaps in the next experiment, we got
really lucky and had 5 heads (HHHHH).
Instead of thinking about this as coin flips, another way of thinking about this is that we have a cardboard box with two tickets in it, a 'H' ticket,
and a 'T' ticket. Then, the experiment is drawing a ticket from the box, recording whether we saw a 'H' or 'T', placing the ticket back into the box,
and then repeating the process until we have drawn from the box 5 times (assuming we are doing 5 trials). This is what we mean by the box model
representing a chance process. Each experiment is itself the result of random draws from the box.
Your turn! In the section to the right, you can simulate taking different samples from the box model that we just
described. Just keep clicking on the "+ SIMULATE" button to draw a new sample. Remember, each yellow box represents a different sample!
Press 'Simulate' to do 1 experiment of the box-model below.
Using the same box model from before, let's consider that after our experiment, we observed the sample:
An issue that we will run into is that 'H' and 'T' are not numbers. Ideally, we would like to summarise our sample using a single
number, without having to specify the number of heads and tails individually.
Because of this, let’s change the tickets in our box to the numbers '1' and '0'. We can say that the number '1' represents drawing a head, and the
number '0' represents drawing a tail. Under the same example as before, that means we drew 2 x '1' tickets and 3 x '0' tickets:
Now that the tickets are numeric, we can model the sample using the sum or the mean:
In practice, it doesn’t matter whether we model the sample using the sum or mean, as long as we are consistent throughout.
Your turn! In the section to the right, you can simulate taking different samples from the
box model with numeric tickets. You can choose whether you summarise the samples using the sum or the mean. What changes when we model using the sum or mean? Experiment
to find out!
Press 'Simulate' to do 1 experiment of the box-model below.
The example box model that we have been using so far was flipping a coin 5 times, but you can create any box model that you want!
For example, we might be interested in modelling the number of times a die lands on the '1' face after 20 rolls of a die. If interested in that example,
you would have one '1' ticket in the box, and five '0' tickets (to account for the other five sides on the die).
Below you can experiment with making your own box model and then generating samples from it. This time, we will not show you the actual tickets that were
drawn for each sample, but rather the sum or mean of the tickets (depending on whether you are modelling the sample using the mean or sum).
Your turn! Experiment with different boxes and number of draws.
First, we need to specify the tickets that we will be adding to the box.
In the text box below, enter the tickets that you wish to place into the box. Only numbers can be added, and each ticket should be seperated by a comma. For example, if you want to have 1x1 ticket and 6x0 tickets in the box, enter 1,0,0,0,0,0.
Error: One or move values that you added cannot be interpreted. Please carefully check what you entered. You must enter at least 2 valid tickets. Setting contents of the box to 1,0,0,0.
Second, we need to specify the number of draws (with replacement) that we will be taking from the box:
Error: The value for the 'number of draws' must be an integer greater than or equal to 1. Setting value to 25 until the error is resolved.
Press 'Simulate' to do 1 experiment of the box-model below.