The Most Interesting Logs in the World
Join the DZone community and get the full member experience.
Join For Free
i occasionally get a comments from people who see “log” in one of my posts and think “log base 10.” they’ll say they get a different result than i do and ask whether i made a mistake. so to eliminate confusion, let me explain my notation.
when i say “log,” i always mean natural log, that is, log base e . this is the universal convention in advanced mathematics. it’s also the convention of every programming language that i know of. if i want to use logarithms to a different base, i specify the base as a subscript, such as log _{ 10 } for log base 10.
the reason logs base e are called natural, and the reason they’re most convenient to use, is that base e really is natural in a sense. for example, the function k ^{ x } is its own derivative only when k = e . and the derivative of log _{ k } ( x ) is 1/ x only when k = e .
all logarithms are proportional to each other. that is, log _{ b } ( x ) = log _{ e } ( x ) / log _{ e } ( b ). that’s why we can say something is logarithmic without specifying the base. so we might as well pick the base that is easiest to work with, and most people agree that’s base e . (there are some exceptions. in computer science it’s often convenient to work with logs base 2, sometimes written lg.)
logarithms base 10 have the advantage that they’re easy to compute mentally for special values. for example, the log base 10 of a 1,000,000 is 6: just count the zeros. so it’s good pedagogy to introduce logs base 10 first. but natural logs are simpler to use for theoretical work, and just as convenient to compute numerically.
along these lines, when i use trig functions, i always measure angles in radians. just like all advanced mathematics and all programming languages.
as with natural logs, radians are natural too. for example, the derivative of sine is cosine only when you work in radians. if you work in degrees, you pick up a proportionality constant every time you differentiate a trig function.
natural logs and radian measure are related: euler’s formula e ^{ ix } = cos( x ) + i sin( x ) assumes the base e and assumes that x measured in radians.
Published at DZone with permission of John Cook, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending

What Is Istio Service Mesh?

Design Patterns for Microservices: Ambassador, AntiCorruption Layer, and Backends for Frontends

Microservices Decoded: Unraveling the Benefits, Challenges, and Best Practices for APIs

Mastering Time Series Analysis: Techniques, Models, and Strategies
Comments