Skip to content

Instantly share code, notes, and snippets.

@sbstp
Created October 29, 2015 20:23
Show Gist options
  • Save sbstp/925efddcc40af676f899 to your computer and use it in GitHub Desktop.
Save sbstp/925efddcc40af676f899 to your computer and use it in GitHub Desktop.
(define fact
(lambda (n)
(if (<= n 1)
1
(* n (fact (- n 1)))
)
)
)
(define perms
(lambda (n r)
(/ (fact n) (fact (- n r)))
)
)
(define choose
(lambda (n r)
(/ (perms n r) (fact r))
)
)
(display (choose 10 4))
(newline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment