YuNing's Thought

Home

❯

Notes

❯

Linear Congruential Generator

Linear Congruential Generator

Jun 17, 20241 min read

  • Benefits:
    • Constants can be chosen such that they emit every possible output value once before repeating
  • Problems:
    • The high bits of the state do not affect the low bits at all

Algorithm

macX0​​the modulusthe multiplierthe incrementthe starting value, or seed​m>00<a<m0≤c<m0≤X0​<m​

Xn+1​=(aXn​+c)modm

Links

  • Linear congruential generator - Wikipedia
  • Random number generators: good ones are hard to find | Communications of the ACM

Graph View

  • Algorithm
  • Links

Backlinks

  • Pseudo Random Number Generator

Created with Quartz v4.5.2 © 2025

  • GitHub
  • Discord Community