DRAWCHANCE FIELD NOTES
From a bag of items
to an exact fraction.
A probability is only useful when its event and assumptions are clear. This guide follows one small draw all the way from individually counted pairs to the fraction shown by the calculator.
A ten-item example you can count
Imagine ten individually labelled tokens. Three are target tokens, T1, T2 and T3. The seven others are O1 through O7. Draw two tokens, without returning the first before taking the second. Assume every two-token subset is equally likely. We want the probability that the pair contains at least one target.
There are 45 unordered pairs in total: 10 × 9 ÷ 2. Division by two removes the duplicate orderings, because the pair T1/O1 is the same subset as O1/T1. This tool asks only how many targets occur, not which token appeared first.
No targets: choose both from the seven others. There are 7 × 6 ÷ 2 = 21 such pairs.
One target: choose one of the three targets and one of the seven others. There are 3 × 7 = 21 such pairs.
Two targets: choose two of the three targets. There are 3 × 2 ÷ 2 = 3 such pairs.
The three groups contain 21 + 21 + 3 = 45 pairs, accounting for every possible subset exactly once. Their probabilities are 21/45 = 7/15, 21/45 = 7/15 and 3/45 = 1/15. “At least one” includes the one-target and two-target groups. That gives 24/45 = 8/15, displayed as 53.333333% rounded.
For the same inputs, “exactly one” is 7/15, and “at most one” is 14/15. Notice that both inclusive tail queries include their entered boundary. You can check the shaded rows in the result table rather than relying on a potentially ambiguous phrase such as “more than one”.
The model: known population, uniform subsets
The four entered counts have different jobs. N is the total number of individual items available before the draw. K is the number of those items classified as targets. The draw takes n items. The query asks about k targets among those n items. The remaining N − K items form one other category.
The probability model is called the hypergeometric distribution. Its definition concerns a known finite population sampled without replacement; the count probability uses a product of two combination counts divided by the number of all size-n subsets. This is the model documented in the NIST Dataplot HYPPDF reference. Drawchance independently uses bounded exact integer combinations; it does not reproduce that software's approximation algorithms.
Each physical object must be counted separately. If five identical-looking red counters are in a bag, they still contribute five distinct items to N and, if red is the target, five to K. The grouping records category counts, while the uniform assumption applies to subsets of individual objects.
“Uniform” means that every possible subset of n individual items is equally likely. Entering counts here cannot establish that your bag is mixed fairly, that objects have equal selection chances, or that a sample method meets this assumption. The result is conditional on the model you provide. There is no observation, sensor, simulation or randomness test behind it.
If a selected item is put back before the next selection, its availability changes. That is a replacement model, so the subset calculation here no longer describes it. Unequal weights, ordered events, changing composition and more than two separately tracked categories are also outside this calculator. Do not silently use this result for them.
Which target counts are even possible?
The smallest feasible count is max(0, n − (N − K)). You cannot fill a draw using more other items than actually exist. The largest feasible count is min(n, K): the draw cannot contain more targets than its own size or the target population. These bounds are called the support of the distribution.
For N = 10, K = 3 and n = 5, the feasible counts are 0 through 3. Querying exactly 4 is still a valid mathematical question because 4 lies within 0–n. Its answer is exactly zero, since only three targets exist. The table shows feasible counts only; it does not manufacture an extra positive row for an impossible count.
For a different example, take N = 5, K = 2 and n = 4. Only three other items exist, so at least one of the four selected items must be a target. The support is 1 through 2. “At most zero” has probability zero. “At least zero” has probability one because every feasible outcome satisfies that event.
Zero-sized and full-sized draws remain meaningful. Drawing nothing gives exactly zero targets with certainty. Drawing every item gives exactly K targets with certainty. If K is zero, all draws contain zero targets. If K equals N, all n selected items are targets. None of these cases needs an approximation or a missing result.
The general count calculation
Write C(a,b) for the number of b-item subsets of a distinct items. For a feasible target count x, choose x of the K targets and n − x of the N − K other items. Multiplying these choices gives C(K,x) × C(N − K,n − x) favourable subsets. Dividing by C(N,n) gives the exact probability.
The “exactly” query selects one row. “At most k” adds the probabilities for all feasible x ≤ k; “at least k” adds all feasible x ≥ k. Finite cumulative sums are the basis of the NIST Dataplot HYPCDF definition. Here, row counts share a common exact subset denominator, so the selected favourable counts can be summed as integers before reducing the result.
A second check uses N = 5, K = 2 and n = 3. There are ten possible subsets. Exactly zero targets occurs in one subset, exactly one in six, and exactly two in three. The probabilities are 1/10, 3/5 and 3/10. They add to one, and “at least one” is 9/10. This example also shows why a table of all feasible outcomes helps reveal an omitted count or mistaken inclusive boundary.
Impossible is not the same as very rare
The calculation uses JavaScript BigInt integers for combination counts, favourable counts and reduced fractions. It does not first calculate floating-point factorials or replace the model with a normal or binomial approximation. The population is limited to 500 as a software bound, not a statement about a suitable real-world sample size.
Consider N = 500, K = 250, n = 250 and exactly 250 targets. There is one favourable subset: all 250 targets. The denominator is C(500,250), a very large integer. Its reciprocal is strictly positive. The report preserves that full denominator even though a conventional six-decimal percentage would appear to be zero.
Percentages are rounded to six decimal places. A positive probability whose rounded percentage would be zero is labelled “<0.000001% (positive)”. A probability below one whose rounded percentage would be 100% is labelled “>99.999999% (less than 100%)”. Exact zero and exact certainty receive explicit exact labels. The reduced fraction always takes precedence over the rounded display.
The small blue bars are a visual aid using finite drawing coordinates. An extremely short bar may be visually indistinguishable from no width on a screen. The adjacent percentage and exact fraction remain the numerical record; bar visibility is not a zero-probability test.
An expectation is not a promised result
The expected target count is nK/N. In the ten-item example, it is 2 × 3/10 = 3/5, or 0.6. A single two-token draw cannot contain 0.6 of a token. The expectation is the model mean over repeated equivalent draws, with the original population restored before each new draw, not a prediction for the next draw.
You can also check the mean using the entire table: multiply each target count by its probability and add. The example gives 0 × 7/15 + 1 × 7/15 + 2 × 1/15 = 9/15 = 3/5. That independent weighted-sum check agrees with nK/N.
Neither the expectation nor a small tail probability establishes a process-acceptance decision, an inference about an unknown population, a payoff, a confidence interval or the likely history of a real drawing process. This tool intentionally answers the entered count question and stops there.
Keep the assumptions with the answer
Copy report and Download text include the four counts, query, favourable subset count, all-subset count, reduced probability, expectation and every feasible probability row. Download CSV includes raw integer numerator and denominator columns so a very small positive result can be retained without spreadsheet percentage rounding.
A spreadsheet may automatically reinterpret long integers as rounded numeric cells when importing CSV. If you need all digits preserved there, import the numerator and denominator columns as text. The original downloaded file itself contains the exact digits. The plain-text report is another way to keep the exact fraction visible.
All calculations and report creation run in your browser. Nothing is uploaded, no account is needed and no actual draw is performed. Editing any count or query immediately replaces the result if valid; invalid input clears the result, table, fallback copy area and usable export actions. Restore example returns to N = 10, K = 3, n = 2, at least 1.
If your browser denies clipboard access, the current report appears in a labelled text area for manual copying. If you change inputs while clipboard work is pending, the app suppresses a stale success or fallback message. It cannot revoke text that a browser has already written to your operating-system clipboard.
Open the calculator