(defn choose
"
Returns number of k-combinations (each of size k) from a set S with
n elements (size n), which is the binomial coefficient (also known
as the 'choose function') [wikipedia]
choose = n!/(k!(n - k)!)
Equivalent to R's choose function.
Examples:
(choose 25 6) ; => 2,598,960
References:
http://incanter.org/docs/parallelcolt/api/cern/jet/math/tdouble/DoubleArithmetic.html
http://en.wikipedia.org/wiki/Combination
"
([n k] (DoubleArithmetic/binomial (double n) (long k))))
Used in 0 other vars
Comments top
No comments for choose. Log in to add a comment.