数字1103515245是如何取得

来源:百度知道 编辑:UC知道 时间:2024/05/16 19:35:04

LCG的问题。见下面的链接

什么啊

MTGAP wrote:

[quote:ab78e713f5]A linear congruential generator is a PRNG of this form:

x2 = (a*x1 + c) % m;

Usually on a computer, m is 32 bits. Several PRNGs in computers have a
= 1103515245 and c = 12345, that is,

x2 = (1103515245*x1 + 12345) % 2^32;

There are certain requirements for an LCG to have maximum period. From
Wikipedia:

1. c and m are relatively prime,
2. (a - 1) is divisible by all prime factors of m,
3. (a - 1) is a multiple of 4 if m is a multiple of 4.

I can understand why c = 12345. The only requirement is that it is not
a multiple of 2, and 12345 is easy to remember. But why choose
1103515245? The only requirement is that (a - 1) is a multiple of 4.
They could have chosen a more intuitive number like 1000000. So why do
they use such a complicated number?
[/quote:ab78e713f5]
I can't answer