Pseudo-random numbers are pervasive and extremely important in modern computing
ID: 3328759 • 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 21), then n10*, so that n2 (10)2 102. Thus we would exp 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 2. Consider n = 3243, so that n2-10517049, what are the "middle 4" digits of n2? 3. Consider n = 1243, so that n2-1545049. In this case, n2 doesn't have a "middle 4" digits. However, if we add zeros to the left, we can extend the length of n2 ul 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 seq uence of N pseudo-random numbers: 1. Fix a seed value no 2. For i1, define n to be the middle 4 digits from n- (where n-1 has been left-padded with zeros, if necessary). 3. Repeat step 2 until i N-1. The sequence no,n1,n2N will then be your N pseudo-random numbers Starting with no = 3243, the first 4 numbers generated by this algorithm are 3243, 5170, 7289, 1295, Find the next 6 n umbers 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
SOlving queston 1
1) We can expect 2k digits that is upto 8 digits in the square of the number. Specifically number greater than 3163 will give 8 digits and lower than 3163 will give 7 digits.
2) middle 4 digits of n^2 are 5170
3) 998^2 = 996004. Middle 4 digits are 9600
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.