Created
October 29, 2015 20:23
-
-
Save sbstp/925efddcc40af676f899 to your computer and use it in GitHub Desktop.
This file contains 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
(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