Skip to content

Instantly share code, notes, and snippets.

@mikamix
Created March 20, 2014 14:22
Show Gist options
  • Save mikamix/9664808 to your computer and use it in GitHub Desktop.
Save mikamix/9664808 to your computer and use it in GitHub Desktop.
combination n r = factorial n `div` (factorial (n - r) * factorial r)
where factorial 1 = 1
factorial n = n * factorial (n - 1)
main = print $ combination 40 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment