Blum Blum Shub
Description
A pseudorandom number generator proposed in 1986 by Lenore Blum, Manuel Blum and Michael Shub.
Code Example
Python example:
m = 11*19 #large primes should be used
xi = 9
def rng():
global xi
xi = (xi * xi) % m
return xi
for i in range(12):
print rng()
Output:
81
82
36
42
92
104
157
196
169
137
168
9
This sequence has period 12. Careful selection of M is essential for large periods.
External Links
Blum Blum Shub - Wikipedia article on Blum Blum Shub.
page revision: 4, last edited: 05 Sep 2013 14:07