- Labeled balls → labeled urns: n=10, k=3, empty allowed ⇒
3^10. - Unlabeled balls → labeled urns: n=10, k=3, empty allowed ⇒
C(12,2). - Labeled balls → unlabeled urns: n=8, k=3, all nonempty ⇒
S(8,3). - Unlabeled balls → unlabeled urns: n=9, k=3, all nonempty ⇒ partitions
p(9,3).
| Scenario | n | k | Model | Formula |
|---|---|---|---|---|
| Functions | 5 | 2 | Labeled → Labeled | k^n |
| Surjections | 6 | 3 | Labeled → Labeled | k!·S(n,k) |
| Stars & bars | 7 | 4 | Unlabeled → Labeled | C(n+k-1,k-1) |
| Partitions | 8 | 3 | Unlabeled → Unlabeled | p(n,k) |
| Bounded bins | 10 | 3 | Unlabeled → Labeled | IE on bounds |
- Labeled balls → labeled urns (empty allowed): k^n.
- Labeled balls → labeled urns (all nonempty): k!·S(n,k).
- Unlabeled balls → labeled urns (empty allowed): C(n+k-1,k-1).
- Unlabeled balls → labeled urns (all nonempty): C(n-1,k-1) for n≥k.
- Unlabeled balls → labeled urns with bounds: inclusion–exclusion for L≤xi≤U and Σxi=n.
- Labeled balls → unlabeled urns: S(n,k) or Σ S(n,j).
- Unlabeled balls → unlabeled urns: partitions p(n,k) or summed for “at most”.
Outputs use big integers to avoid overflow.
- Enter n and k.
- Select labeled/unlabeled options for balls and urns.
- Choose whether empty urns are allowed.
- Optionally set bounds when using unlabeled balls.
- Press Compute, then export CSV or PDF.
1) What does “labeled” mean here?
Labeled means distinguishable. Swapping labels changes the outcome. Unlabeled means only the structure matters, like group sizes or counts.
2) When should I choose “unlabeled urns”?
Choose unlabeled urns when urn identities do not matter. For labeled balls, results follow Stirling numbers. For unlabeled balls, results follow integer partitions.
3) Why does “all nonempty” sometimes give zero?
If every urn must be used but you have fewer balls than urns, it is impossible. Example: n=3, k=5 cannot fill all urns.
4) What are Stirling numbers doing in this tool?
S(n,k) counts partitions of n labeled items into k nonempty unlabeled groups. It also gives surjections to labeled urns via k!·S(n,k).
5) What do the bounds L…U apply to?
Bounds are implemented for unlabeled balls into labeled urns. They count integer solutions to x1+…+xk=n with L≤xi≤U, using inclusion–exclusion.
6) Why are some capacity cases noted as not supported?
Capacity bounds with labeled balls or unlabeled urns often need heavier specialized methods. This version focuses on fast, exact classic families.
7) How can I reuse the result in a report?
Include the model name, the shown formula, and your n and k values. Exported CSV/PDF provides a compact appendix for reproducibility.