SOLUTION: how would you solve for n if you know what n! was?
Thanks,
James
Algebra.Com
Question 24809: how would you solve for n if you know what n! was?
Thanks,
James
Found 2 solutions by elima, kev82:
Answer by elima(1433) (Show Source): You can put this solution on YOUR website!
You need to post your question, I'm not sure what you are asking
=)
Answer by kev82(151) (Show Source): You can put this solution on YOUR website!
Hi James,
This is actually a really interesting question, I've spent most of this evening on it and although I've come up with some algorithms that get quite a good estimate, I havn't managed to get an exact solution.
I don't want to baffle you with some really difficult maths, so I won't say too much without knowing how far you are in school/university. I took four different approaches and here's what I came up with. If you would like to hear about any of them in detail then please email back, and tell me how much maths you know, and I'll try to explain them.
Let from now on.
1) Prime factorisation - Calculate the power of 2 in the prime factorisation of x, and call it p. Clearly and I think you'll find (Considering contributions of powers of 2 less than 2p) where Also where P is the largest prime in the factorisation. With these bounds and other properties like consecutive numbers are coprime, you shouldn't have too many cases to consider.
If you have a quick method for calculating prime factorisations (I'm thinking dynamic programming) then you could just start at 2 and subtract the powers of each natural's factorisation until you get one. At that point you've found n.
2) Take logs, and realise that
. Keep adding until your over, then you've got your answer. This is a computer solution in the making, especially if you use base 10(In base10 you can estimate log x as digits*log (first digit)). I reckon on the average home computer you should be able to work out about 10^5 logs per second, so this shouldn't take long at all.
3) Use the left and right rectangle estimates of
and the fact log is a convex function to deduce that
Using Newton-Raphson method you can solve the middle expression equal to log x. Then either floor(f) or ceil(f) is going to be your answer(I think I've proved this but it was very difficult, so might have made a mistake, regardless f is gonna be pretty close to n). The initial value for Newton-Raphson comes from stage one. To see what the convergence was like I tried a starting value of f=28 for 20! and I got to 20 almost immediatly, so it's pretty forgiving if you're wrong.
4) The Gamma function is the Complex extension of factorial. So any inverse of the Gamma function over naturals should be an inverse for factorial. I wouldn't be too hopeful with this idea though, have you seen the Gamma function!
Hopefully I've not confused you too much, but this is a very difficult question to answer. If you don't know calculus then ignore number 3&4, if you like computers then ask your teacher/lecturer about logorithms and try approach 2. Else learn about the fundamental theorem of arithmatic and try appproach one.
I doubt it, but I hope that was helpful in some way. I thought it better to write something than leave the question unanswered.
Kev
RELATED QUESTIONS
how would you solve this equation PV=nRT for... (answered by josgarithmetic)
My problem is as follows: {{{(n-2)(n-2)<0}}}
If you FOIL it it is n^2-4n+4<0, I need to... (answered by Alan3354)
Dear math teacher,
I am having difficulties with the following problem:
4 times nC2 (answered by Theo)
would you please explain to me how to solve the problem, 4m - n = m, for ,m ?
(answered by stanbon)
If n over 10 minus 8 equals 6. What is n, and how do you solve for... (answered by rfer)
Dear math teacher,
Would you please explain why n cannot equal -4 and 5 as a solution (answered by solver91311)
nP4=84nC2 Solve for n using factorial notation
I'm really struggling with this... (answered by ikleyn)
hey i would really appreciate it if you could solve this combinatorics problem for me:... (answered by stanbon)
I am not sure how to simplify this problem: {{{ (3^(n+2)-3^n)/(3^(n-1)+3^n) }}}
I know... (answered by Alan3354,solver91311)