def choose(population, sample):
    """
    Returns  ``population`` choose ``sample``, given
    by: n! / k!(n-k)!, where n == ``population`` and
    k == ``sample``.
    """
    if sample > population:
        return 0
    s = max(sample, population - sample)
    assert s <= population
    assert population > -1
    if s == population:
        return 1
    numerator = 1
    denominator = 1
    for i in range(s+1, population + 1):
        numerator *= i
        denominator *= (i - s)
    return numerator/denominator