Asked by Danielle
What is the inverse of a factorial and how would i calculate it.
E.g. 60000 = n!
How would i get n?
E.g. 60000 = n!
How would i get n?
Answers
Answered by
Count Iblis
You first take the log of both sides:
Log(60,000) = Log(n!)
Then you use the asymptotic expansion:
Log(n!) = n Log(n) - n
+ 1/2 Log(2 pi n) + 1/(12 n)
- 1/(360 n^3) + 1/(1260 n^5)- ...
You solve for n using the Newton Raphson method. If we put:
f(n) = Log(n!) then the derivative f'(n) has the expansion:
f'(n) = Log(n)+ 1/(2n)- 1/(12 n^2)
+ 1/(120 n^4) - 1/(252 n^6)+...
If we make some guess for n, then:
n - [f(n) - 60,000]/f'(n)
will be an improved guess which we can improve again using the above formula. A rough starting guess would be
n = Log(60,000) = about 11. The improved value for n will then be 8.34, the next is n = 8.185. Now 8.185! = 60,0031 so this is already pretty accurate!
Log(60,000) = Log(n!)
Then you use the asymptotic expansion:
Log(n!) = n Log(n) - n
+ 1/2 Log(2 pi n) + 1/(12 n)
- 1/(360 n^3) + 1/(1260 n^5)- ...
You solve for n using the Newton Raphson method. If we put:
f(n) = Log(n!) then the derivative f'(n) has the expansion:
f'(n) = Log(n)+ 1/(2n)- 1/(12 n^2)
+ 1/(120 n^4) - 1/(252 n^6)+...
If we make some guess for n, then:
n - [f(n) - 60,000]/f'(n)
will be an improved guess which we can improve again using the above formula. A rough starting guess would be
n = Log(60,000) = about 11. The improved value for n will then be 8.34, the next is n = 8.185. Now 8.185! = 60,0031 so this is already pretty accurate!
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.