Count grouped arrangements with multinomial
multinomial counts arrangements of items divided into several labelled groups. It generalizes binomial coefficients: for group sizes n₁, n₂, and so on, the count is total factorial divided by each group factorial.
Example
It counts distinct arrangements of repeated letters or ways to assign distinguishable items to fixed group sizes. Compare combinations for one selected group and composition for distributions of identical items. factorial defines the underlying formula.
Caveats
Group sizes should be non-negative integers. They must add to the stated total when a total is supplied. Results grow fast, so retain exact arithmetic where possible and use lgamma for stable log-scale probability calculations.