Created
September 23, 2016 15:16
-
-
Save RobertTalbert/b03aecd6d9ba9cba9973740ee54d54c1 to your computer and use it in GitHub Desktop.
Recursive function for the binomial coefficient
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
def rec_binom(n,k): | |
if (k == 0) or (n == k): return 1 | |
else: | |
return binom(n-1, k) + binom(n-1, k-1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment