[prev] 10 [next]

Sidetrack: Random Numbers (cont)

Another trivial example:
  • again let c=0
  • try a=12=X0 and m=30
    • that is, Xn+1 = 12·Xn mod 30
    • which generates the sequence:

    12, 24, 18, 6, 12, 24, 18, 6, 12, 24, 18, 6, 12, 24, 18, 6, 12, 24, 18, 6,
    12, 24, 18, 6, 12, 24, 18, 6, 12, 24, 18, 6, ...
    

  • notice the period length (= 4) … clearly a terrible sequence