Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#5. You can find 20 RANDOM NUMBERS in a Table or you can generate them with soft

ID: 3297177 • Letter: #

Question

#5. You can find 20 RANDOM NUMBERS in a Table or you can generate them with software like Excel. The Excel functions are “RAND” and “RANDBETWEEN”. With “Randbetween” you simply input how many numbers you want, the number of digits you want in your random number and the range of values you want those numbers to fall between. For example you may want twenty, 2-digit numbers that fall between 00 and 100 (like “34”).

TWO CONSIDERATIONS: (1) You must systematically use the random numbers in the Table or the ones generated. You don’t “skip around” because that could un-randomize the values. (2) Let’s say you want 1000 names from a 50 page phone book. You reach the end of the book with your systematic selection and only have 800 names. What do you do? Simple: start over in the book (loop). For example, if you were selecting names from every 15th page and you reached the end of the book after only 8 pages, then start over on page 7 of the same book.

One source of random numbers is the Greek symbol “” and its numerical value used in geometry is 3.141592653589793238462643383. . . (ignore the decimal between 3 and 1) and you have THIS string of random numbers: 3141592653589793238462643383.

USE THIS STRING (and loop it) to generate twenty, 3-digit (e.g. 314) random numbers AND EXPLAIN how you did it.

FYI: the number used in geometry, as in the AREA of a circle = r2 , is a random number in that the numbers never repeat:   = 3.141592653589793238462643383 . . . (If you want a million decimal places check out:   www.piday.org/million )

FYI: the number used in geometry, as in the AREA of a circle = r2 , is a random number in that the numbers never repeat:   = 3.141592653589793238462643383 . . . (If you want a million decimal places check out:   www.piday.org/million )

Explanation / Answer

One policy to generate 20 random numbers from the given string 3141592653589793238462643383 is

Choose randomly one starting digit from the string as the seed orstarting number. Now take consecutive 3 digits at a time as a 3-digit random number. Keep this process on upto the end of string, as much it is possible to select 3 consecutive numbers. As the sequence is assumed to be random that means each of the digit occuring in their respective places are equally probable. So, this procedures also ensures that selection of the consecutive 3 digit numbers, are also equally probable. Now, When you come to the end of the sequence/string with a left over of 0 or 1 or 2 digits, we start repeating the procedure from next number of the previously chosen seed. Reapeat it untill we get 20 numbers.

Say for eg, randomly we chosen the 6th digit of the string that is '9'.
So, the random 3-digit numbers are 926,535,897,932,384,626,433, and we come to the end of the sequence with left over 2 digits 8 and 3. So, we start the same procedure from the seventh digit '2' and get
265,358,979,323,846,264,338 and at the end of the string left digit is 3. Already we got 14 numbers, So for the rest 6 numbers we repeat the same procedure from 8-th digit '6' and get, 653,589,793,238,462,643.


Run Test for checking randomness of sequence confirms that the hypothesis that our chosen 20 numbers are random is true (p-value=0.3581). We used R-software and package 'randtests' to perform the test. Code is given below.

#######################
y=c(926,535,897,932,384,626,433,265,358,979,323,846,264,338,653,589,793,238,462,643)
require(randtests)
runs.test(y)

######################