Skip to content

multinomial

Subhajit Sahu edited this page Aug 8, 2022 · 17 revisions

Find the number of ways to put n objects in m bins (n=sum(kᵢ)).

Similar: factorial, binomial, multinomial.


function multinomial(...ks)
// ks: objects per bin (kᵢ)

const xmath = require('extra-math');


xmath.multinomial(1, 2);
// → 3

xmath.multinomial(1, 2, 3);
// → 60

xmath.multinomial(1, 2, 3, 4);
// → 12600


References

Clone this wiki locally