Group Abstract Group Abstract

Message Boards Message Boards

Solving a Log equation with NSolve

GROUPS:
x1 =  Sqrt[2 \[Pi] n] (n/Exp[1])^n;
x2 = (n/Exp[1])^n;
x3 = n^n;
x4 = 2;
NSolve[(Log[n!] - Log[ x4])/Log[n!] <= 0.01, n]
Hello,

I would solve the equation on the top. But NSolve gives no output. I need the solution for x1,..,x3. x3 is simple and works.

Thanks for your help!
Niklas
POSTED BY: Niklas Casper
Answer
11 months ago
If you change the .01 to 10^-2, you get a message that the system cannot be solved with the methods available to NSolve.
POSTED BY: Frank Kampas
Answer
11 months ago
x =  {Sqrt[2 \[Pi] n] (n/Exp[1])^n, (n/Exp[1])^n, n^n};
test = {4, 90, 10^10};
lsg = Flatten[
  Table[FindRoot[(Log[n!] - Log[ x[[i]]])/Log[n!] == 10^-2, {n,
     test[[i]]}], {i, 3}]]
Table[Abs[N[(Log[n!] - Log[ x[[i]]])/Log[n!] /. lsg[[i]]]], {i, 3}]
Now I'm using FindRoot, this maybe works. But the third and last value is for different third elements of test differently. Because of the Precision?

Regards,
Niklas Casper
POSTED BY: Niklas Casper
Answer
11 months ago
The third value is the first two values times Sqrt[10.].
Is there an extra factor of ten in the formulas?
POSTED BY: Bruce Miller
Answer
11 months ago
That third eqn cannot have a positive root. Log[n!] (or LogGamma[n+1]) is always smaller than n*Log, so the lhs will be negative for n>0.
POSTED BY: Daniel Lichtblau
Answer
11 months ago