nCk function
binomial coefficients
Implementation
double nCk(num n, num k) {
double count = n.toDouble();
if (k > count) return 0;
if (k == 0) return 1;
double coEff = 1;
for (int i = 1; i <= k; i++) {
coEff *= count;
coEff /= i;
count--;
}
return coEff;
}