Monday 15 July 2013

calculus - Approximation of the solution $n$ to the equation $n log n = 100,000$





How can I find an approximation value for the value of $n$ for which $$n \log(n)=100\,000$$ or each numeric value?


Answer



The solution of equation $$x \log(x)=a$$ is given in terms of Lambert function $$x=\frac{a}{W(a)}$$ In the Wikipedia page, you will find quite simple formulas for the approximation of Lambert function.



For example, for very large values of $a$ $$W(a) \approx L_1-L_2+\frac{L_2}{L_1}+\frac{L_2(L_2-2)}{2L_1^2}+\cdots$$ where $L_1=\log(a)$ and $L_2=\log(L_1)$.




For the case of $a=100000$, $L_1=11.5129$, $L_2=2.44347$ and the above formula would give $$W(100000)\approx 9.28337$$ so $x\approx10772.0$ while the exact solution would be $x\approx10770.6$. Adding more terms would improve the result.



Another way would be to consider $$f(x)=x\log(x)-a$$ $$f'(x)=1+\log(x)$$ and use Newton method which, starting from a guess $x_0$ will update it according to $$x_{k+1}=x_k-\frac{f(x_k)}{f'(x_k)}$$ which would write $$x_{k+1}=\frac{a+x_k}{\log (x_k)+1}$$ Let us consider again the case where $a=100000$ and let us be very lazy starting with $x_0=1$. Then the successive iterates of Newton method will be $$x_1=100001.$$ $$x_2=15983.5$$ $$x_3=10860.6$$ $$x_4=10770.6$$ which is the solution for six significant figures.



For sure, starting with a better estimate such as $$x_0=\frac{a}{\log(a)}$$ will make Newton method converging in less iterations as shown below $$x_0=8685.89$$ $$x_1=10793.6$$ $$x_2=10770.6$$



Edit



Using values $10^3 \leq a \leq 10^7$, I found, using a simple linear regression, than a good approximation is given by $$\log(x)=0.933231 \log(a)-1.52287$$ which will give as estimate $x_0=10110.7$.


No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...