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 doesnt 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 is 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 3792
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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.

Add a comment
Know the answer?
Add Answer to:
Pseudo-random numbers are pervasive and extremely important in modern computing and scientific applications. But how exactly...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Need urgently.Plz use math.random() formula for random numbers and show the output as recquired. Problem (Computer...

    Need urgently.Plz use math.random() formula for random numbers and show the output as recquired. Problem (Computer Assisted Instruction) The use of computers in education is referred to as Computer Assisted Instruction (CAI). Develop a Java application that can help an elementary school student learn division of two decimal integer numbers. When the application is launched, its behaviour should be like as described: 1. The application should welcome the learner and ask if ready to learn the topic. Assume the application...

  • Chapter 4, Section 2, Exercise 079 Thirty students are asked to choose a random number between 0 ...

    Chapter 4, Section 2, Exercise 079 Thirty students are asked to choose a random number between 0 and 9, inclusive, to create a data set of n 30 digits. If the numbers are truly random, we would expect about 3 zeros, 3 ones, 3 twos, and so on. If the data set includes 8 sevens, how unusual is that? If we look exclusively at the number of sevens, we expect the proportion of sevens to be 0.1 (since there are...

  • #include<stdio.h> #include<stdlib.h> #include <time.h> int main() { /* first you have to let the computer generate...

    #include<stdio.h> #include<stdlib.h> #include <time.h> int main() { /* first you have to let the computer generate a random number. Then it has to declare how many tries the user has for the game loop. we then need the player to enter their guess. After every guess we have to give an output of how many numbers they have in the right location and how many they have the right number. The player will keep guessing until their 10 tries are...

  • This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation...

    This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...

  • This is an assignment for my algorithm class which I have written the code partially and...

    This is an assignment for my algorithm class which I have written the code partially and only need to complete it by adding a time function that calculates the average running time. We could use any programming language we want so I am using C++. I am including the instruction and my partial code below. Thank you! Implement linearSearch(a,key) and binarySearch( a,key)functions. Part A.In this part we will calculate theaverage-case running time of each function.1.Request the user to enter a...

  • Write code for RSA encryption package rsa; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class RSA...

    Write code for RSA encryption package rsa; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class RSA {    private BigInteger phi; private BigInteger e; private BigInteger d; private BigInteger num; public static void main(String[] args) {    Scanner keyboard = new Scanner(System.in); System.out.println("Enter the message you would like to encode, using any ASCII characters: "); String input = keyboard.nextLine(); int[] ASCIIvalues = new int[input.length()]; for (int i = 0; i < input.length(); i++) { ASCIIvalues[i] = input.charAt(i); } String ASCIInumbers...

  • Lab 6 Instructions Objectives: • Executing and experimenting with programs that handle array related topics such...

    Lab 6 Instructions Objectives: • Executing and experimenting with programs that handle array related topics such as declaration, initialization, storing, retrieving, and processing elements. • Effectively manipulating and using ArrayList objects. • Becoming familiar with the use of arrays as method arguments and how array elements are passed to and returned from the called method. • Mastering the use of various debugging tools available on the Eclipse IDU. Important: EVERY one of the following Activities MUST be in a separate...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT