## Suffolkmaths.co.uk

Random Numbers
In Section 1.1.1 we discussed the lottery method for randomly selecting a random number between 1 and N . In our description, we sampled withoutreplacement . When a labeled ball was drawn out of the barrel it was notreplaced before the next ball was drawn. We sometimes also sample withreplacement . Each time a ball is drawn, the number on that ball is noted andthe ball replaced before remixing and drawing the next ball. In this way thesame random number can occur two or even more times. This idea will beimportant in our discussion of random numbers. Of course, in surveys, wealways sample without replacement because there is no point in interviewingthe same person twice.
1 Random number tables
The lottery method is a clumsy physical process for choosing random sam- ples. Often it is convenient to use a ready-made table of random numbers. Arandom number table is a table of digits. The digit given in each position inthe table was originally chosen randomly from the digits 1, 2, 3, 4, 5, 6, 7, 8, 9, 0by a random process in which each digit is equally likely to be chosen. A pos-sible mechanism for doing this is the lottery method with replacement usingten labeled balls. Table 1 gives part of such a table: another part is given inthe Appendix A1 of the text. The digits are often grouped in fives as shownhere. The frequencies with which each digit occurs in the fifty digits of Table1 are given in Table 2. Thus, the digit “1” appears in Table 1 five times, thedigit “2” appears seven times, “3” appears four times, etc.
Frequency of Occurrence of Each Digit in Table 1 We will now learn to use the tables to accomplish a few small tasks.
Example 1.
First we will randomly sample 4 people (or labels) from 8 so we need 4 random digits without replacement from 1, 2, 3, . . . , 8. We simplyread off random digits ignoring those that are out of range or recur (we are sampling without replacement) until we get four of them. Going from left toright across the top row of Table 1 we get (Here, we have placed square brackets around numbers that are repeats ofpreviously appearing numbers or are out of range.) Taking the first four usablenumbers we get 1, 2, 4, 6 and the random sample consists of the individualswith those labels.
Example 2.
We now wish to sample 6 individuals from 60 (labeled 1 to 60). We continue taking pairs, ignoring repetitions and those out of range,until we have 6 of them. Beginning from the left of the top row of Table 1and taking the digits in pairs, we get and we take the individuals labeled 12, 42, 35, 27, 60, and 15.
Example 3.
Consider an agricultural experiment to compare four treat- ments (e.g. fertilizers) laid out in 3 blocks of land each containing 4 plots.
For each block of land we want to randomly allocate one of each of the fourtreatments to a plot. This is called a randomized block design. To do this wewant to find a random ordering (permutation) of the numbers 1, 2, 3, 4, repre-senting treatments to apply to the plots in a block. Again we will work acrossrows and ignore numbers outside the range 1 to 4 and repetitions within ablock to obtain: Our three permutations are (1, 2, 4, 3), (2, 4, 1, 3) and (2, 3, 4, 1). Using “treat.”to abbreviate treatment, the plot layout might look like: Any systematic fertility trend from left to right is counteracted somewhat bythe random ordering of treatments.
Example 4.
We can use the tables to simulate the tossing of a “fair” coin.
If we denote the digits 1, 2, 3, 4, 5 as being heads (H) and the digits 6, 7, 8, 9, 0 as being tails (T ), at each “toss” we are equally likely to get a head or a tail.
Let us “toss” 21 times and use the second row of our table this time. Then3 = H, 2 = H, 8 = T , 3 = H, etc. The whole sequence of twenty one tossesis: H T H H H T H H H T T H T T H T H T H T H. The following is a real sequence of 21 tosses: T T H T T H H H H H H T H T H T T T H H H. Sometimes with actual random sequences, as here, you get what looks liketoo long a run of heads or tails. When this type of behavior occurs withan artificially constructed sequence one might suspect the randomness of therandom number table. For truly random numbers, the choice of a digit shouldnot be affected by what is chosen previously. There are statistical tests forchecking whether the lengths of run are consistent with random behavior.
Warning:
One shouldn’t keep using the same part of a random number table over and over again as we have been doing. We should use a large tableand find the starting point randomly, even if only by the “look away and sticka pin in it” method.
2 Pseudo-random numbers
It should be clear from the examples in Section 1 that it is not the lot- tery method of producing the numbers that matters but the properties of thenumbers produced. They should have the properties we would expect “ran-dom” numbers to have. For example, we would like the numbers to satisfya wide range of criteria such as approximately equal frequencies of the digitstaken one at a time, two at a time etc. Also, the frequency of the lengths ofruns like those in a heads/tails sequence should be “reasonable”. “Random”numbers produced on a computer or calculator are not random at all. Theyare generated using a formula, so that the sequence produced is actually pre-determined. For this reason they are more properly called pseudo-randomnumbers. However, the methods for producing them can be tuned so thatthey appear random in any way you care to view them. In particular, overa long sequence, each number (or pair or triple of numbers) appears approx-imately equally often. Many random number generators produce a decimalnumber between zero and one. How do we turn this into an integer between1 and N for sample selection as in Section 1? If u is the random numberproduced by your calculator, compute and use the portion of the answer to the left of the decimal point.1 Youcan now produce a stream of pseudo-random numbers. For sampling withoutreplacement ignore repeated values.
Exercises
1. Simulate the experiment of tossing a drawing pin (thumb tack) in which
the two outcomes “point up” and “point down” occur with probability 0.6and 0.4 respectively. Perform 15 “tosses”.
2. Consider an experiment in which patients attend a clinic for ankylosing
spondilitis (a form of arthritis). You want to compare four treatments,namely aspirin at a given dose, indocid at a given dose and naprosyn attwo different levels of dosage. Show how to use Table 1.5.1 to randomlyassign each incoming patient to one of the four treatments.
3. Suppose there are 100 sets of accounts and 20 of these contain fraudulent
transactions. Simulate the sampling of 10 sets of accounts one at a timewithout replacement, noting whether or not each set contains a fraudulenttransaction. How many fraudulent sets of accounts did you find? 4. Given an 8 × 8 grid of 64 square plots, use the random numbers to select
6 of the plots at random without replacement.
1For example if N = 500 and u = 0.2134, then i = 1 + 0.2143 × 500 = 108.15 so that ourrandom number between 1 and 500 is 108. [Note: u should never be exactly zero or onebut if it is to the precision of your calculator then u = 0 should become a random numberof 1 and u = 1 should become N . Also u needs to be recorded to many more significantfigures than N .]

Source: http://www.suffolkmaths.co.uk/pages/Top%20Activities/Teaching%20Techniques/Handling%20Data/Data%20Sets/Resources/3%20Using%20Random%20Number%20Tables.pdf

### 24 hour profiles

THE VALUE OF 24 HOUR PROFILES IN CONGENITAL ADRENAL Kathy Geertsma and Peter Hindmarsh Having participated in discussions on several message boards regarding what I have learnt through my son having 24 hour profiles, many people have contacted me with questions. This prompted me to ask his Professor, Peter Hindmarsh of Great Ormond Street Hospital, London, to explain the benefits of havi

### Sa umt meeting

HPR I Substance Abuse Regional Access Team Meeting Minutes February 9, 2011 Attending were: Nancy Haden, NWCSB; Christy Cacciapaglia, Alan Cale, WSH; Mary Montgomery, Jim Clark, Mary Schlimm, Region Ten; Tracy Koblish, HRCSB; Debra McPhee, RACSB; Jackie Dare, Jan Lizotte, RRCSB; and Paul Regan, HPR I. Review Agenda / Approve Minutes: No agenda change. The Minutes fro