-
Notifications
You must be signed in to change notification settings - Fork 0
binomial
Subhajit Sahu edited this page Aug 8, 2022
·
17 revisions
Find the number of ways to choose k elements from a set of n elements.
Similar: factorial, binomial, multinomial.
function binomial(n, k)
// n: elements in source set
// k: elements in choose set
const xmath = require('extra-math');
xmath.binomial(4, 1);
// → 4
xmath.binomial(4, 2);
// → 6
xmath.binomial(4, 3);
// → 4