分からない問題はここに書いてね239
■ このスレッドは過去ログ倉庫に格納されています
0154132人目の素数さん
2006/04/30(日) 15:26:42http://en.wikipedia.org/wiki/Linear_congruential_generator
の,1-5の条件が言えれば周期がMになるそうですが,説明できるかたいますか?
以下,引用です.
LCGs are defined by the recurrence relation:
V_(j+1) = (A x V_j + B) mod M
Where Vn is the sequence of random values and A, B and M are generator-specific integer constants. mod is the modulo operation.
The period of a general LCG is at most M, and in most cases less than that. The LCG will have a full period if:
1. B 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
4. M > max(A, B, V0)
5. A > 0, B > 0
■ このスレッドは過去ログ倉庫に格納されています