Comment l'utiliser (3 étapes)
- Choose Composition or Partition, then pick the constraint you need.
- Enter n (and k/a/b when required), then select count, table, enumeration, or sample.
- Export CSV/TSV or copy a shareable URL for reuse.
Inputs
--
Table
Examples
Key formulas and notes
- Compositions count is 2^(n-1) for n >= 1, and k parts use C(n-1, k-1).
- Nonnegative k-part compositions use stars and bars: C(n+k-1, k-1).
- Partitions ignore order; use the Partition tab to compare counts.
- Enumeration is limited for speed; use samples for larger n.
FAQ
Quelle est la différence entre partitions et compositions ?
Partitions ignore order while compositions treat different orders as distinct.
Pourquoi le nombre de compositions vaut-il 2^(n−1) ?
Each of the n-1 gaps is a divider or not, giving 2^(n-1) combinations.
Comment compter les compositions avec exactement k parts ?
Select exactly k parts to compute C(n-1, k-1).
Quelle est la formule pour k parts non négatives ?
It is C(n+k-1, k-1), the stars and bars count.
Puis-je limiter les parts à un intervalle ?
Use bounded parts to restrict each part to [a, b].
Pourquoi l’énumération est-elle limitée pour les grands n ?
The number of compositions grows quickly, so enumeration is capped.
Puis-je calculer modulo m ?
Yes. Switch to modulo mode and enter the modulus.
Ces exemples utilisent-ils une graine fixe ?
Yes. The same seed reproduces the same list of samples.