The Ball and Urn Model

Home

Java Applet Simulation of the ball and urn experiment


Sampling Models

An urn contains N balls numbered from 1 to N. Balls numbered 1 to R are red, and balls numbered R + 1 to N are green. Of course, R cannot exceed N.

The ball and urn experiment consists of successively drawing n balls at random from the urn and noting the number (and hence color) of the ball. We will consider two types of sampling. If the sampling is with replacement, each ball selected is returned to the urn before the next draw. In this case, the sample size n can be any positive integer. If the sampling is without replacement, selected balls are not returned to the urn. In this case, the sample size n cannot exceed the population size N.

The experiment has three parameters: the population size N, the number of red balls R, and the sample size n. We are interested in three random variables for the ball and urn experiment:

Drawing balls from an urn might seem to be a silly experiment, but urn models are actually very important and very applicable. For example, the colors of the balls serve as a metaphor for a general dichotomous population. In more realistic applications we could have a batch of electronic components that are either good or defective, or we could have a population of people who are either male or female or who are democrat or republican, or a population of a type of wildlife that are either tagged or untagged. The numbers on the balls serve to remind us that the balls are distinct, and in a more realistic application might correspond to serial numbers.

The Simulation

In the simulation of the ball and urn experiment, you can vary the three parameters (the total number of balls N, the total number of red balls R, and the sample size n) with scroll bars. When you run the experiment, the sample of balls is shown in the picture box on the left and the values of the three random variables are recorded in the table on the left. You can choose sampling with replacement or sampling without replacement from the a list box and you can select a particular random variable to display from another list box. The discrete density function and empirical density function for the selected random variable are displayed in the graph and table on the right.

Simulation Exercise 1. Run the ball and urn experiment. Vary the parameters and switch among the three random variables. Note the location, size, and shape of the density functions.

The Sample Space

We will record the outcome of the urn experiment as the random vector

X = (X1, X2, ..., Xn)

where Xi is the number of the i'th ball selected.

Thus, for this experiment, the sample space S is literally the space of all samples.

Mathematical Exercise 1. If the sampling is without replacement, show that S consists of all permutations of size n chosen from the population of size N, and that

#(S) = (N)n = N(N - 1)···(N - n + 1)

Mathematical Exercise 2. If the sampling is with replacement, show that

S = {1, 2, ..., N}n and #(S) = Nn.

In either case, our main modeling assumption is that all samples are equally likely (this is the meaning of the term random sample). Thus, X is uniformly distributed on S. By definition,

Outcome Variables

Mathematical Exercise 3. Suppose the sampling is with replacement. Show that the outcomes of the successive draws,

X1, X2, ..., Xn

are independent, and each is uniformly distributed on {1, 2, ..., N}.

Mathematical Exercise 4. Suppose the sampling is without replacement. Show that the outcomes of the successive draws

X1, X2, ..., Xn

are not independent but that each is uniformly distributed on {1, 2, ..., N}.

Mathematical Exercise 5. For either sampling method, show that the joint distribution of any sequence of k outcome variables is the same as the joint distribution of any other sequence of k outcome variables.

Thus, the sequence of outcome variables is exchangeable.

Combinations

Mathematical Exercise 6. Suppose that the sampling is without replacement and that we record the outcome instead as the unordered set (or combination)

{X1, X2, ..., Xn}

Show that this random combination is uniformly distributed on the set of all combinations of size n. Hint: For every combination of size n, there are exactly n! permutations of size n.

Mathematical Exercise 7. Show that the result of Exercise 6 is not true if the sampling is with replacement.


The Ball and Urn Experiment

PreviousNext