We digress now to discuss our use of the terms randomly and probability men- tioned above.
We start with the concept of probability. In Australia, there is a famous (and illegal1) game called two-up. Two coins are taken and bets are placed on whether the coins, when tossed, will both fall same side up. If we agree that one side of the coin is labeled the head, the other the tail, then bets are placed on whether the coins will fall both heads up (side bets on other combinations are possible). If we assume that the coins are ‘fair’ (a moot point in illegal games), then the probability that the coins both fall heads up is 14. This does not mean that if we toss the coins four times, then on one occasion the coins will fall heads up. The idea of probability is based on an average over time. To say that the probability that the coins will fall heads up is 14means that if we toss the coins a large number of times, say 100,000 times, then we can expect that approximately one-quarter of the coin tosses will result in both coins falling heads up. Note the use of the word expect: it is possible, though extremely unlikely, that both the coins would fall heads up every single time. (The odds against this happening are inconceivably large—about 1060 000to 1.) In summary, to say that the probability is 14 means that, on average, we expect one in four coin tosses to result in a pair of heads.
Next we look at the question of what is meant by a ‘random sequence’ of numbers. There are two aspects to this problem: how do we generate a random sequence and how do we know when we have got one? Both questions are quite subtle.
How do we construct a ‘random’ sequence of whole numbers between 0 and 9, say a sequence of 100,000 such numbers? One possibility might be to ask 100,000 people to each choose one whole number between 0 and 9 and record the results. Would we get a random sequence using this method? The answer is almost surely no: numbers often have cultural associations and there likely would be a bias towards choosing certain numbers such as 3 and 7.
Turning to the question of identifying random sequences, consider the first 100 terms of the following sequence of integers lying between 0 and 9:
00507614213197969543147208121827411167512690 35532994923857868020304568527918781725888324873096446700…
There are ten 0’s, twelve 1’s, and nine 9’s in the sequence. That looks promising— we would expect roughly, but not exactly, ten occurrences of each digit between 0 and 9. We might also expect that the average of 100 randomly chosen integers between 0 and 9 should be 4.5. In fact it is 4.41 for this sequence—within 2.0%. Where did this sequence come from? If we had just written down 100 ‘random’ integers between 0 and 9, the resulting sequence would almost certainly
not appear as random as the sequence shown above. We constructed this sequence
by taking the first 100 digits of the decimal expansion of 1971 . As we mentioned in Chapter 5, since1971 is a fraction its decimal expansion eventually repeats. For
1
197, the decimal expansion consists of the first 98 terms repeated indefinitely (so
the next ten digits in the decimal expansion of 1971 will be 5076142131). Since the sequence repeats, it cannot be random. With a little bit of work, we can predict exactly what the 1010th integer in the sequence will be (it is 7). For a random sequence, the best we can do is say that the chance of the 1010th term being a 7 is 101.
So we repeat, “how can we generate numbers between 0 and 9 in a ‘random’ way?” One way of doing this would be to imagine a ten-sided fair die, with each side marked with a whole number between 0 and 9. We then generate random numbers between 0 and 9 by successively tossing the die and taking the upmost number on the die. After many tosses, we would expect that each number should appear approximately the same number of times. Otherwise said, the probability of a given number between 0 and 9 appearing uppermost should be 101th.
Even though this method is not practical, it does give a rough idea of what a random sequence should be. It should be as random as the sequence of heads and tails we get when we toss a fair coin. In practice, sequences of random numbers are generated on a computer using what is called a pseudo- random number generator. This produces a sequence which looks random but eventually—after very many iterations—will repeat. A little bit like looking at the decimal expansion of p1, where p is a very large prime number.
All of this seems like a lot of trouble to go to in order to construct and identify random sequences of numbers. It turns out that random sequences have many important and powerful applications in computing, mathematics, and statistics—for example, in polling and trialing new drugs where it is important to get good ‘random’ samples. In summary,
The generation of random numbers is too important to be left to chance.
In the case of the Sierpi´nski triangle, we choose a sequence of random numbers chosen from 1, 2, 3. If we choose 1, we select the vertex A, 2 the vertex
B, and 3 the vertex C. On average, in this way, we will choose the vertices A, B, and C approximately the same number of times. We can imagine, however, that it might happen that we choose the vertex B on each iterate. Then the resulting figure (after transients have been ignored) will be precisely the vertex B, not the Sierpi´nski triangle. When we say that the probability is one that the Sierpi´nski triangle will appear on the screen, we are implicitly claiming that the probability that vertex B will always be chosen is very small.
Indeed, we are saying more. Suppose that we call a sequence of vertices a bad sequence if it leads to a figure other than the Sierpi´nski triangle. Then we are asserting that if the vertices are chosen at random, there is virtually no chance that a bad sequence will actually be chosen. Since there are many bad sequences—an infinite number of them—how is this possible?