Pseudo-random numbers are pervasive and extremely important in modern computing
ID: 3590061 • Letter: P
Question
Pseudo-random numbers are pervasive and extremely important in modern computing and scientific applications. But how exactly is a sequence of apparently random number generated? Here we study one early method which has the benefit of being very easy to implement 1. If we take a positive integer n having k digits (k 1), then n 10*, so that n2 (10)2 02. Thus we would expt up to 2k digits in the square of the k digit number 1l So, for k specifically 4, if we square the 4 digit numbern, we would expect how many digits in 10517049, what are the "middle 4" digits of n"? 1545049. In this case, n2 doesn't have a "middle 4" digits. 2. Consider n = 3243, so that n2 3. Consider n 1243, so that n2 However, if we add zeros to the left, we can extend the length of n2 ui i's possible to identify the middle 4 digits. So writing n2 01545049, we now have 5450 as the middle 4 digits. How would we write 9982 so that we could identify the middle 4 digits? To generate a sequence of N pseudo-random nun 1. Fix a seed value no 2. For i 21, define n to be the middle 4 digits from n1 (where n?, has been left-padded with zeros, if necessary) 3. Repeat step 2 until i N-1. The sequence o,1,2, N1 will then be your N pseudo-random numbers Starting with o 3243, the first 4 numbers generated by this algorithm are 3243, 5170, 7289, 1295, Find the next 6 numbers in this pseudo-random sequence. 5. One really good question is "How random are these so-called random numbers?" There are various test for randomness (which require a bit of background and development) However one straightforward measure is to look at cycle length: how many different numbers do you get from a particular seed before you return to an earlier nmber (and hence repeat) Compare the results of no·3243, no 5030, and no 3792Explanation / Answer
a) As n2 = 102k , if k =4, them the equation becomes as: n2 = 102 * 4
: n2 = 108
: n2 = 100000000, i.e., 9 digits.
b) 5170
c) The value of 9982 = 996004 and it has 9600 as its middle 4 digits. So, no need of left-padding with zeroes.
d) The square of 1295 is 1677025, so using left-padding of zeros our result becomes: 01677025, which 6770 as middle 4 digits.
Similarly, we can write remaining numbers, which are : 8329, 3722, 8532, 7950, 2025.
AS PER THE CHEGG GUIDELINES, I HAVE ANSWERED FIRST FOUR QUESTIONS, EVEN IF THE ANSWER OF 5th IS IMPORTANT FOR YOU, I WILL DO THAT TOO.
THANK YOU.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.