Question

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.

Homework Answers

Answer #1

1) generating random numbers using linear congreuential number generator

a= 35

c= 20

m=100

X0= 84, to generate 5 random numbers

Xi+!= (a Xi+c)* mod m

Ri= Xi/m

X1= ( 35 x 84 + 20) mod 100= 60, R1= X1/m= 60/100= 0.6

X2= (35 x 60 + 20) mod 100= 20,, R2=X2/m= 20/100= 0.2

X3= ( 35x20+20) mod 100= 20, R3=X2/m= 20/100= 0.2

X4= (35x20+20) mod 100= 20, R4=X2/m= 20/100= 0.2

X5= (35x20+20) mod100= 20, R5=X2/m= 20/100= 0.2

5 random numbers are = 0.6, 0.2,0.2,0.2,0.2

b) inverse sampling method

to find random variates first we need inverse cdf for it

cdf of exponential = 1-e-px, p= lambda

let u = 1-e-px, , u-1= -e-px, 1-u= e-px,, -px= log(1-u), x=- log(1-u)/p

so our inv-cdf = - log(1-u)/p

using two random numbers from above we have

Xi= - log(1-u)/p

X1= -log(1-0.6)/0.5= 1.8

X2=-log(1-0.2)/0.5= 0.4

two random variates are 1.8, 0.4

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
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.
Suppose we create a linear congruential pseudorandom number generator with a=11, b=12, m=23 and we use...
Suppose we create a linear congruential pseudorandom number generator with a=11, b=12, m=23 and we use it to generate a random number uniformly distributed between 0 and 1 with seed s=15. What is the first random number that we will generate? (give your answer to 4 decimal places).
Using MATLAB, not R codes, I repeat, please, not in R, just MATLAB codes, write the...
Using MATLAB, not R codes, I repeat, please, not in R, just MATLAB codes, write the complete code for: 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.
Random number generator 1: Search for algorithms generating pseudo-random numbers. Select one of them for generating...
Random number generator 1: Search for algorithms generating pseudo-random numbers. Select one of them for generating a pseudo-random sequence. Original sample can be generated in any form: binary, decimal, etc. But submitted sample must be in the form of uniform random numbers on [0,1][0,1]. The sample should not be generated by any function, like runif(), sample(), etc. Instead it must be some algorithm that you code yourselves. For example, mid-square algorithm, Fibonacci-based algorithm, etc. Random number generator 2: Find some...
A random number generator is supposed to produce random numbers that are uniformly distributed on the...
A random number generator is supposed to produce random numbers that are uniformly distributed on the interval from 0 to 1. If this is true, the numbers generated come from a population with μμ = 0.5 and σσ = 0.2887. A command to generate 169 random numbers gives outcomes with mean x¯¯¯x¯ = 0.4366. Assume that the population σσ remains fixed. We want to test H0:μ=0.5 Ha:μ≠0.5 (a) Calculate the value of the Z test statistic. (b) Use Table C:...
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
5. Consider the random variable X with the following distribution function for a > 0, β...
5. Consider the random variable X with the following distribution function for a > 0, β > 0: FX (z) = 0 for z ≤ 0 ​= 1 – exp [–(z/a)β] for z > 0 (where exp y = ey) (a) Determine the inverse function of FX (z), where 0 < z < 1. (b) Let a = β = 2 for the random variable X, and define the numbers u1 = .33 and u2 = .9. Use the inverse...
c++ programming question: Use the random number generator in class Random to store a list of...
c++ programming question: Use the random number generator in class Random to store a list of 1000 random integer values in an array.   Create 3 arrays using this method. Apply each of the insertion, bubble, selection and shell sort algorithms to each array. Determine the number of comparisons and exchanges for each sort algorithm for each array. create table to print out the results. first array second array third array comparisons exchanges comparisons exchanges comparisons exchanges insertion bubble selection shell
1. A random number generator is used to select a number from 1 to 500 ?(inclusively)....
1. A random number generator is used to select a number from 1 to 500 ?(inclusively). What is the probability of selecting the number 595 ? What is the probability? 2.Identify the sample space of the probability experiment and determine the number of outcomes in the sample space. -Randomly choosing an even number between 10 and 20, inclusive The sample space is? (Use a comma to separate answers) There are _____ outcomes in the sample space 3. Determine the number...
Consider the simple linear regression model y=10+30x+e where the random error term is normally and independently...
Consider the simple linear regression model y=10+30x+e where the random error term is normally and independently distributed with mean zero and standard deviation 1. Do NOT use software. Generate a sample of eight observations, one each at the levels x= 10, 12, 14, 16, 18, 20, 22, and 24. Do NOT use software! (a) Fit the linear regression model by least squares and find the estimates of the slope and intercept. (b) Find the estimate of ?^2 . (c) Find...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT