Is it easier to calculate a factorial or the inverse of a factorial (1/n!) for extremely large n?

274 Views Asked by At

I need to calculate extremely large factorials but they grow extremely fast! I was wondering if it might be easier to calculate $\frac{1}{n!}$ rather than n! itself because as n goes to infinity $\frac{1}{n!}$ goes to zero, which I think may be easier to calculate. Is it easier to calculate the factorial or the inverse of it?

2

There are 2 best solutions below

0
On BEST ANSWER

The period of the repeating decimal of $\frac{1}{n!}$ can be very large, closer to $n!$ than to the number of digits in $n!$. For example, $\frac{1}{19!}$ has period $81648$ even though there are only $18$ digits in $19!$ itself. And we would need to calculate $36$ digits of $\frac{1}{19!}$ to see that it differs from $\frac{1}{19!+1}$. So this doesn't seem like a very promising strategy.

1
On

why do you want to calculate n! in the first place?
most times you will devide it by other factorials and then it is better to wait with calculating till the formula contains as least factors as possible for example if you have to calculate n! / ((n-k!) X k!) don't start with calculating n!