For example, this question presents the equation

$$\omega(n) < \frac{\log n}{\log \log n} + 1.4573 \frac{\log n}{(\log \log n)^{2}},$$

but I'm not entirely sure if this is referring to log base $10$ or the natural logarithm.

  • 12
    $\begingroup$ The formula you quote is from Number Theory. So for sure base $e$. $\endgroup$ – André Nicolas Feb 3 '13 at 17:37

In mathematics, $\log n$ is most often taken to be the natural logarithm. The notation $\ln(x)$ not seen frequently past multivariable calculus, since the logarithm base $10$ finds relatively little use.

This Wikipedia page gives a classification of where each definition, that is base $2$, $e$ and $10$, are used:

$\log (x)$ refers to $\log_2 (x)$ in computer science and information theory.

$\log(x)$ refers to $\log_e(x)$ or the natural logrithm in mathematical analysis, physics, chemistry, statistics, economics, and some engineering fields.

$\log(x)$ refers to $\log_{10}(x)$ in various engineering fields, logarithm tables, and handheld calculators.

  • 7
    $\begingroup$ Some computer-science types use $\mathop{lg}$ for $\log_2$ $\endgroup$ – vonbrand Feb 3 '13 at 19:13
  • 3
    $\begingroup$ I've often seen lb for log2 (i.e. log binary) $\endgroup$ – wim Feb 3 '13 at 23:15
  • 5
    $\begingroup$ To add on this, in terms of computational complexity all the bases are the same as they differ by a constant. So it's actually irrelevant which base you chose for your logarithm in the aforementioned question (about the prime numbers). $\endgroup$ – Asaf Karagila Feb 4 '13 at 0:21
  • 3
    $\begingroup$ The second term in the original expression has a log divided by the square of a log, so the base is relevant. $\endgroup$ – DJohnM Feb 4 '13 at 2:06
  • 3
    $\begingroup$ @wim Yes. That's the ISO 31-11 standard (lb for base 2, ln for $e$, lg for 10). $\endgroup$ – Mechanical snail Feb 4 '13 at 8:21

Depending on the subject, it can be base $10$, base $e$, or base $2$. Base $2$ is common in computer science. Base $10$ is popular in engineering (think decibels). I would take this to be base $e$

  • 8
    $\begingroup$ Oh, this new generation. For us old-timers, who grew up with slide rules and logarithm tables, $\log$ was $\log_{10}$ by default. $\ln$ was used only in the weird formulas used by mathematicians, to be translated into $\log_{10}$ as soon as possible [Chemical engineer by training, in the '70s]. $\endgroup$ – vonbrand Feb 3 '13 at 19:17
  • 3
    $\begingroup$ Base 10 also shows up reasonably often in the less mathy sciences. (vonbrand's comment generally describes the kind of fields where it might be used - if they think math is weird, there's a good chance they use base 10.) $\endgroup$ – Cascabel Feb 3 '13 at 20:45

In some cases, "$\log$" can refer to a logarithm with an indefinite base.

Suppose we're taking the logarithm (base $b$, where $b>0$ is constant) of some variable. Recall the identity

$$\log_b(x) = \frac{\log_c(x)}{\log_c(b)}$$

The base-$b$ logarithm can be expressed as a constant factor times the logarithm to any other base $c>0$. In some domains, particularly asymptotic analysis, we don't care about constant factors—which means that it doesn't matter what base we pick. So we can unambiguously write $Θ(\log(n))$ without specifying the base.

(This does not apply to the specific usage in the question, which is about an upper bound for all $n$. Obviously constant factors matter there.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.