Section 1.4 Ordered Partitions
ΒΆConsider a set of \(n\) distinct objects to be partitioned into \(k\) different sets, with sizes \(n_1,\,n_2,\,n_3,\dots,\,n_k\text{,}\) where \(n_1+n_2+n_3+\cdots+n_k=n\text{.}\) Implicit in this description is that the order of the \(k\) sets is important. The number of ways to do this is the multinomial coefficient
\begin{equation*}
\multinomial{n}{n_1,\,n_2,\dots,\,n_k}=\frac{n}{n_1!n_2!\dots n_k!}
\end{equation*}
For a multinomial coefficient in Sage, you specify the \(n_1,\,n_2,\,n_3,\dots,\,n_k\) in a Python list using square brackets, such as [3, 4, 2]
and the value of \(n\) is implied (9
in this example), and so is not part of your input.
A multinomial coefficient with \(k=2\) is really just a binomial coefficient.