Created
March 25, 2016 22:56
-
-
Save Scinawa/75d9c683078b05fa1e1a to your computer and use it in GitHub Desktop.
stirling number of the second kind
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 stirling_second(x,n): | |
if n <= 1 or x == n: return 1 | |
if n > x or x <= 0: return 0 | |
return stirling_second(x-1, n-1) + n * stirling_second(x-1, n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment