码迷,mamicode.com
首页 > 其他好文 > 详细

random

时间:2016-08-23 09:07:12      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:

random

https://en.wikipedia.org/wiki/Linear_congruential_generator

 

A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo-randomized numbers calculated with a discontinuous piecewise linear equation. The method represents one of the oldest and best-known pseudorandom number generatoralgorithms.[1] The theory behind them is relatively easy to understand, and they are easily implemented and fast, especially on computer hardware which can provide modulo arithmetic by storage-bit truncation.

 

the "seed" or "start value"

Period length

The period of a general mixed congruential generator is at most m, and for some choices of factor a much less than that. The mixed congruential generator will have a full period for all seed values if and only if:

These three requirements are referred to as the Hull-Dobell Theorem.[3][4] 

 

random

标签:

原文地址:http://www.cnblogs.com/yuanjiangw/p/5797894.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!