Skip to content

Instantly share code, notes, and snippets.

@RobertTalbert
Created September 23, 2016 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertTalbert/b03aecd6d9ba9cba9973740ee54d54c1 to your computer and use it in GitHub Desktop.
Save RobertTalbert/b03aecd6d9ba9cba9973740ee54d54c1 to your computer and use it in GitHub Desktop.
Recursive function for the binomial coefficient
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