Into AI

Into AI

Implementing A Pseudorandom Number Generator In Python From Scratch

Learn to implement Linear Congruential Generator (LCG), a pseudorandom number generator in Python

Dr. Ashish Bamania's avatar
Dr. Ashish Bamania
May 23, 2024
∙ Paid
Generated with DALL-E 3
Generated with DALL-E 3

Computers use deterministic algorithms to generate Pseudorandom numbers.

These algorithms called Pseudorandom number generators (PRNGs) take a seed value and return a Pseudo-random number.

Let’s talk about one of such popular algorithms.

Note that true randomness is usually generated by Hardware Random Number Generators (HRNGs)/ environmental noise/ quantum processes etc. These are not discussed in this article.

User's avatar

Continue reading this post for free, courtesy of Dr. Ashish Bamania.

Or purchase a paid subscription.
© 2025 Dr. Ashish Bamania · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture