# How to solve $8n^2=64n\cdot \log_2(n)$?

1,064

## Solution 1

You may simplify $n$ from both sides ($n=0$ is not an acceptable solution) to get $$8n=64\log_2{n}\iff \frac{8n}{64}=\log_2{(n)}\iff2^{\frac{n}8}=2^{\log_2(n)}\iff 2^{\frac{n}{8}}=n\iff2^n=n^8$$ So, you are looking for the zeros of $f(n)=2^n-n^8$. This function has two solutions, which are approximately $n_1=1.0999$ and $n_2=43.559$. However, I do not think that there are methods other than numerical that can solve this problem.

## Solution 2

We certainly cannot have $n=0$, so a division is safe. Upon dividing by $8n$ we obtain

$$n = 8 \log_2 n$$

which is a nonlinear equation. You can try fixed-point methods or even Newton's Method to solve this. As Jimmy says, I don't think this can be done analytically.

## Solution 3

Instead of numerical methods, you can also express the solution in terms of the Lambert W function. In some sense, you can think of this idea as someone has tabulated the solution to the Lambert W function numerically and you are simply reusing his work. The W function is defined by the relation, $W(z e^z) = z$. Another way to understand this relation is that if $W(k) = z$ then $k = z e^z$.

$n = 8\log_2(n) \Leftrightarrow \frac{n}{8} = \frac{\ln(n)}{\ln(2)} \Leftrightarrow -\frac{\ln(2)}{8} = -\ln(n)\frac{1}{n} \Leftrightarrow -\frac{\ln(2)}{8} = \ln(\frac{1}{n})e^{\ln(\frac{1}{n})}$

Thus by noting that $z = \ln(\frac{1}{n})$ and $k = -\frac{\ln(2)}{8}$, we get

$W(-\frac{\ln(2)}{8}) = \ln(\frac{1}{n}) \Leftrightarrow n = e^{-W(-\frac{\ln(2)}{8})}$

## Solution 4

Consider the equation $$0=8x^2-64x\, \log_2(x)=8x(x-8\;\log_2(x))=8 x \left(x-\frac{8 \log (x)}{\log (2)}\right)$$ So, there is the trivial solution $x=0$.

Now, consider the function $$f(x)=x-\frac{8 \log (x)}{\log (2)}\implies f'(x)=1-\frac{8}{x \log (2)}\implies f''(x)=\frac{8}{x^2 \log (2)}$$ The first derivative cancels at $x=\frac{8}{\log (2)}$ and the second derivative test shows that this point corresponds to a minimum $$f\left(\frac{8}{\log (2)}\right)=\frac{8 }{\log (2)}\left(1+\log \left(\frac{\log (2)}{8}\right)\right)\approx -16.6886 <0$$ So, there are two roots to $f(x)=0$.

As already said in comments and answers, to compute the roots, one of the solutions is based on numerical methods (Newton being probably the simplest). A quick plot of the function shows a root close to $1$ and another close to $50$.

Starting at a "reasonable" guess $x_0$, Newton method will update it according to $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$ In your case, this would give $$x_{n+1}=\frac{8 x_n (\log (x_n)-1)}{x_n \log (2)-8}$$

For the first root, let us start using $x_0=1$. Newton method will generate the following iterates $$\left( \begin{array}{cc} n & x_n \\ 0 & 1.0000000000000000000 \\ 1 & 1.0948626170101320293 \\ 2 & 1.0999837708827475300 \\ 3 & 1.0999970301492763006 \\ 4 & 1.0999970302376094009 \end{array} \right)$$

For the second root, let us start using $x_0=50$. Newton method will generate the following iterates $$\left( \begin{array}{cc} n & x_n \\ 0 & 50.000000000000000000 \\ 1 & 43.695596437287775210 \\ 2 & 43.559336941386572072 \\ 3 & 43.559260436905874322 \\ 4 & 43.559260436881656414 \end{array} \right)$$

The other solution is to use Lambert function and the solutions are then given by $$x_1=-\frac{8 }{\log (2)}W\left(-\frac{\log (2)}{8}\right)\qquad , \qquad x_2=-\frac{8 }{\log (2)}W_{-1}\left(-\frac{\log (2)}{8}\right)$$

Sooner or later, you will learn that any equation which can write or rewrite as $$A+Bx+C\log(D+Ex)=0$$ has solution(s) which can be expressed in terms of Lambert function.

Share:
1,064
Author by

### user2453885

Learn quick, teach faster.

Updated on August 16, 2022

• user2453885 over 1 year

How would you be able to solve for n in this setup?

$$8n^2=64n\cdot \log_2(n)$$

I tried tons of online step-by-step solutions but the only one who got it right was wolfram, but I can't watch the step-by-step solution.

Any help will be appreciated!

• mvw almost 7 years
Is $n$ a real number, or just integer, or wha is it?
• user2453885 almost 7 years
The 2 functions are respectively insertion sort algorithm and merge sort algorithm. n is the size(instructions, data whatever) as a number and I was to find out when one is preferred to the other, the other end f(n) is time in microseconds.
• Nick Alger almost 7 years
At this point one can express the solution in terms of the Lambert W function.
• bigfocalchord almost 7 years
Are you the same Jimmy R. from reddit?
• Jimmy R. almost 7 years
@dydxx No, I am afraid not. I do not have an account on reddit. (If you do not mind I will delete this comment soon).
• user2453885 almost 7 years
Thank you so very much, I don't quite understand the last step though. 2^(n/8)=n⟺2^n=n^8. That you're allowed to do it. Can you point to some kind of reference explaining numerical methods as I am not familiar with the terms.
• Jimmy R. almost 7 years
user2453885 I raised both sides to the power $8$ to avoid the fraction in the exponent. Actually it is not a necessary step, you can skip it. @Sean Roberson's answer gives two names of numerical methods. You can search for them on the internet, they are the most commonly used.
• user2453885 almost 7 years
Thanks to both of you then, I won't bother you anymore. I'll find out how to use them on my own.
• Jimmy R. almost 7 years
@user2453885 You do not bother at all, don't worry. I think these methods are at a higher level than algebra-precalculus. For example the Newton-method is presented here:en.wikipedia.org/wiki/Newton's_method. If you have a problem working with it, ask a new question or just send a comment here.
• user2453885 almost 7 years
The thrill of learning. But sure, I'll be back if nessessary.