LESSON 2.20 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Pseudorandom generators and seeds
Watch one seed and one fixed rule make every random number.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 2.20 · GENERATOR BAYSEED 8 · STATE x₀ = 8
01
Stage 1 of 6 · Seed the state
A pseudorandom number generator keeps one state. The seed 8 sets it.
Explain it simply
A computer can't flip a real coin. So it keeps one number, called its state, and changes it with a fixed rule. The seed is the state you start from. Here the seed is 8, so dot 8 on the ring lights up.
A ring of 16 states, 0 to 15. The seed 8 marks the first state.
state xseed, rule stepdraw u, walker pathrepeated stepstate never reached
Toy: a 16-state generator x ← (a·x + c) mod 16 · 8 draws per run · a walker on a line
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
The seed is the first state.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 3 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.