Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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$.

Thanks.

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|improve this question
add comment

1 Answer

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|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
add comment

Your Answer

 
discard

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.