binomial

fun binomial(n: Int, k: Int): Int

Returns the binomial coefficient of n choose k.

Return

The number of ways to choose k items from n items

Parameters

n

The number of items

k

The number of items to choose

Throws

If k is negative or k is greater than n