Data & AnalyticsLive🔒 Private

Weighted Random Chooser

Pick random items with custom probability weights. Free online weighted random picker. No signup, 100% private, browser-based.

Weighted Random Chooser

Selected

A (71% chance)

How it works

Weighted random selection (also called a weighted lottery, weighted sample, or discrete probability distribution sampler) draws items from a collection where each item has a specified probability of selection. Unlike uniform random choice, weighted selection assigns different likelihoods to each item, proportional to its weight.

**Alias method — O(1) sampling** Naive weighted sampling (compute cumulative weights, binary search on a random value) is O(log n) per draw. The Vose alias method preprocesses the weight table in O(n) time and then draws in O(1) per sample. It creates a probability and alias table such that each "slot" either contains one item at full probability or two items split by their relative weights.

**Applications** Content recommendation: weighting items by relevance score or predicted CTR. A/B testing: traffic splitting where variant A receives 70% and variant B 30%. Random map generation: terrain tiles with different spawn probabilities (grass: 60%, forest: 30%, mountain: 10%). Load balancing: weighted round-robin assigns traffic proportionally to server capacity. Loot systems in games: rare items have low weights, common items have high weights.

**Sampling with vs. without replacement** With replacement (default): each draw is independent; the same item can be selected multiple times. Without replacement (sampling): once an item is drawn, it is removed from the pool and its weight no longer contributes. The latter is used for drawing a subset of unique items.

Frequently Asked Questions

How do I normalize weights that don't sum to 1?
If your weights are [3, 1, 1] (not probabilities), normalize: total = 3+1+1 = 5. Probabilities: [3/5, 1/5, 1/5] = [0.6, 0.2, 0.2]. The tool accepts raw weights (any positive numbers) and normalizes automatically — you do not need to pre-normalize. Weights of zero exclude an item from selection. Negative weights are invalid.
What is the alias method and why is it faster than linear search?
The naive weighted sampling approach: compute cumulative weights [0.6, 0.8, 1.0], generate a random number r in [0,1), binary-search to find which range r falls in. This is O(log n) per draw. The Vose alias method preprocesses in O(n) time, building a table where each slot either assigns 100% probability to one item or splits probability between two items. Each draw is then O(1): pick a random slot, flip a weighted coin. For millions of draws from large weight tables, alias method is dramatically faster.
How is weighted random selection used in A/B testing?
Traffic splitting for A/B tests: assign users to variant A with 70% probability, variant B with 30%. Weights [70, 30] in the chooser. For multi-armed bandit experiments, weights update dynamically based on observed conversion rates — variants performing better receive increasing weight over time. The Thompson sampling algorithm maintains Beta distribution posteriors for each variant and samples from them to assign weights, automatically balancing exploration vs. exploitation.
What is weighted sampling without replacement?
In weighted sampling without replacement, once an item is selected, it is removed from the pool for subsequent draws. The remaining items' weights must be renormalized after each draw. This is used for proportional-to-size sampling in survey methodology — geographic areas with larger populations are proportionally more likely to be included in the sample. Implementation: draw using alias method, remove selected item, rebuild the alias table. For large populations, systematic probability proportional to size (PPS) sampling is more efficient.