Textbook reads:
All logarithms are natural logarithms: $\log = \ln$.
Does this mean $n\log(n) = n\ln(n)$?
Textbook reads:
All logarithms are natural logarithms: $\log = \ln$.
Does this mean $n\log(n) = n\ln(n)$?
If the textbook is making clear that you should read $\log n$ to mean $\ln n$, then yes, barring any subscript for a base other than $e$, $n \log(n) = n\ln(n)$.
ln everywhere. It's just a bit misleading to say it's always the natural log, when log2 and log10 are much, much more common in a typical algorithms course.
– corsiKa
Oct 23 '14 at 18:58
If $\log = \ln$, then yes, indeed, $n\log n = n\ln n$.
Note, however, that this is utterly unimportant if you are looking at it from the case of the big $O$ notation, which is highly likely, since
$$n\log n \in O(n\ln n)$$ and $$n\ln n \in O(n\log n)$$ or, in other words, $$O(n\log n)=O(n\ln n)$$
atoi being based on the base of the number being parsed, but thanks to the math behind logarithms they're all in the same base. It's not like you'd have O(n log-k n) - it would just be O(n lg n) no matter if it was base 2, e, 10, or 36.
– corsiKa
Oct 23 '14 at 17:42
Normally, the base of a logarithm must be specified as $\log_a$. A very common convention is $\ln \equiv \log_e$.
However, $\log$ without subscript can mean a few different things based on the context (and therefore must be always explicitly stated).
$\log \equiv \log_{10}$, is very common in many mathematical books and publications.
$\log \equiv \log_2$, in computer science.
$\log \equiv \ln$, in most physics and applied mathematical contexts.
Your textbook is in the latter category. It can still use other bases for logarithms, but unspecified means base $e$.
It just means that unless some other base is specified, the base of the logarithm is assumed to be $e$. That is, if you see $\log x$, the author means $\log_e x$, which can also be written $\ln x$.
The rule $\log_b x^n = n\log_b x$ holds for any base $b > 0$, with $b \neq 1$. In particular, it holds for $b = e$, so the answer to your question is yes.
n log nis base 2. With a phrase like that, I'd start to question everything in that book (even more so than the standard academic question everything stance). – corsiKa Oct 23 '14 at 17:45