Calculator Inputs
Formula Used
1) Success probability per draw:
p = K / N
2) Exact successes in n draws:
X ~ Binomial(n, p)
3) Exact probability:
P(X = x) = C(n, x) × px × (1 - p)n - x
4) Cumulative probability:
P(X ≥ t) = Σ P(X = i), for i = t to n
5) Ordered outcomes with replacement:
Total ordered samples = Nn
6) Unordered multisets with replacement:
Total multisets = C(N + n - 1, n)
7) Probability every draw is unique:
P(all unique) = [N × (N - 1) × ... × (N - n + 1)] / Nn, when n ≤ N
8) Expected number of unique values observed:
E(unique) = N × [1 - ((N - 1) / N)n]
How to Use This Calculator
- Enter the population size N. This is the count of equally possible values on each draw.
- Enter the sample size n. Since replacement is allowed, the same value can appear again.
- Set K, the number of population values you classify as successes.
- Set x for an exact-success probability and t for threshold-based cumulative probability.
- Press the calculate button. Results will appear above the form and under the page header.
- Use the CSV or PDF buttons to export the calculated summary.
- Read the Plotly graph to see how probability is distributed across all possible success counts.
Example Data Table
| Population N | Sample n | Success K | Exact x | Threshold t | P(X = x) | P(X ≥ t) | P(all unique) | Expected unique |
|---|---|---|---|---|---|---|---|---|
| 10 | 4 | 3 | 2 | 2 | 0.2646 | 0.3483 | 0.504 | 3.439 |
| 12 | 5 | 4 | 1 | 2 | 0.329218 | 0.539095 | 0.381944 | 4.233266 |
| 20 | 6 | 5 | 3 | 3 | 0.131836 | 0.169434 | 0.43605 | 5.298162 |
Frequently Asked Questions
1) What does sampling with replacement mean?
Each draw returns the selected item back to the population before the next draw. That keeps draw probabilities unchanged and allows repeated outcomes.
2) Why does this calculator use the binomial model?
When every draw has the same success probability and draws are independent, the number of successes across repeated draws follows a binomial distribution.
3) What is the difference between ordered samples and unordered multisets?
Ordered samples treat sequences differently, so AB and BA are distinct. Unordered multisets ignore order and only track how many times each value appears.
4) When is the all-unique probability equal to zero?
It becomes zero when the sample size exceeds the population size. With replacement, at least one repeated value must then occur.
5) What does expected unique values observed mean?
It is the average number of distinct population values you would expect to see after many repeated experiments using the same settings.
6) Can this calculator be used for repeated guessing or repeated testing?
Yes. It fits repeated independent draws where probabilities stay fixed, such as repeated guessing, randomized trials, or repeated category selections.
7) Why are exports useful here?
Exports make it easier to save scenario comparisons, document assumptions, share outputs with others, and reuse results in reports or coursework.
8) What inputs matter most for higher repeat risk?
Repeat risk grows when the sample size increases relative to the population size. Smaller populations and more draws make repeated outcomes much likelier.