Write a program to generate a series of pseudo random number

Assignment Help Computer Engineering
Reference no: EM13325027

You will write a program to generate a series of pseudo random numbers, using a linear feedback shift register method. You will start with an arbitrary number (not zero) x with a representation in n bits. If x = 15 and n = 4, then x = 1111. Then you will select a pair of bits, say bits 0 and 1, take their "xor" producing a new bit - in this case a 0. The number x will then shift to the right, with the new bit becoming the new high bit - in this case 0111. The process continues in this manner to produce a random set of bits. With four bits, we can only have up to 15 unique transitions before repetitions begin, or 2n - 1. With n = 32, the number of random bits has a much greater potential. The numbers actually produced by the "shifting" cannot be considered "random", since all but one of the bits overlap from each succeeding number. However, if we want to produce, say 100 6-bit numbers, then we need to shift the bits into an 6-bit register. We can then save its "value" in an array of 100 integers. Then we should produce the output which will display the distribution. Random numbers should follow a uniform
distribution. Using a 32-bit generator does not guarantee 2n - 1 random bits. For good results try using bit combinations 0/4, 0/7, 0/25, 0,26, 0/29.

Three random 4-bit numbers produced: 11, 13, 4, .... Try "tapping" different bit combinations, as well as the ones I suggested. To verify that the set of numbers you generated are really pseudo random, you will test them using the statistical χ2 test. You will generate 10,000 numbers in the 0-63 range. Then N=10,000 and r=64. You will then compute ∏2
by the formula

Example:
11001110 -> 11100111 -> 01110011 -> 10111001 -> 11011100 ->
11101110 -> 11110111 -> 01111011 -> 10111101 -> 01011110 -> etc

541_Assignment.png

if χ2 is in the range of r ± 2 r , we conclude that distribution is indeed random. Otherwise it may not be. In your program, you will implement a random number generator module. Then the program will request 10,000 random numbers in the range of 0-25. It will then apply the test to
see if the numbers are random. You should apply the test a number of times because it has a 1/10 chance of showing failure even when the random distribution is successfully generated.

You will implement the random number generator as a RandonGenerator C++ class. The constructor will have to initialize the seed value. Subsequent calls to the random( ) method with integer parameter range will return a random value in the range between 0 to range-1 inclusive. The tapping bits should be set by default (in the constructor)

Reference no: EM13325027

Questions Cloud

Determine the total time in the air : A projectile is fired with an initial speed of 37.8m/s at an angle of 44.7 degrees above the horizontal on a long flat firing range. Determine the total time in the air
Explain tosyl chloride and then a nucleophile : Write the structural formula of the main organic product for the following reaction between an alcohol, tosyl chloride and then a nucleophile
Correctional facilities rely heavily on offender management : Correctional facilities rely heavily on offender management and records management.
What is the velocity he must throw the grenade : A man throws a grenade from a car that is travelling at 90km/hr and wishes to throw it into a car heading in the same direction at 110km/hr
Write a program to generate a series of pseudo random number : You will write a program to generate a series of pseudo random numbers, using a linear feedback shift register method. You will start with an arbitrary number (not zero) x with a representation in n bits.
Determine calcium chloride in water : how many grams of CaCl2 are needed to make 638.2 grams of a solution that is 28.5% (m/m) calcium chloride in water
What is the length of the race in meters : A tortoise can run with a speed of 0.14 m/s, and a hare can run 20 times as fast. What is the length of the race in meters
The courts and police departments : Explain how technology in the area of computers has changed in both the courts and police departments.
Calculate how many electrons have been transferred : A capacitor has a capacitance of 2.74 10-8 F. In the charging process, electrons are removed from one plate, how many electrons have been transferred

Reviews

Write a Review

Computer Engineering Questions & Answers

  Demonstrate that the expected search time for hashing

Demonstrate that the expected search time for hashing

  Make a heading that contains the name of the software

discuss a specific virus software, its advantages and disadvantages. make a heading that contains the name of the software you are reviewing. It should be about half-page or less.

  Explain the characteristics of a high performance team

Listing and define six major SDLC phases and the products of each. Indicate the CASE tools that would be used to support each phase.

  Factors for building a server room

Explain the factors you must consider for each of the following given topics: Walls and doors, Access control

  Reverse polish notation

Transform the following numerical arithmetic expression into the reverse Polish notation and display the stack operations in order evaluate the numerical result.

  What is network architecture

what is the most popular network architecture.

  Cellular network

Calculate how many users a cell may support for a 5% call blocking rate. Suppose that each user generates 35mE of load in the busy hour.

  How to insert a row into the student table

Make yourself a student by writing and executing an INSERT statement to insert a row into the STUDENT table with data about you. Use one of the zip codes you inserted.

  Implementing the java application

Write down a Java application which enables a user to enter 10 numbers (double precision) into an array and then sorts and shows the numbers from lowest to highest.

  Interviewing for chief information officer

XYZ is interviewing candidates for position of Chief Information Officer (CIO). They are inquiring the candidates to explain briefly how they could satisfy their requirements as described above. State how would a successful candidate respond to th..

  How the project manager guard against the natural tendency

It is sometimes suggested that time estimates for I.T. project work elements should be generated primarily by those involved in carrying out the work (e.g. analysts and programmers).

  Consider the fundamentals of object oriented programming

give an accompanying illustration for each of the fundamentals(example, code sample, etc.)Note: Try to use Java and not C++ for examples.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd