Skip to content

multinomial

Subhajit Sahu edited this page Aug 9, 2022 · 1 revision

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 xbigint = require('extra-bigint');


xbigint.multinomial(1n, 2n);
// → 3n

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

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


References

Clone this wiki locally