Evaluate binomial coefficients
Straightforward translation of the formula:
func binomial(n,k) {
n! / ((n-k)! * k!)
}
say binomial(400, 200)
Alternatively, by using the Number.nok() method:
say 400.nok(200)
Straightforward translation of the formula:
func binomial(n,k) {
n! / ((n-k)! * k!)
}
say binomial(400, 200)
Alternatively, by using the Number.nok() method:
say 400.nok(200)