Question

Generate 100,000 Unif(0,1) pseudo-random numbers from the “desert island” 16807 generator. How many runs up and down did you

generator: X; = 16807X;- mod(231-1)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Set a seed for X0 = X0 = 12345678 and use the python code shown in bold below where '%' stands for modulus operator and '**' represents ^ operator:

X0= 12345678

X1 = (16807 * X0) % ((2**31 )- 1)

print(X)

The result of this python code is X1 = 1335380034.

Final Answer:

Number of runs up = X1 = 1335380034

Number of runs down = X0 = 12345678

Add a comment
Know the answer?
Add Answer to:
generator: Generate 100,000 Unif(0,1) pseudo-random numbers from the “desert island” 16807 generator. How many runs up...
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
  • a) b) Consider the linear congruential generator Xi41 = (5X; 1)mod(8). Using Xo 0, calculate the...

    a) b) Consider the linear congruential generator Xi41 = (5X; 1)mod(8). Using Xo 0, calculate the 99th pseudo-random number Ug9 16807 X-1 mod(231 - 1). Using Consider our "desert island" PRN generator, X; Xo 12345678, calculate X99. Consider the linear congruential generator Xi41 = (5X; 1)mod(8). Using Xo 0, calculate the 99th pseudo-random number Ug9 16807 X-1 mod(231 - 1). Using Consider our "desert island" PRN generator, X; Xo 12345678, calculate X99.

  • Alice is using a linear congruential generator, axi + b mod 11, to generate pseudo-random numbers....

    Alice is using a linear congruential generator, axi + b mod 11, to generate pseudo-random numbers. Eve sees three numbers in a row, 3, 5, 0, that are generated from Alice’s function. What are the values of a and b?

  • 2. Suppose you decide to randomly generate numbers from X ~ Unif (0,0). Your friend will...

    2. Suppose you decide to randomly generate numbers from X ~ Unif (0,0). Your friend will ask for n numbers and then use this information to guess what value you (secretly) chose for θ. Typically, one might use θMLE-max Xi-X, to estimate θ. Your friend, however, has meganumerophobia, and is afraid to say the maximum number in the random sample. Instead he'll say the second largest number: θ-Xn-1. Determine the bias of this estimator by carefully finding the density function...

  • 2. Suppose you decide to randomly generate numbers from X ~ Unif(0, ). Your friend will...

    2. Suppose you decide to randomly generate numbers from X ~ Unif(0, ). Your friend will ask for n numbers and then use this information to guess what value you (secretly) chose for θ. Typically, one might use alLE = max Xi = X, to estimate θ. Your friend, however, has meganumerophobia, and is afraid to say the maximum number in the random sample. Instead, he'll say the second largest number: θ = Xn-1. Determine the bias of this estimator...

  • Pseudo-random numbers are pervasive and extremely important in modern computing and scientific applications. But how exactly...

    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...

  • Many random number generators allow users to specify the range of the random numbers to be...

    Many random number generators allow users to specify the range of the random numbers to be produced. Suppose that you specify that the range is to be all numbers between 0 and 5. Call the random number generated Y. Then the density curve of the random variable Y has constant height between 0 and 5, and height 0 elsewhere. 1. Use Excel to generate 100 random values from the above distribution. Construct a histogram for generated values [ Note: use...

  • Problem 1: Implement an algorithm to generate prime numbers. You will need to implement the following...

    Problem 1: Implement an algorithm to generate prime numbers. You will need to implement the following ingredients (some of them you developed for earlier assignments): 1. A method to generate random binary numbers with n-digits (hint: for the most significant digit, you have no choice, it will be 1; similarly, for the least significant digit there is no choice, it will have to be 1; for all other position, generate 0 or 1 at random) 2. A method to compute...

  • [Probability] Let N be a geometric random variable with parameter p. Given N,generate N many i.i.d....

    [Probability] Let N be a geometric random variable with parameter p. Given N,generate N many i.i.d. random numbers U1, U2, . . . , UN uniformly from [0,1]. Let M= max 1≤i≤N Ui. Find the cdf of M, i.e., find P(M≤x).

  • Use another random decimal fraction generator at Random.org, linked here, to generate a list of ten...

    Use another random decimal fraction generator at Random.org, linked here, to generate a list of ten two-digit random numbers between 10 and 30. Calculate the z-score of the median of the data set. Set 1: 13, 14, 20, 21, 22, 24, 25, 26, 27, 30 What does the z-score of the data set median just above tell you about the shape of the distribution? How do you know this? If you were to take repeated random samples of n =...

  • Write a program that writes a series of random numbers to a file. Each random number...

    Write a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through 500 inclusive. 1.Use a file called randoms.txt as a input file and output file a. If you go to open the file and its not there then ask the user to create the file     and then quit 2. Ask the user to specify how many random numbers the file will hold. a.Make sure that the...

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
ADVERTISEMENT