def binomial(n, k, factorial):
    """Returns C(n,k) = n!/(k!(n-k)!)."""
    assert n >= 0 and k >= 0 and n >= k, 'n and k should be non-negative integers with n >= k.'
    c = factorial[int(n)] / (factorial[int(k)] * factorial[int(n - k)])
    return c
