Tool
Random Subset Picker
Include each entry independently at probability p — the sample size is a random variable.
Random Subset Picker
Every item gets its own independent coin flip weighted to the probability you set. Twenty percent means each item has a one-in-five chance — not that one in five items will be chosen.
That distinction is the whole tool. A fixed-size sampler always returns exactly n; this returns however many happen to pass, which on a fifty-item list at twenty percent is usually somewhere between five and fifteen, and occasionally none at all.
The tool keeps a short history of the sizes your last few runs produced, because seeing 12, 7, 11, 9, 14 in a row is the fastest way to understand what an independent pass actually does.
How the Random Subset Picker works — and why it's fair
Each item is tested separately: draw a float from crypto.getRandomValues, keep the item if the float is below your probability, move on. There is no coordination between items and no target size — that is a Bernoulli pass, and the number of survivors is a binomial random variable rather than a constant.
The expected size is items times probability, and the tool shows it. But expectation is an average over many runs, not a promise about this one. For fifty items at twenty percent the expected size is ten, and the standard deviation is about 2.8 — so roughly two runs in three land between 7 and 13, and results of 4 or 17 turn up regularly.
An empty result is a legitimate outcome and the tool says so rather than silently redrawing. At twenty percent over ten items, all ten failing has a probability of 0.8 to the tenth power, which is about 10.7% — that is one run in nine, not a freak event. A tool that quietly retried until it got something would be lying about the process.
The contrast with the fixed-size sampler is the reason both exist. Drawing exactly ten of fifty means the items are not independent: once nine are chosen, the tenth is drawn from the remainder and its selection depends on all the previous choices. Here each item's fate depends on nothing but its own draw, which is the right model when inclusion is genuinely a per-item decision — a spot check that each unit independently passes or fails, a feature flag rolled out per user.
Because the draws are independent, the same item can be included in consecutive runs, and a run of unlucky items can be excluded repeatedly. Nothing balances that out, because balancing it would introduce exactly the dependency this model is designed not to have.
When the Random Subset Picker is fair — and when it is not
What it does guarantee
- Every item has exactly the probability you set, independently of every other item.
- No item's inclusion tells you anything about any other item's — which is precisely the property a per-item decision needs.
- The result size is honest: it varies, and the tool shows the variation rather than smoothing it.
What it does not
- It does not guarantee a sample size, so it is the wrong tool when you need exactly n.
- An empty result is possible and expected at low probabilities over short lists.
- Nothing balances across runs. An item can be picked three times running, or skipped ten times running.
Two worked examples
50 items at 20%
- Expected size is 10, with a standard deviation of about 2.8.
- Roughly two runs in three land between 7 and 13; sizes of 4 or 17 are unremarkable.
- The chance of an empty result is 0.8 to the power 50, which is about one in 70,000 — effectively never at this list length.
10 items at 20%
- Expected size is 2, and the spread is proportionally much wider.
- The chance of getting nothing at all is 0.8 to the power 10 = 10.7%, which is about one run in nine.
- This is where the difference from a fixed-size sampler becomes impossible to ignore.
When per-item independence is the right model
Spot checks where each unit independently either gets inspected or does not are the cleanest fit. A twenty percent inspection rate genuinely means each item has a one-in-five chance, which is a different and often more defensible policy than inspecting exactly twenty percent of the batch.
Staged rollouts work the same way: each user, independently, is either in the new experience or not. Choosing exactly ten percent of users would require coordinating across the whole population, which is both harder and a worse model of what the rollout is doing.
Randomised task assignment uses it where the total workload should vary naturally rather than being forced to a number — a duty rota where each shift independently has a chance of falling to you produces a different and sometimes fairer pattern than one that guarantees everyone exactly four.
If you need exactly n items, the random sample tool is the right one and will say so. If the items should not all have the same probability, the weighted random picker handles per-entry odds, though for one winner rather than a subset.
Frequently asked questions
Why is the result size different every time?
Because each item is tested independently and nothing coordinates the total. The size is a random variable, not a target — that is the defining feature of this tool.
Is an empty result a bug?
No. At 20% over ten items an empty result happens about once in nine runs. Silently redrawing would misrepresent the process.
How is this different from drawing 20% of the list?
Drawing exactly 20% makes the items dependent — the last pick is constrained by all the earlier ones. Here each item's outcome depends only on its own draw.
Can the same item be picked in consecutive runs?
Yes, and it will be about p² of the time. Nothing balances across runs, because balancing would create the dependency this model avoids.
What does the expected size actually promise?
Only a long-run average. On any single run it is a centre of gravity, not a prediction.
Why show the sizes of previous runs?
Because the spread is the thing people find surprising, and five numbers in a row demonstrate it faster than any explanation.
Can I set the probability above 99% or below 1%?
The slider covers 1 to 99. Outside that the answer is effectively everything or nothing, and a subset tool is not what you want.
Does a longer list make the size more predictable?
Relatively, yes. The absolute spread grows with the square root of the list length while the expected size grows linearly, so the proportional variation shrinks.
Is this the same as flipping a coin per item?
Exactly that, with a coin biased to your chosen probability. That is the whole implementation.