参考资料:http://www.cnblogs.com/xkfz007/archive/2012/03/27/2420154.html
python脚本:
class Samples:
def __init__(self):
pass
def rand(self, num, seed = 1):
m = math.pow(2, 32)
a = 214013
c = 2531011
i = 1
x = np.zeros(num)
x[0] = seed
while(i < num):
x[i] = (a * x[i-1] + c) % m
i += 1
return x
if __name__=='__main__':
s = Samples()
x00 = s.rand(1000)
plt.hist(x00,200)
plt.show()
样本的直方图如下: