Mixed Congruential random number question
Favorites|Homepage
Subscriptions | sitemap
HOME > Mathematics > Mixed Congruential random number question

Mixed Congruential random number question

[From: ] [author: ] [Date: 11-05-22] [Hit: ]
So, our sequence of five 2-digit pseudorandom integers begins at x[2],74, 67, 80, 13,......
Use the mixed congruential method to generate a sequence of five 2-digit random integer numbers such that xn+1 = (41xn + 33) (modulo 100) and x0 = 48

-
Carrying out the sequence, we start with:

x[0] = 48

Then,

x[1] = (41x[0] + 33) mod 100
= (41*48 + 33) mod 100
= (1968 + 33) mod 100
= 2001 mod 100
= 1

But that's not a 2-digit integer. So, we continue with x[1] = 1 as the "seed" for the next value:

x[2] = (41x[1] + 33) mod 100
= (41*1 + 33) mod 100
= 74 mod 100
= 74

x[3] = (41x[2] + 33) mod 100
= (41*74 + 33) mod 100
= 3067 mod 100
= 67

... and, continuing in this way,

x[4] = 80

x[5] = 13

x[6] = 66

So, our sequence of five 2-digit pseudorandom integers begins at x[2], continuing through x[6]:

74, 67, 80, 13, 66
1
keywords: random,Congruential,number,question,Mixed,Mixed Congruential random number question
New
Hot
© 2008-2010 http://www.science-mathematics.com . Program by zplan cms. Theme by wukong .