Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was plotting the relative error of the $e^{11/12 -n}n^{n+1/2}$ approximation to the factorial as $n$ gets larger and larger and at after some very large value of $n$ mathematica gives this plot:

enter image description here

Can somebody explain what exactly it means? Of course, I understand that for larger and larger $n$ the relative error tends to a value but I am not sure about how to interpret this graph. In particular, I don't understand how can the error be bigger for some $n$ than for some greater $n$.


Edit: I want to add that when $n$ is an order of magnitude less what I get is something like this: enter image description here

share|cite|improve this question
up vote 2 down vote accepted

It is possible for the first plot that you are hitting the limit of numerical precision in Mathematica - for large $n$ you are subtracting two very large numbers (for the absolute error, not the relative error) so it is possible that you are losing precision when you get to these values. The resulting rounding errors would cause the spikes in the $\delta(n!)$ function.

If there's a way of increasing the number of digits in the floating point representations, try that to see whether this reduces the spikes. Mathematica allows arbitrary precision numbers, so I would look those up and see if you can rewrite your calculation to include more significant digits.

share|cite|improve this answer
Thanks for your answer. I tried to increase the precision and it worked (it gives a regular shape). I was just curious whether this had any mathematical meaning or it was just an error with mathematica. Again, thanks! – Ryuky Dec 10 '12 at 1:35
@Ryuky: So, looks like you're satisfied with the answer, why not accept it? – Ruslan Apr 5 '13 at 20:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.