Stirling approximation note During my study to Stirling approximation I find this formula  $n! \approx \sqrt{2\pi  n}  n^{n}e^{-n} $ but we know that  $ 0!  =1 $ And in this formula if we replace every  $ n $ with  $ 0$ we will have $ 0^0$ which is undefined.  My question is how we get  $0! $ by using this formula? ..  can anyone explain that for me.  I'll appreciate that..  thanks
 A: In general, mathematicians usually define $0^0=1$. 
There are good arguments for doing so, explained here.  
Also, you shouldn't use Stirling's approximation for such small $n$. 
A: Stirling's Asymptotic Expansion
As shown in this answer, a more precise asymptotic expansion is
$$
n!=\sqrt{2\pi n}n^ne^{-n}\left(1+\frac1{12n}+\frac1{288n^2}-\frac{139}{51840n^3}+O\left(\frac1{n^4}\right)\right)
$$
To understand what an asymptotic expansion is, consider the term $O\left(\frac1{n^4}\right)$. This means that there is a fixed constant, $C$, so that
$$
\left|\,n!-\sqrt{2\pi n}n^ne^{-n}\left(1+\frac1{12n}+\frac1{288n^2}-\frac{139}{51840n^3}\right)\,\right|\le\frac C{n^4}
$$
As you can see, the error of this asymptotic expansion can be very big when $n\approx0$, so this asymptotic expansion is most useful when $n$ is big.

$\boldsymbol{0^0}$
$0^0$ is considered to be an indeterminate form when computing the limit
$$
\lim\limits_{(x,y)\to(0,0)}x^y
$$
However $0^0$ is usually defined to be $1$.
In the second half of this answer a number of reasons are given as to why $0^0$ is usually defined to be $1$.


*

*$a^b$ counts the number of functions from a set of size $b$ to a set of size $a$. Since there is one function from the empty set to the empty set (the empty function), in this case, $0^0=1$.

*Often, when we encounter an exponent of $0$, it is in a term like $x^0=1$ or in a term like $e^x$ where $x=0$. It the latter case, this is definitely, $1$. However, $x^0$ is continuous at $0$ if we define $0^0=1$. This turns out to be the most useful value to assign to $0^0$ in most cases we encounter; e.g. polynomials, power series, the Binomial Theorem, etc.
Because this definition fits most of the common cases, this definition is the one commonly used.
A: The relation $n! \approx \sqrt{2\pi  n}\  n^n e^{-n}$ means $\lim\limits_{n\to\infty} \dfrac{\sqrt{2\pi n}\  n^n e^{-n}}{n!} = 1\vphantom{\frac{\int}{\displaystyle\sum}}$.  That means the ratio can be made as close to $1$ as desired by making $n$ big enough.  So nothing depends on what happens with small values of $n$.
