multcoef | R Documentation |
Computes the number of permutations of a multiset M
of size n
.
multcoef(n, counts)
n |
The size of |
counts |
The counts for the repeated elements. |
For a set M
with k
unique elements with associate counts
n_1, n_2, \ldots, n_k
, you only need to specify in the counts
argument the counts that are bigger than 1.
It returns the multinomial coefficient
\frac{n!}{n_1!n_2! \ldots n_k!}
where
n = n_1 + n_2 + \ldots + n_k.
Raúl Eyzaguirre.
# The number of permutations of the letters in the set M = {A, A, A, B, B, C}
multcoef(6, c(3, 2, 1))
# Same result with
multcoef(6, c(3, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.