LuckPicker

Tool

Random Walk Generator

Take n random steps and watch how far a fair process drifts from where it started.

Random Walk Generator

Take a number of steps, each one either forward or back on a fair coin, and watch where you end up. Then look at how far that is from zero.

Almost everyone expects a fair process to stay near where it started. It does not. Two hundred fair steps typically finish about fourteen away from the origin, and the drawn path spends long stretches entirely on one side of the line.

That behaviour is the reason this tool exists. Long one-sided runs in a random walk are the same phenomenon as long streaks in a coin flip, and seeing one drawn is more convincing than any amount of reassurance that a picker is not rigged.

How the Random Walk Generator works — and why it's fair

Each step is a single unbiased bit from crypto.getRandomValues, mapped to plus one or minus one. The position after n steps is the running sum of those steps, and the path drawn is that running sum plotted against step number.

The expected final position is exactly zero, because every step has mean zero and expectations add. That is true and almost entirely useless as a prediction, because the typical distance from zero grows as the square root of the number of steps — a walk of 100 steps typically lands about 10 away, a walk of 400 lands about 20 away, and a walk of 10,000 lands about 100 away.

Square-root growth is the number worth taking from this page. It says that the walk drifts, steadily and without limit, while its average stays pinned at zero. Both facts are true simultaneously, and the tension between them is what makes random walks counter-intuitive: nothing pulls the walk back, and there is no force correcting an excursion.

That is the mathematics behind the gambler's fallacy in its most direct form. A walk that is 30 above zero is not owed a correction; the next step is still a fair coin, and the walk is equally likely to reach 31 as 29. What actually happens over time is not that the excursion is repaid but that it becomes proportionally smaller against a growing square root — the position stays large while the ratio to the expected spread shrinks.

The drawn path is the point rather than the numbers. A walk that spends four hundred consecutive steps above the line looks deliberate, and it happens far more often than intuition allows — the arcsine law says that the fraction of time a walk spends on one side is most likely to be near zero or near one, and least likely to be near a half.

When the Random Walk Generator is fair — and when it is not

What it does guarantee

  • Every step is an independent, unbiased fifty-fifty draw with no memory of the previous steps.
  • The expected final position is exactly zero, and over many walks the average of final positions converges on it.
  • The typical distance from zero is the square root of the step count, and the tool reports that alongside the actual result.

What it does not

  • Zero is the expected value and an unlikely outcome. Finishing exactly at zero is rare, not normal.
  • Nothing corrects a drift. A walk far from zero is not more likely to come back on the next step.
  • A single walk tells you nothing about the generator. Judging fairness from one path is exactly the error this page exists to demonstrate.

Two worked examples

200 steps

  • Expected final position: 0. Typical distance from zero: about 14.
  • A final position of 22 or −18 is entirely ordinary and needs no explanation.
  • The walk will usually spend a long unbroken stretch on one side of the line.

2,000 steps

  • Ten times the steps, but the typical distance only grows by the square root of ten — about 45 rather than 140.
  • The path looks dramatically more 'trending' at this length, because the excursions scale up too.
  • The expected final position is still exactly zero, and still an unlikely outcome.

What a drawn path is good for

Explaining why a picker is not rigged is the most practical use. A teacher whose class is convinced the name picker favours somebody can run this once and point at a path that spent three hundred steps above the line — produced by a process everyone in the room agrees is fair.

It is a standard teaching device for the difference between an expected value and a typical outcome, and it is unusually good at it because both numbers are on screen together. Zero expected, fourteen typical, and a specific result that is neither.

People modelling anything cumulative — a running score, a bankroll, a queue length — use it to build intuition for how far a fair process wanders. The square-root rule transfers directly and is the single most useful thing to know about accumulated randomness.

For the same phenomenon expressed as streaks rather than as a path, the coin flip streak simulator counts the longest run and compares it to what theory predicts. For a single fair binary outcome, the coin flip is the tool.

Frequently asked questions

Why does the walk drift so far from zero?

Because nothing pulls it back. Steps are independent, so distance from the origin accumulates — typically as the square root of the number of steps.

Is the expected position really zero?

Yes, and it is also an unlikely actual result. Zero is the average across many walks, not a prediction about this one.

Does a walk that is far above zero tend to come back?

No. That is the gambler's fallacy stated geometrically. The next step is a fair coin regardless of where the walk currently is.

What is the square-root rule exactly?

The typical distance from the start after n steps is roughly the square root of n. 100 steps gives about 10; 10,000 gives about 100.

Why does the path spend so long on one side?

Because of the arcsine law: the fraction of time a walk spends above zero is most likely to be near 0 or near 1, and least likely to be near a half. Balanced-looking paths are the unusual ones.

Is each step really fifty-fifty?

Yes — a single unbiased bit from the browser's cryptographic generator, with no dependence on previous steps.

Can I make the walk biased?

Not on this page. An unbiased walk is what makes the drift surprising; a biased one would drift for an obvious reason.

How many steps can it take?

Up to 2,000, which is enough to make the square-root behaviour and the long one-sided runs both clearly visible.

Does the drawn chart show every step?

Yes — the polyline has one point per step. At two thousand steps the individual steps merge visually, which is itself informative about scale.

← Back to all tools