# Path: simplestatistics/statistics/factorial.py
# def factorial(x):
#     """
#     The factorial_ (denoted :math:`n!`) is the product of all positive
#     integers less than or equal to a positive integer (:math:`n`).
# 
#     .. _factorial: https://en.wikipedia.org/wiki/Factorial
# 
#     Equation:
#         .. math::
#             n! = \\prod_{k=1}^n k
# 
#     Args:
#         x: A numeric built-in object, or a list of numeric built-in objects for :math:`n`
# 
#     Returns:
#         A numerical (int) object.
# 
#     Examples:
# 
#         >>> factorial(5)
#         120
#         >>> factorial(1)
#         1
#         >>> factorial(20)
#         2432902008176640000
#         >>> factorial([1, 5, 20])
#         [1, 120, 2432902008176640000]
# 
#         >>> factorial(-2)
#         Traceback (most recent call last):
#             ...
#         ValueError: factorial() expects a positive integer.
#         >>> factorial(4.5)
#         Traceback (most recent call last):
#             ...
#         TypeError: factorial() expects a positive integer or list of positive integers.
#         >>> factorial([2, 3, 'a'])
#         Traceback (most recent call last):
#             ...
#         ValueError: Perhaps you provided a list that contains non-integers.
#     """
# 
#     if type(x) is int:
#         if x < 0:
#             raise ValueError('factorial() expects a positive integer.')
# 
#         return(obtain_factorial(x))
#     elif type(x) is list:
#         try:
#             products = []
#             for element in x:
#                 products.append(obtain_factorial(element))
# 
#             return(products)
#         except:
#             raise ValueError('Perhaps you provided a list that contains non-integers.')
#     else:
#         raise TypeError('factorial() expects a positive integer or list of positive integers.')


from .factorial import factorial
    :math:`k` elements, regardless of their order, from a set of :math:`n`
    elements?".

    Equation:
        .. math::
            \\frac{n!}{k! (n - k)!}

    Args:
        n: An integer.
        k: An integer.

    Returns:
        An integer.

    Examples:

        >>> choose(5, 3)
        10

        >>> choose(2.1, 5)
        Traceback (most recent call last):
            ...
        TypeError: choose() expects both n and k to be integers
    """

    # choose works with integers
    if type(n) is float or type(k) is float:
        raise TypeError('choose() expects both n and k to be integers')

    numerator = factorial(n)

# Path: simplestatistics/statistics/factorial.py
# def factorial(x):
#     """
#     The factorial_ (denoted :math:`n!`) is the product of all positive
#     integers less than or equal to a positive integer (:math:`n`).
# 
#     .. _factorial: https://en.wikipedia.org/wiki/Factorial
# 
#     Equation:
#         .. math::
#             n! = \\prod_{k=1}^n k
# 
#     Args:
#         x: A numeric built-in object, or a list of numeric built-in objects for :math:`n`
# 
#     Returns:
#         A numerical (int) object.
# 
#     Examples:
# 
#         >>> factorial(5)
#         120
#         >>> factorial(1)
#         1
#         >>> factorial(20)
#         2432902008176640000
#         >>> factorial([1, 5, 20])
#         [1, 120, 2432902008176640000]
# 
#         >>> factorial(-2)
#         Traceback (most recent call last):
#             ...
#         ValueError: factorial() expects a positive integer.
#         >>> factorial(4.5)
#         Traceback (most recent call last):
#             ...
#         TypeError: factorial() expects a positive integer or list of positive integers.
#         >>> factorial([2, 3, 'a'])
#         Traceback (most recent call last):
#             ...
#         ValueError: Perhaps you provided a list that contains non-integers.
#     """
# 
#     if type(x) is int:
#         if x < 0:
#             raise ValueError('factorial() expects a positive integer.')
# 
#         return(obtain_factorial(x))
#     elif type(x) is list:
#         try:
#             products = []
#             for element in x:
#                 products.append(obtain_factorial(element))
# 
#             return(products)
#         except:
#             raise ValueError('Perhaps you provided a list that contains non-integers.')
#     else:
#         raise TypeError('factorial() expects a positive integer or list of positive integers.')


# Path: simplestatistics/statistics/choose.py
from .factorial import factorial

    :math:`k` elements, regardless of their order, from a set of :math:`n`
    elements?".

    Equation:
        .. math::
            \\frac{n!}{k! (n - k)!}

    Args:
        n: An integer.
        k: An integer.

    Returns:
        An integer.

    Examples:

        >>> choose(5, 3)
        10

        >>> choose(2.1, 5)
        Traceback (most recent call last):
            ...
        TypeError: choose() expects both n and k to be integers
    """

    # choose works with integers
    if type(n) is float or type(k) is float:
        raise TypeError('choose() expects both n and k to be integers')

    numerator = factorial(n)

    denomerator = factorial(k) * factorial(n - k)