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

  Reviewing and reporting microsoft security procedures

For every operating system, review the securities procedure involving, password protection, user account setting, files and folders privacy, and the network protection (this may not be a part of the operating system)

  Make a modularized body mass index

build a modularized Body Mass Index (BMI) Program which will calculate the BMI of a team player.

  Modify the implementations of the classes in the atm

Modify the implementations of the classes in the ATM example so that the bank manages a collection of bank accounts and a separate collection of customers. Allow joint accounts in which some accounts can have more than one customer.

  Determine technology which has changed cafe,coffee shop

Determine technology which has changed cafe,coffee shop? Think things such as marketing, food preparation, inventory ordering or re-ordering, customer tracking, and more.

  Write down a c function named liquid()

make a C function named liquid() that is to accept an integer number and the addresses of the variables gallons, quarts, pints, and cups. The passed integer represents total number of cups, and the function is to determine the number of gallons, q..

  How to produce a work breakdown structure

How to produce a Work Breakdown Structure. Ensure main WBS tasks headings are the 5 PMBOK® process areas.

  What concerns may be faced with a decision

The earliest LANs used coaxial cable as the transmission medium. Over time, unshielded twisted pair (UTP) wiring emerged as a better and faster medium. Wireless (RF) LANs are emerging as cheaper and faster alternatives to UTP.

  Fixing errors in software to control the security

While reading the code top-down, we always try to use our expectations regarding the application domain in order to predict what major functional elements of the code will be.

  Make a template for a function called sum

Write down a template for a function called sum. The function should compute and return the sum of values passed in an array. Another argument send into the function should be the array length.

  How to compare and evaluate speeds of dsl and cable modem

How to compare and evaluate speeds of DSL and cable modem Make a diagram of the DSL and Cable Modem connections to your ISP, cable organization, and telecom to your home router using Visio or its open source another software.

  Program requests the name of food and number of calories

The council suggest that at most 30% of the calories in our diet come from fat. however food labels give the number of calories and amount of fat per serving, they often do not give percentage of calories from fat.

  What are the xml databases

What is data warehousing? How are databases and data warehousing related? Do you believe data warehousing is a fad or a "real" technology that would benefit organizations?

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