solving quadratic equation involving log

Hi,

How do you solve an equation with a quadratic expression on one side and a log expression on the other?

The specific question is:

2*n*log10(n) = 0.1*n^2

(Background: this is actually for an algorithm analysis question - I am trying to find the intersection points of the worst-case running times of two algorithms)

Thanks

Re: solving quadratic equation involving log

Well if you write this as

$\displaystyle \displaystyle \begin{align*} 2n\log_{10}{n} &= 0.1n^2 \\ 0 &= 0.1n^2 - 2n\log_{10}n \\ 0 &= n(0.1n - 2\log_{10}{n}) \end{align*}$

Since $\displaystyle \displaystyle \log_{10}{0}$ is undefined, we can't accept $\displaystyle \displaystyle n = 0$ as a solution, which means we have

$\displaystyle \displaystyle 0 = 0.1n - 2\log_{10}{n}$

You will need to use a numerical method to solve this.

Re: solving quadratic equation involving log

This is a tricky one, but maybe we can work it around a bit so the solution might be easier to find.

$\displaystyle \displaystyle 2n\log_{10}n = 0.1n^2$

$\displaystyle \displaystyle \log_{10}n = \frac{0.1n^2}{2n}$

$\displaystyle \displaystyle \log_{10}n = 0.05n$

$\displaystyle \displaystyle n = 10^{0.05n}$

You can solve it numerically from here.

Re: solving quadratic equation involving log

Thanks a lot for the fast replies.

I also got up to n = 10^(0.05*n) and did not know how to proceed any further. What is meant by solving it numerically, exactly? Does it basically mean a brute-force approach?

Cheers

Re: solving quadratic equation involving log

Yep, brute force, open up a spreadsheet you'll find $\displaystyle n \approx 29$

Re: solving quadratic equation involving log