1

I'm reading Algorithms by Kevin Wayne and Robert Sedgewick.

They state that:

$\lg(T(N)) = 3 \lg N + \lg a $

(where $a$ is constant) is equivalent to

$T(N) = aN^3$

I know that $\lg$ means a base $10$ logarithm and that $\lg(T(N))$ means the index of the power to which $10$ must be raised to produce $T(N)$ but I'd like some help understanding how to get from the first equation to the second.

Grokodile
  • 157

2 Answers2

4

Recall the properties of logarithms:

$$b\lg a = \lg(a^b)$$ $$\lg a + \lg b = \log(ab)$$

Using these properties, we have:

$$\begin{align} \lg(\color{blue}{\bf T(N)}) & = 3 \lg N + \lg a \\ \\ & = \log(N^3) + \lg a \\ \\ & = \lg(\color{blue}{\bf aN^3}) \\ \\ \end{align}$$

Therefore, we have $$\large 10^{\lg (T(N))} = 10^{\lg (aN^3)}$$ $$\iff T(N) = aN^3\quad\qquad$$

amWhy
  • 209,954
1

Simply raise $10$ to the power of both sides of the equation:

$\large{10^{\log {T(N)}}=10^{3\log N +\log a}=10^{3\log N}\cdot10^{\log a}=(10^{log N})^3\cdot10^{\log a}}$

Since by definition $\log b = c \iff 10^c=b$, it follows that $10^{\log b}=b$, and thus $T(N)=N^3 \cdot a$.

Alraxite
  • 5,647