How Weighted Random Selection Works
Cumulative sums, one float, and why duplicating entries is the wrong way to do it.
Sometimes the options should not be equally likely. A raffle where somebody bought five tickets, a chore rota where the worst job should come up less often for whoever did it last, a game where a rare event should occur one time in fifty — all of these need a draw with unequal odds.
The right implementation is a cumulative-sum walk over a single random value. It handles any positive weight, including fractions and very large numbers, in constant memory.
The wrong implementation — building a list with each item repeated as many times as its weight — is the one most people write first, and it fails for reasons worth understanding.
The cumulative-sum method
Add up all the weights to get a total. Draw one random value uniformly between zero and that total. Then walk the items in order, subtracting each item's weight from your value, and take the item that makes the running value go negative.
The item that crosses the line is the winner, and the probability of any given item crossing it is exactly its weight divided by the total. That falls straight out of the geometry: each item occupies a band of the interval whose width is its weight, and a uniform draw lands in a band with probability proportional to its width.
Four entries weighted 1, 3, 1, 5
- Total weight is 10. The bands are [0,1), [1,4), [4,5), [5,10).
- A uniform draw in [0,10) lands in the fourth band half the time.
- Shares: 10%, 30%, 10%, 50% — exactly the weights divided by the total.
Why duplication fails
The intuitive alternative is to build a flat list containing each item repeated `weight` times, and then draw uniformly from that. For whole-number weights this is correct, and for everything else it breaks.
It cannot express a weight of 2.5 at all. You can multiply everything by two to clear the fraction, and then someone wants 2.33, and you multiply by three, and now a hundred-entry list with mixed fractions requires a common denominator and produces an array in the hundreds of thousands.
It also scales badly for large integer weights. Weights in the thousands — a share allocation, a points total — produce an array with as many entries as the total weight, to make a single draw. The cumulative walk makes the same draw with one random value and no allocation at all.
- Fractional weights cannot be expressed by duplication without rescaling everything.
- Large weights produce enormous arrays for a single draw.
- Editing one weight means rebuilding the whole array.
- The cumulative walk has none of these problems and is the same number of lines.
Only ratios matter
Because the draw normalises by the total, weights are meaningful only relative to each other. Entries weighted 2, 3 and 5 behave identically to 20, 30 and 50, and identically to 0.2, 0.3 and 0.5.
This trips people up in one specific way: trying to make an entry more likely by increasing every weight. Scaling everything by the same factor changes nothing at all. To change the odds you have to change a ratio, which means increasing one weight without increasing the others.
It also means there is no meaningful maximum weight. A weight of one million alongside weights of one is a valid configuration and gives the heavy entry a 99.9999% share, which the odds table will state plainly.
Weighted draws without replacement
Drawing several distinct winners by weight is a genuinely harder problem than drawing one, and the reason is that removing a winner changes everybody else's share. If A has 50% and B has 30%, then after A is drawn B's share is no longer 30% — it is 30 divided by the remaining total, which is 60%.
The straightforward implementation is to draw one, remove it, recompute the total, and draw again. That is what a weighted multi-winner draw should do, and it is worth being explicit that the resulting per-entry probabilities are not simply the original weights: an entry's chance of appearing somewhere in a k-winner draw is a more complicated quantity than its chance of being drawn first.
This is why a weighted raffle for three prizes cannot be described by a single percentage per entrant. The honest statement is the probability of winning the first prize, which is the weight share, plus the observation that the later prizes redistribute among whoever is left.
Publishing the odds
The practical requirement for any weighted draw involving other people is that the weights are visible before the draw. Unequal odds are legitimate; unequal odds that nobody announced are indistinguishable from rigging, and the person who finds out afterwards is entitled to be annoyed.
The useful form is a percentage table rather than raw weights, because raw weights require the reader to do the normalisation themselves and most will not. Three entries weighted 2, 3 and 5 are much less legible than 20%, 30% and 50%.
That is why every weighted tool on this site prints the percentage table above the draw button rather than in an explanation below it.
Frequently asked questions
Why not just repeat entries in a list?
It works only for whole-number weights, cannot express 2.5 without rescaling everything, and builds enormous arrays for large weights — all to make one draw.
Do the weights need to add up to anything in particular?
No. They are normalised by their total, so only the ratios matter. 2/3/5 and 20/30/50 behave identically.
How do I make one entry more likely?
Increase its weight relative to the others. Scaling every weight by the same factor changes nothing at all.
Can weights be fractional?
Yes, any positive number. That is the main practical advantage of the cumulative-sum method over duplication.
What does a weight of zero do?
The entry can never be drawn. It is a legitimate way to park an option without deleting it.
How do multiple winners work with weights?
Draw, remove, recompute the total, draw again. The per-entry probabilities for later positions are not simply the original weights, because removing a winner redistributes their share.
Is a weighted draw still random?
Yes. Random means unpredictable, not equal — a weighted draw is unpredictable within known odds.
Should I always show the odds?
Any time the result affects someone else, yes. Unequal odds nobody announced are indistinguishable from a rigged draw.
Tools that use this
Weighted Random Picker
Give each entry its own odds — and see the exact probability table before you draw.
Raffle & Giveaway Picker
Paste your entrant list and draw a fair, verifiable winner — built for streamers.
Scattergories Letter Picker
Letters weighted by how playable they are — the honest opposite of a uniform draw.
Related guides
Expected Value, Explained With Dice
The average of a thing that never happens, and why it is still the right number.
Sampling With and Without Replacement
The single decision that changes every number downstream of your draw.
Which Randomness Each Tool Here Uses
A tool-by-tool table of the exact draw behind every generator on this site.