Created
June 7, 2017 20:16
-
-
Save baransu/e43e12de26ed4e855e34eadbf9993eb6 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
stirling :: Int -> Int -> Int | |
stirling n 0 = 0 | |
stirling n 1 = 1 | |
stirling n k | |
| n == k = 1 | |
| k > n = 0 | |
| otherwise = | |
stirling (n - 1) (k - 1) + k * stirling (n - 1) k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment