Learn R Programming

iterpc (version 0.2.6)

multichoose: Calculate mulinomial coefficient

Description

This function calculate the multinomial coefficient $$\frac{(\sum n_j)!}{\prod n_j!}.$$ where $n_j$'s are the number of multiplicities in the multiset.

Usage

multichoose(n)

Arguments

n
a vector of group sizes

Value

  • multinomial coefficient

Details

The result is not reliable if the retunred value is too large (around 2^53) due to limition of integers.

Examples

Run this code
# (3+1+1)!/ (3! 1! 1!) = 20
multichoose(c(3,1,1))

Run the code above in your browser using DataLab