Como usar (3 passos)
- 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.
- Exportar CSV (arquivo de planilha)/TSV or Copiar a Compartilhável URL for reuse.
Entradas
--
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.
Perguntas frequentes
O que é the difference between partitions and compositions?
Partitions ignore order while compositions treat different orders as distinct.
Why is composition count 2^(n-1)?
Each of the n-1 gaps is a divider or not, giving 2^(n-1) combinations.
How Devo count compositions with exactly k parts?
Select exactly k parts to Calcular C(n-1, k-1).
O que é the nonnegative k-part formula?
It is C(n+k-1, k-1), the stars and bars count.
Posso restrict parts to a range?
Use bounded parts to restrict each part to [a, b].
Why is enumeration limited for large n?
The number of compositions grows quickly, so enumeration is capped.
Posso Calcular modulo m?
Yes. Switch to modulo mode and enter the modulus.
Do these samples use a fixed seed?
Yes. The same seed reproduces the same list of samples.