I'm learning for my algorithms exam and I can't derive two logarithm transformations:
- $ 3^{log_{4}(n)}=n^{log_{4}(3)} $
- $ log_{3}(n)=log_{3}(e)*ln(n) $
I'm not very strong in logarithms, anybody can explain how I get in both cases from the left side of the equation to the right side?
Sorry if the terminology is wrong, I'm from Germany.
Use $\log _a b = \frac{{\ln b}}{{\ln a}}$ and $e^{\ln x} = x$: $$ 3^{\log _4 n} = (e^{\ln 3} )^{^{\ln n/\ln 4} } = e^{\ln 3\ln n/\ln 4} = (e^{\ln n} )^{\ln 3/\ln 4} = n^{\ln 3/\ln 4} = n^{\log _4 3}, $$ $$ \log _3 n = \frac{{\ln n}}{{\ln 3}} = \frac{1}{{\ln 3}}\ln n = \frac{{\ln e}}{{\ln 3}}\ln n = (\log _3 e)\ln n. $$