Skip to content

Instantly share code, notes, and snippets.

@johnwalker
Created November 10, 2013 15:27
Show Gist options
  • Save johnwalker/7399510 to your computer and use it in GitHub Desktop.
Save johnwalker/7399510 to your computer and use it in GitHub Desktop.
#15
(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