The multinomial coefficient is a generalization of the binomial coefficient. Given a list of number $k_1,\ldots,k_l$, the multinomial coefficient is $n!/(k_1!\ldots,k_l!)$ where $n = \sum k_i$. The multinomial coefficient is calculated because it gives the numbers of tabloids for a given partition.
The list of numbers used to calculate the multinomial can be given as a list, a partition or a tally. This last option was added to optimize this calculation.
i1 : p = new Partition from {2,2} o1 = Partition{2, 2} o1 : Partition |
i2 : tabloids p o2 = {| 0 1 |, | 0 2 |, | 0 3 |, | 1 2 |, | 1 3 |, | 2 3 |} | 2 3 | | 1 3 | | 1 2 | | 0 3 | | 0 2 | | 0 1 | o2 : TableauList |
i3 : multinomial {2,2} o3 = 6 |
i4 : multinomial tally {2,2} o4 = 6 |
The object multinomial is a method function.