Starting from:

$30

Engineering-Computation-Homework 3 Solved

1.      Analyze your LCG from Homework 2. Find the mean after the first  

a.      100 random numbers,

b.     10,000 random numbers,

c.      1,000,000 random numbers,

d.     100,000,000 random numbers.

Comment on the result. If it was a perfect pseudorandom number generator what would the mean be?

2.      Create 100 equidistant bins between 0 and 1 and map each random number to its bin. Graph the histogram of how many random numbers were tallied to each bin after  

a.      100 random numbers,

b.     10,000 random numbers,

c.      1,000,000 random numbers,

d.     100,000,000 random numbers.

Comment on your result. If it was a perfect pseudorandom number generator what would your graph look like? (You may use Excel or Google Sheets or any other program you’d like for the graph, by printing the 100 bin tallies to the screen and copying them in—or some other method.)

3.      Find the period of your LCG.

4.      (Graduate Students only) Use a multiplier of 60 and find the period and explain​     what happens. Use a multiplier of 62 and find the period and explain what happens. Explain why even multipliers are never used in LCGs.

 

Attach your source code, screenshots of output, graphs, and header (if used) files.

More products