Created
November 10, 2013 15:27
-
-
Save johnwalker/7399510 to your computer and use it in GitHub Desktop.
#15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns lattice-paths) | |
| (defn factorial [n] | |
| (reduce * (range 1N (inc n)))) | |
| (defn binomial-coefficient [n k] | |
| (/ (factorial n) | |
| (* (factorial k) (factorial (- n k))))) | |
| (binomial-coefficient 40 20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment