Question

Generate at least 20 random numbers within the range of 1 to 900 using linear congruent...

Generate at least 20 random numbers within the range of 1 to 900 using linear congruent method. Xi = (aXo + C) mod m using a = 87, c = 29 and Xo = 19

Homework Answers

Answer #1

Using the linear congruence Xi = (aXo + C) mod m, we want to generate random numbers 1 to 900, so we can take m = 901 so that maximum remainder can be 900.  (using a = 87, c = 29 and Xo = 19)

X1 = (87*19 + 29) mod 901 or X1 = 781
X2 = (87*781 + 29) mod 901 or X2 = 401
X3 = (87*401 + 29) mod 901 or X3 = 678
X4 = (87*678 + 29) mod 901 or X3 = 450
X5 = (87*450 + 29) mod 901 or X3 = 436 and so on.
The first 20 generated random numbers are:

781, 401, 678, 450, 436, 119, 471, 461, 492, 486, 865, 501, 368, 510, 250, 155, 900, 843, 389, 535.

Know the answer?
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
Similar Questions
1) Consider a linear congruential random number generator with parameters a = 35, c = 20...
1) Consider a linear congruential random number generator with parameters a = 35, c = 20 and m = 100. a- Generate 5 random numbers by using this method. Use 84. b- By using inverse transform method, generate 2 random variate for an exponential distribution with parameter λ = 0.5. Use the first two random numbers you generated in part a.
Using a for loop and range command, print the sequence of numbers from 1 to 20...
Using a for loop and range command, print the sequence of numbers from 1 to 20 (skipping two numbers for each element); that is, your code should print out the numbers 1,4, 7, 10, … (max should not exceed 20). Use x as the variable name
#5. You can find 20 RANDOM NUMBERS in a Table or you can generate them with...
#5. You can find 20 RANDOM NUMBERS in a Table or you can generate them with software like Excel. The Excel functions are “RAND” and “RANDBETWEEN”. With “Randbetween” you simply input how many numbers you want, the number of digits you want in your random number and the range of values you want those numbers to fall between. For example you may want twenty, 2-digit numbers that fall between 00 and 100 (like “34”). TWO CONSIDERATIONS: (1) You must systematically...
(1) Use ‘sample’ function to generate a vector of 100 random numbers that follows a multinomial...
(1) Use ‘sample’ function to generate a vector of 100 random numbers that follows a multinomial distribution with probability (0.1, 0.15, 0.3, 0.45). (2) Without using the ‘sample’ function, generate a vector of 100 random numbers that follows a multinomial distribution with probability (0.1, 0.15, 0.3, 0.45). (3) Calculate the probability for 2.5 < X < 9 in a Poisson distribution with the mean 6. (using R)
1.) Generate an array of 10 random numbers between 1 - 100 2.) Copy the array...
1.) Generate an array of 10 random numbers between 1 - 100 2.) Copy the array to a temp array 3.) Call each of the methods to sort (bubble, selection, insertion, quick, merge), passing it the array 4.) In-between the calls, you are going to refresh the array to the original numbers. 5.) Inside of each sorting method, you are going to obtain the nanoseconds time, before and after the method Subtract the before time from the after time to...
Using R, generate 10,000 random values of weibull (using alpha= 1, beta = 4) and plot...
Using R, generate 10,000 random values of weibull (using alpha= 1, beta = 4) and plot the estimated pdf and cdf. b) use the random values to find the probability that X is between 0.2 and 0.8 and calculate and compare this to the truth. c) use the tandom values to estimate Q1, M, and Q3 and compare these.
using any programming language (typed so i can read) Generate a random sequence of length N...
using any programming language (typed so i can read) Generate a random sequence of length N = 500 from a uniform distribution. Using histograms with bin numbers M = 5, 7, 9, 11 and 13 bins, verify experimentally that the error in computed entropy e = Htheoretical – Hobserved varies linearly with the ratio (M – 1) / (2N).
Generate 100 random numbers using the RAND function and create a frequency distribution and a histogram...
Generate 100 random numbers using the RAND function and create a frequency distribution and a histogram with bins of width 0.1. Apply the chi-square goodness of fit test (see Chapter 5) to test the hypothesis that the data are uniformly distributed. This question is from Business Analytics 3rd Edition by James R Evans and from Chapter 12 and question 1 The question is from following book and from Chapter 12 question 1 Textbook: James Evans, Business Analytics, 3nd edition, 2019,...
USING MATLAB: 1. Assume Y is an exponential random variable with rate parameter λ=2. (1) Generate...
USING MATLAB: 1. Assume Y is an exponential random variable with rate parameter λ=2. (1) Generate 1000 samples from this exponential distribution using inverse transform method (2) Compare the histogram of your samples with the true density of Y.
These numbers have been drawn from a uniform distribution with range 1-40. 4, 6, 16, 12,...
These numbers have been drawn from a uniform distribution with range 1-40. 4, 6, 16, 12, 23, 19, 16 26, 14, 12, 12, 10, 3, 26, 35, 8, 30, 11, 14, 34, 37, 16, 36, 30, 18, 39, 24, 18, 39, 5, 12, 28, 4, 12, 34, 16, 35, 27, 15, 1 Test the sample for randomness using: a graphical method.