Random pickers

Is an online wheel spinner really random?

How a fair wheel picks a winner, what equal chances actually look like, and why streaks happen even when nothing is rigged.

The question behind every spin

When a class watches a wheel slow down over one name, someone usually asks whether it was really chance. It is a fair question. A spinning animation looks convincing, but the animation is not what decides the result. What matters is the number that the page uses to choose a winner, and where that number comes from.

A fair wheel has two jobs. It must give every entry exactly the same chance, and nobody, including the person running the wheel, should be able to predict or steer the result. Everything else, from the colors to the clicking sound, is presentation.

Where the randomness comes from

Browsers offer two common ways to produce random numbers. The older one, Math.random, is fine for games and visual effects, but it is not designed to be unpredictable to someone who studies its output. The newer one, the Web Crypto API with crypto.getRandomValues, draws on the operating system’s cryptographically secure generator, the same kind of source used to create encryption keys.

SpinPickPlay uses crypto.getRandomValues for every pick. The winner is chosen first, with equal probability for each entry, and only then does the wheel animate toward that segment. The landing point inside the segment is also random, so the pointer does not stop in the same spot every time.

There is one more detail that separates careful tools from careless ones. Turning a large random number into a choice between, say, seven names can quietly favor some names if it is done with a simple remainder. A technique called rejection sampling throws away the few values that would cause that bias, so every name keeps exactly the same chance.

What equal chances look like in numbers

With eight names on the wheel, each name has a one in eight chance on every spin. That is 1 ÷ 8 = 0.125, or 12.5 percent. The chance does not change because a name won last time, and it does not grow because a name has not come up for a while. Each spin starts fresh.

If you remove the winner after each spin, the numbers shift in a predictable way. The second spin is a choice among seven names, so each remaining name has a one in seven chance, about 14.3 percent. By the last two names it is a coin toss. Removing winners is the simplest way to make sure everyone gets a turn before anyone is picked twice.

You can also give an option more weight on purpose. Writing “Pizza” on two lines and “Sushi” on one gives pizza two of the three segments, a two in three chance, while sushi keeps one in three. The wheel stays fair; you simply changed the odds in the open.

Why streaks happen without anything being rigged

People are surprised when the same name wins twice in a row. With eight names and winners kept on the wheel, the chance that the next spin repeats the previous winner is one in eight every single time. Over a lesson with twenty spins, at least one repeat is far more likely than not. Real randomness is lumpier than our intuition expects.

The opposite feeling is just as common: a name that never seems to come up. That is also normal. If you want a guarantee rather than a probability, use the remove-the-winner option, or switch to a random order list so everyone gets a turn in a shuffled sequence.

How to run a pick that everyone trusts

Show the full list before you spin, so nobody wonders whether a name was missing. Spin in front of the group, on a projector or a shared screen, and leave the result visible for a moment. For giveaways, write down the date, the time and the number of entries, and keep the list you used.

Most of all, decide the rules before the spin: whether winners are removed, whether a repeat counts and what happens if someone is absent. Fairness is partly mathematics and partly agreeing on the process in advance.

Ready to try it? Paste your names into the wheel below and give it a spin.

Put it into practice.

Open the free tool from this article. No sign-up, nothing uploaded.

More from the blog

All articles →