Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Previous sections have simulated events in which each event had the same probability of occurrence. For tossing a coin, the probability of either side appearing is 1/2; for rolling a single six-sided die, the probability of any face appearing is 1/6. These are examples of random sampling with equal probability.
However, sometimes the probability that is associated with one event is greater than the probability of another event. For example, suppose that there are ten socks in a drawer: five are black, two are brown, and three are white. If you draw a sock at random, the probability of the sock being black is 0.5, the probability of brown is 0.2, and the probability of white is 0.3. This is an example of random sampling from the set {Black, Brown, White} with unequal probability.