Skip to content

multinomial

Subhajit Sahu edited this page Aug 9, 2022 · 2 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 xnumber = require('extra-number');


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

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

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


References

Clone this wiki locally