Wheel Names: How a Random Name Picker Turns Weights into Fair Odds
Wheel names sit at the centre of thousands of classroom routines, raffles, and team meetings, yet the moment of the spin hides a short chain of decisions. A list is converted into sectors, a random number selects one sector, and an animation rotates the canvas until the pointer rests on the result. Each step can be built well or badly, and the difference shows up only when someone asks why a particular name won.
This guide follows that chain in order. It explains how weighted entries become probabilities, why the spin animation is not the source of randomness, how a host can audit a draw after the fact, and which limits appear once a list grows past a few dozen names. The examples use a six-name list so the arithmetic can be checked by hand.
What happens between a click and a winner?
A wheel of names is a list with two visual additions. Each visible entry receives a sector whose angle is proportional to its weight, and the wheel is drawn once per change so that the picture matches the list. The sector boundaries are stored as fractions of a full circle, which allows the drawing code to render fractional spans without rounding every entry to a whole degree.
At the moment of a spin, two computations run in sequence. The first selects an index from the visible entries according to their weights. The second computes a target rotation that places the centre of that sector under the fixed pointer, adds several full revolutions for the visual effect, and hands the value to a CSS transition. The canvas rotates, decelerates, and stops with the chosen sector at the top.
The order matters. If the winner were read from wherever the wheel happened to stop, the animation would become part of the random process, and any inconsistency between the drawn angle and the pointer position would change the odds. Selecting first and animating second separates the statistics from the presentation. The pointer is a display of a decision that has already been made, not the decision itself.
This separation also explains why the spin duration can be changed without affecting fairness. A one-second spin and a twenty-second spin use the same selection code; only the transition time and the number of revolutions differ.
How do entry weights translate into probabilities?
The weight of an entry is a relative number, not a percentage. The chance of an entry winning equals its weight divided by the sum of the weights of all visible entries. A list with weights 1, 1, 1 and 3 therefore gives the last entry a 50 percent chance, because the total is 6 and its weight is 3. Doubling every weight in the list changes nothing, since the ratio stays the same.
A worked example makes the arithmetic concrete. The table below uses six names with weights from 1 to 12 and a total weight of 30.
| Entry | Weight | Chance per spin | Expected wins in 10,000 spins |
|---|---|---|---|
| Alice | 1 | 3.33% | 333 |
| Bob | 2 | 6.67% | 667 |
| Cara | 3 | 10.00% | 1,000 |
| Dan | 5 | 16.67% | 1,667 |
| Eve | 7 | 23.33% | 2,333 |
| Finn | 12 | 40.00% | 4,000 |
The last column is an expectation, not a promise. Ten thousand draws will not produce exactly 4,000 wins for Finn; the observed count will scatter around that value. For a 40 percent event across 10,000 independent draws, the standard deviation is about 49 wins, so a result between roughly 3,900 and 4,100 is unremarkable. Reading a small deviation as evidence of bias is the most common mistake made when someone tests a random picker.
Weights are clamped to whole numbers from 1 to 100 in the editor for a practical reason. A weight of zero would remove the entry from the draw while leaving it visible, and a weight below one would create sectors too small to label. Entries that should not be drawn at all are marked hidden instead, which keeps them in the list for later use.
Why does the animation not decide the winner?
The animation is a presentation layer, and the random source sits underneath it. In a browser, the reliable source is the Web Crypto API. A call to crypto.getRandomValues fills a typed array with values produced by the operating system's random number generator, and the result is suitable for a draw that people may question.
A careful implementation does not take a raw 32-bit value modulo the number of entries. Straight modulo reduction over a space that is not an exact multiple of the entry count gives the first few indices a slightly higher chance. The bias is tiny, on the order of one part in four billion per draw, but it is avoidable with rejection sampling: values above the largest multiple of the entry count are discarded and the call is repeated. The distribution that remains is exactly uniform.
The fallback path deserves a note as well. If crypto.getRandomValues is unavailable, a picker may fall back to Math.random. The Python documentation makes the equivalent point about its own random module: the Mersenne Twister is deterministic once its state is known and is not suitable for security purposes. A classroom draw does not need cryptographic secrecy, but a public giveaway does, and using the stronger source costs nothing.
How can a host show that the draw was fair?
Fairness is easier to defend when the rules are visible before the spin. A host can publish the entry list and the weights, state whether winners leave the wheel, and name the number of prizes. After the draw, the log provides the evidence: each result carries a timestamp, and the history can be exported as CSV.
A stronger check is available inside the wheel itself. The Results tab can run a simulated audit of 10,000 spins with the same random source and compare the observed count for every entry with its expected count. The output is a table of expected versus observed values, which makes an obviously broken weighting visible. A list with equal weights should produce roughly equal counts; a list with a heavy favourite should show that entry near its calculated share.
Two cautions apply to any such audit. First, 10,000 simulated spins test the selection code, not the honesty of the person who ran the draw. Second, a single real spin proves nothing about the distribution. The audit answers the question "does this wheel follow its weights?" rather than "was this particular result deserved?".
What changes when a winner leaves the wheel?
Removing a winner changes the denominator, and every remaining entry gains probability. In the six-name example, Finn holds 12 of 30 units, or 40 percent. After Finn wins and is removed, the total falls to 18 and Alice rises from 3.33 percent to 5.56 percent. Elimination rounds therefore become easier for the remaining entries with each draw, which is the intended behaviour for prize tiers and turn-taking.
The multi-winner setting uses the same principle in a single action. When three winners are requested, the picker draws one entry, sets its weight to zero for the rest of the operation, and draws again from the renormalised pool. The result is a set of distinct entries rather than three independent draws that might repeat a name. For a raffle with first, second, and third prize, that is the difference between a clean podium and an awkward repeat.
The third winner mode keeps every entry in place and adds a point each time a name wins. It suits multi-round games and long-running classroom use, where the question is not who leaves but who has been called most often. The tally in the Results tab answers that question directly, and the history retains the last 500 spins for export.
Where do the limits of a browser wheel appear?
A wheel that runs entirely in the browser avoids accounts and uploads, and it inherits the limits of that design. The entry cap is 1,000 names per wheel. At that size the sectors become very thin, and the practical advice is to reduce the list or use several wheels rather than expect readable labels. Entry images are capped at 100 per wheel, since each image is stored as a data URL alongside the list.
The share link is the other boundary. A link carries up to 200 entries in a compressed fragment after the hash, which keeps it inside the length that messaging apps and QR codes handle. The QR generator refuses links longer than 1,200 characters and suggests copying the link instead. Images and history are not included in a share link; the recipient receives the names, weights, colours, and settings.
Storage is local. Entries, settings, and history live in the browser's localStorage, which means a private window or a cleared site history removes them. The JSON export covers that gap: a wheel can be downloaded as a file and loaded back later, on the same machine or another one. Wheel size runs from 240 to 560 pixels, and on narrow screens the canvas fits the content column while keeping its full drawing resolution.
How should a classroom draw be prepared?
A classroom picker works best when the list is fixed before the lesson and the rules are stated once. Load the roster, mark absent students as hidden rather than deleting them, and keep weights equal unless there is a reason to favour a name. For turn-taking, switch to elimination mode so that a student who has answered does not come up again in the same round.
Three habits prevent most disputes. State the mode before the first spin, so nobody expects a repeat winner to be possible or impossible. Export the history at the end of the session if the picks need a record. And avoid re-spinning a result that the class dislikes, because a re-spin silently changes the odds that were announced.
For a term-long record, count-wins mode produces a tally that shows how often each student was called. That number is useful for checking whether the wheel has been used evenly across the group, and it is more informative than a memory of who seems to get picked too often.
FAQ
?Does the wheel use true randomness?
It uses the browser's cryptographic random source, crypto.getRandomValues, which draws from the operating system's generator. That source is unpredictable in practice and is the same class of source used for security-sensitive browser operations. The mapping from random values to entries uses rejection sampling to keep the distribution exactly uniform.
?Can a heavy weight guarantee a win?
No. A weight of 12 out of 30 gives a 40 percent chance on each independent spin, and a 60 percent chance of losing. Over many spins the share converges toward the weight, but any single spin can go to a light entry. A guarantee requires removing the other entries, not raising a weight.
?What happens to the odds after a winner is removed?
The removed entry leaves the pool and the total weight drops by its weight, so every remaining entry's share rises. In the six-name example, removing a weight of 12 from a total of 30 raises a weight of 1 from 3.33 percent to 5.56 percent. The wheel redraws with the new sector sizes immediately.
?Is a share link the same as a saved wheel?
The link rebuilds the current list, weights, colours, and settings on another device, up to 200 entries. Images and spin history stay in the browser that created them. For a complete copy, including every field, download the wheel as JSON and load that file.
?Why does the QR code sometimes not appear?
QR generation is limited to links of 1,200 characters or fewer. A wheel with many long names produces a longer link, and the Share tab then offers the copy action instead. Shortening names or reducing the entry count brings the link back under the limit.
?Does the wheel work offline?
The page loads from the web, but once it is open the draw runs locally and the list is stored in the browser. An interrupted connection does not affect a spin that has already started. Saving the wheel as JSON is the reliable way to move it between devices or browsers.
Which sources support this explanation?
The description of the selection code follows the implementation of this wheel, including the use of crypto.getRandomValues, rejection sampling, and weighted draws without replacement. The general properties of pseudorandom generators and the distinction between statistical and security randomness follow the Python documentation for its random module. The behaviour of weighted sampling with and without replacement follows the NumPy manual for Generator.choice, which documents the p and replace parameters used in the same way. The probability arithmetic and the standard deviation quoted above are computed from the weights in the table.
Australia · SO reputation 7994 · Badges: 2🥇34🥈40🥉 · SO member since 2013