import math


def stirling_factorial(n):
    """
    Returns the upper and lower bounds of Stirling's approximation of a factorial

    Parameters
    ----------
    n : int
        denotes the positive integer for which factorial needs to be approximated
    return : array
        return an array of length 2
        first element denotes lower bound
        second element denotes upper bound

    """
    if(n<0):
        raise NotImplementedError(
            "Enter a valid natural number"
        )
    arr = []
    lower = (math.sqrt(2*math.pi))*(math.pow(n,n+0.5))*(math.pow(math.e,-1*n))
    arr.append(lower)
    upper = (math.e)*(math.pow(n,n+0.5))*(math.pow(math.e,-1*n))
    arr.append(upper)
    return arr