正在加载图片...
A widely used random-number generation method Congruential method. X=(axn +c)mod(m) Properties of this sequence X<m When a, c, Xo and m are integers, Eq (1)generates integers between 0 and m-1 Xn m gives pseudo-random numbers distributed on(0, 1) lllustration With a=3, c=l, m=16 and a seed Xo=2, we have the following sequences 2.7.6.3.10.15.14.11.2.7 The period of this sequence is 8A widely used random-number generation method Congruential method: Xn = (aXn-1+c)mod(m) (1) Properties of this sequence: Xn < m When a, c, X0 and m are integers, Eq.(1) generates integers between 0 and m-1. Xn /m gives pseudo-random numbers distributed on (0,1). Illustration: With a=3, c=1, m=16 and a seed X0=2, we have the following sequences, 2, 7, 6, 3, 10, 15, 14, 11, 2, 7,… The period of this sequence is 8
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有