[ create a new paste ] login | about

Link: http://codepad.org/dnDPKXX7    [ raw code | output | fork ]

johannes - Haskell, pasted on Jan 22:
1
2
3
4
5
6
7
8
9
module Main where

choose n 0 = 1
choose 0 k = 0
choose n k = choose (n-1) (k-1) * n `div` k 

multichoose n k = (n + k - 1) `choose` k

main = do print $ 5 `multichoose` 3


Output:
1
35


Create a new paste based on this one


Comments: