Quiz
Middle Square Method
The Middle-Square Method was an early method for generating pseudo-random numbers. Follow the hyperlink to read a description of the method.
A 4-digit number is squared to produce an 8-digit number (with leading 0’s if the number would be fewer than 8-digits). The middle 4 digits of the 8-digit number become the next random number in the sequence.
Here is an example using a starting value of 1234:
1234
1234 ** 2 = 01522756
5227 ** 2 = 27321529
3215 ** 2 = 10336225
1
1
1
Middle Square Method (cont.)
Problem 1:
Use the Middle-Square method with a starting value of 1234 to produce 75 observations containing pseudo-random numbers.
Does you sequence of random numbers ever repeat (i.e., are any of the 75 numbers the same)?
Determine if the sequence ever repeats over the first 75 numbers using the following starting values:
a. 1234
b. 7704
c. 5490
2
2
2
Middle Square Method (cont.)
Problem 2:
Use the Middle-Square method with a starting values of 5073 and 6111 to produce 25 variables containing pseudo-random numbers.
Your dataset should have 2 observations (one for each of the starting values) and 25 variables.
3
3
3
/docProps/thumbnail.jpeg