Question #200870

1.     Generate 4 random numbers by using linear congruenital generator.Use X0 = 21, a= 17, c=43, m=105.


1
Expert's answer
2021-06-01T14:51:51-0400

X0=21.X_0=21.

Xn=(aXn1+c)  mod  mX_n=(aX_{n-1}+c)\;mod \;m.

X1=(1721+43)  mod  105=400  mod  105=85.X_1=(17*21+43)\;mod\;105=400\;mod\;105=85.

X2=(1785+43)  mod  105=1488  mod  105=18.X_2=(17*85+43)\;mod\;105=1488\;mod\;105=18.

X3=(1718+43)  mod  105=349  mod  105=34.X_3=(17*18+43)\;mod\;105=349\;mod\;105=34.

X4=(1734+43)  mod  105=621  mod  105=96.X_4=(17*34+43)\;mod\;105=621\;mod\;105=96.



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS