python/data_mining/graph.py
def binomial(n, k):
    """Computes the binomial coefficient "n over k".
    """
    if k == n:
        return 1
    if k == 1:
        return n
    if k > n:
        return 0
    return math.factorial(n) // (
        math.factorial(k) * math.factorial(n - k)
    )
Computes the binomial coefficient "n over k".
    
Computes the binomial coefficient "n over k".
Computes the binomial coefficient " n over k " .
def binomial(n, k):
    if k == n:
        return 1
    if k == 1:
        return n
    if k > n:
        return 0
    return math.factorial(n) // (
        math.factorial(k) * math.factorial(n - k)
    )
def binomial ( n , k ) : if k == n : return 1 if k == 1 : return n if k > n : return 0 return math . factorial ( n ) // ( math . factorial ( k ) * math . factorial ( n - k ) )
Computes the binomial coefficient "n over k".
Computes the binomial coefficient " n over k " .
"""Computes the binomial coefficient "n over k".
    """
n
k