Stirling's approximation fractional error

31 Views Asked by At

Given Stirling's approximation $\ln N!$ is approximated by $N\ln N-N+\frac{1}{2}\ln N$. I want to calculate the fractional error that comes from neglecting the third term $\frac{1}{2}\ln N$ for $N=10$ and $N=100$. I thought it would be enough to consider $$\frac{\frac{1}{2}\ln N}{N\ln N-N+\frac{1}{2}\ln N}\ ,$$ but for $N=10$ I get $0.08$, while, according to my professor, the answer is $0.05$. I have an identical issue with $N=100$, where I get $0.006$ instead of $0.005$. Is there a problem with the way I am calculating the fractional error? I can't really see any other reason why I keep getting the wrong results.