Rdocumentation
powered by
Learn R Programming
algstat (version 0.0.2)
mchoose: Multinomial Coefficient
Description
Compute the multinomial coefficient.
Usage
mchoose(n, x)
Arguments
n
an integer
x
a vector of integers
Value
...
Details
This function computes the multinomial coefficient by computing the factorial of each number on a log scale, differencing log(n!) - sum(log(x!)), and then exponentiating. It then checks to see if this is an integer; if it's not, it issues a warning.
Examples
Run this code
mchoose(
6
,
c
(
2
,
2
,
1
,
1
))
Run the code above in your browser using
DataLab