description="""a module to compute "greedy" confidence intervals for several distributions"""

#===================================================================================================

import numpy as np

#===================================================================================================
# BASIC UTILITIES
#===================================================================================================

def factorial(n, nmax=100):
    """
    if n<nmax:
        compute factorial directly
    else:
        use Sterling's approximation
    """
    if n == 0:
        return 1
    elif n < nmax:
        return n*factorial(n-1, nmax=nmax)
    else:
        print "WARNING: you don't quite have Sterling's approximation correct..."
        return n**n - n ### THIS CAN BE IMPROVED

def log_factorial(n, nmax=100):
    """