How a Random Wheel Works — Probability & Fairness
Ever wondered how spinning wheels determine outcomes? This guide explains the math behind randomization, the physics simulation, and how we ensure complete fairness.
Randomness Basics
The wheel uses uniform pseudo-randomness from JavaScript's `Math.random()` function. While technically "pseudo-random" (generated by an algorithm), the randomness is sufficient for all practical decision-making purposes. Each outcome has an equal probability of being selected.
Probability Formula (Equal Weights):
P(option) = 1 / total_optionsFor 5 options, each has a 20% (1/5) chance of being selected.
Weighted Probabilities
Weighted slices increase chance proportionally to weight value. This is useful for scenarios like raffles where certain participants should have more entries, or prize wheels where some outcomes should be more common.
Weighted Probability Formula:
P(option) = weight_of_option / sum_of_all_weightsExample: Options with weights [1, 2, 1] give probabilities [25%, 50%, 25%]
Physics Simulation
The wheel appears to spin realistically using torque, friction, and easing functions. While the final outcome is predetermined by the random number generator, the spinning animation:
- Starts with high velocity (fast spinning)
- Gradually decelerates using cubic easing
- Adds realistic "bounce" at the end
- Plays sound effects synced to rotation speed
- Takes 3-5 seconds for optimal anticipation
This simulation makes the selection process feel natural and builds anticipation, even though the outcome was determined before the animation started.
Bias Prevention
Slice angles are computed precisely to maintain fairness:
- Each slice angle is calculated as:
360° × (weight / total_weight) - Starting positions are randomized each spin
- No option has a visual advantage based on position
- The pointer position is fixed at the top (270°)
- Rotation amount is calculated to land on the selected option
Random Number Generation
Modern browsers use cryptographically strong random number generators for `Math.random()`. This means:
- Outcomes are unpredictable
- No patterns emerge over many spins
- Cannot be "gamed" or manipulated
- Suitable for fair decision-making
Testing Fairness
You can test fairness yourself by spinning many times and tracking results. Over hundreds of spins, each equally-weighted option should appear approximately the same number of times (within normal statistical variance).
Expected Distribution (1000 spins, 5 equal options):
- Option A: ~200 times (20%)
- Option B: ~200 times (20%)
- Option C: ~200 times (20%)
- Option D: ~200 times (20%)
- Option E: ~200 times (20%)
Small variations are normal and expected in truly random systems.
Applications
Gaming
Loot boxes, prize wheels, and gacha systems use weighted randomization. The visible wheel makes probabilities transparent to players.
Teaching
Educators use random wheels to demonstrate probability concepts. Students can see how randomness works in practice.
Decision Making
When all options are equally good, randomness provides a fair tiebreaker that everyone can accept.
Prize Wheels
Promotional events use wheels with weighted prizes — common items have higher weights, rare prizes have lower weights.
Mathematical Proof of Fairness
For a wheel with n equal slices, the probability of landing on any specific slice is exactly 1/n. This is mathematically guaranteed because:
- The random number generator produces uniform distribution in [0, 1)
- We divide this range into n equal segments
- Each segment corresponds to one wheel slice
- Therefore, each slice has probability 1/n