I have a math website http://finitehelp.com that teaches students Finite Math. I thought it would be cool to include a calculator so I made one for combinations and permutat
As we know, combinations is short for:
So the fastest combinations implement is below:
function factorial(n) { let r = 1; while (n > 1) r *= n--; return r; } function combinations(n,r){ let s = 1; let i = r; while(i