RemNote Community
Community

Logarithm - Applications and Advanced Topics

Learn how logarithms are computed, applied across scientific and statistical fields, and extended to advanced topics such as algorithm analysis, complex analysis, and cryptography.
Summary
Read Summary
Flashcards
Save Flashcards
Quiz
Take Quiz

Quick Practice

What is the power-series expansion for $\ln(1+z)$ when $|z|<1$?
1 of 27

Summary

Methods for Computing Logarithms Power-Series Expansions The logarithm can be computed using infinite series, which is especially useful in computational mathematics. The most important series is the Taylor series for the natural logarithm: $$\ln(1+z) = \sum{n=1}^{\infty} \frac{(-1)^{n+1}}{n}z^n = z - \frac{z^2}{2} + \frac{z^3}{3} - \frac{z^4}{4} + \cdots$$ This series converges for $|z| < 1$, meaning you can compute $\ln(1+z)$ by adding together the first several terms. The closer $z$ is to zero, the faster the series converges, making this method practical for numerical computation. This approach is foundational for understanding how calculators and computers actually compute logarithms behind the scenes. Applications of Logarithms Scientific Scales Logarithmic scales appear throughout science and engineering because they allow us to represent quantities that span many orders of magnitude in a compact, meaningful way. Decibels in Signal Processing and Acoustics The decibel (dB) is a logarithmic unit used to describe ratios of power or amplitude. There are two key formulas depending on whether you're measuring power or voltage: $$L{\text{dB}} = 10\log{10}\left(\frac{P}{P0}\right) \text{ for power ratios}$$ $$L{\text{dB}} = 20\log{10}\left(\frac{V}{V0}\right) \text{ for voltage ratios}$$ Here, $P$ or $V$ is the quantity being measured, and $P0$ or $V0$ is a reference level. The logarithmic scale means that large physical differences are compressed into manageable numbers. For example, the human ear can detect sounds ranging over a factor of a trillion in power, yet we perceive these on a scale of roughly 0 to 140 dB. A key insight: every increase of 10 dB represents a 10-fold increase in power (or roughly a 3.16-fold increase in voltage, since the formula uses the 20 factor). Chemistry: pH The pH scale measures the acidity of a solution by quantifying hydrogen-ion concentration: $$\text{pH} = -\log{10}[\mathrm{H}^+]$$ where $[\mathrm{H}^+]$ denotes the hydrogen-ion concentration in moles per liter. The logarithm's critical property here is that each unit change in pH corresponds to a ten-fold change in hydrogen-ion concentration. This is why small pH changes are significant: moving from pH 7 to pH 6 means the concentration of hydrogen ions increases by a factor of 10. The logarithmic scale is practical because hydrogen-ion concentrations range over many orders of magnitude (from $10^{-14}$ to $10^0$ or higher), and the logarithmic scale condenses this to a simple range of 0 to 14. Information Theory Logarithms are fundamental to measuring information because they quantify how much "surprise" or "reduction in uncertainty" an event provides. Bits and Nats The information content of an event with probability $p$ is defined using the binary logarithm: $$I = -\log2 p \text{ (measured in bits)}$$ Alternatively, using the natural logarithm: $$I = -\ln p \text{ (measured in nats)}$$ The choice of logarithm base determines the unit: base 2 gives bits (used in computer science), while base $e$ gives nats (used in physics and information theory). The formula works because: A certain event ($p = 1$) contains zero information: $-\log2(1) = 0$. A rare event ($p$ near 0) contains high information: $-\log2(p)$ becomes large. An event with probability $1/2$ contains 1 bit of information. This logarithmic relationship reflects the intuition that information content is proportional to how "surprising" an event is. Probability and Statistics Log-Normal Distribution When the logarithm of a random variable follows a normal distribution, the original variable is said to have a log-normal distribution. This occurs naturally in many real-world phenomena—such as income distributions, particle sizes, and survival times—where values are bounded below (cannot be negative) but have a long upper tail. Algorithm Analysis Logarithmic terms appear pervasively in the analysis of algorithms' running time and resource requirements. Divide-and-Conquer Algorithms Many efficient algorithms work by repeatedly dividing a problem in half. For example, binary search locates an element in a sorted list of $N$ items by repeatedly halving the search space. On average, this requires: $$\text{Comparisons} \approx \log2 N$$ Similarly, merge sort divides an array into smaller subarrays, recursively sorts them, and merges the results. The total running time is: $$\text{Time} \propto N \log N$$ where the $\log N$ factor comes from the number of recursive levels, and $N$ accounts for the work done at each level. Memory for Representing Integers A natural number $N$ can be stored using at most $\log2 N + 1$ binary digits. This is because $k$ binary digits can represent integers from $0$ to $2^k - 1$. Thus, memory requirements grow logarithmically with the magnitude of numbers being stored—a dramatic compression compared to linear growth. Base Independence in Algorithm Analysis When analyzing algorithms, changing the logarithm base affects only the constant factor: $\loga N = \frac{\logb N}{\logb a}$. In algorithmic complexity analysis, constant factors are ignored (under the "uniform cost model"), so $\log2 N$, $\log{10} N$, and $\ln N$ are considered equivalent for complexity purposes. This is why complexity theory simply refers to "logarithmic" without specifying the base. Statistical Applications of Logarithms Maximum-Likelihood Estimation In statistics, maximum-likelihood estimation (MLE) finds parameter values that make observed data most probable. The likelihood function $L(\theta)$ is often a product of many probability terms, making it difficult to optimize directly. The key insight is that the logarithm is a strictly increasing function, so maximizing $\ln L(\theta)$ is equivalent to maximizing $L(\theta)$—they achieve their maximum at identical parameter values. The log-likelihood function is: $$\ell(\theta) = \ln L(\theta)$$ This transformation is invaluable because: Products become sums: $\ln(a \cdot b \cdot c) = \ln a + \ln b + \ln c$ Sums are much easier to optimize (using calculus) than products Numerical stability improves (products of small probabilities can underflow computationally) Logarithmic Data Transformation Applying a logarithmic transformation to raw data—that is, replacing each data point $x$ with $\log(x)$—can reveal patterns and improve statistical analysis. Specifically, log-transformed data often better approximates a normal distribution than the original data, which is valuable because many statistical tests assume normality. This transformation is particularly useful for data that is right-skewed (has a long upper tail), such as income, body weight, or reaction times. <extrainfo> Benford's Law An intriguing application of logarithms in statistics is Benford's law, which describes the distribution of leading digits in naturally occurring datasets. The law states that the probability that a randomly selected number from such a dataset has leading digit $d$ (where $d = 1, 2, \ldots, 9$) is: $$P(d) = \log{10}(d+1) - \log{10}(d) = \log{10}\left(\frac{d+1}{d}\right)$$ This means that digit 1 appears as the leading digit about 30% of the time, while digit 9 appears only about 5% of the time. This counterintuitive result holds for many datasets in nature and is used in forensic accounting to detect fraud. </extrainfo> Entropy, Information Theory, and Chaos Information Entropy If a message can be any one of $N$ equally likely possibilities, receiving the message conveys: $$H = \log2 N \text{ bits of information}$$ More generally, when outcomes have different probabilities, the Shannon entropy quantifies the average information per outcome. This logarithmic formulation captures the idea that information is fundamentally related to the reduction of uncertainty. <extrainfo> Thermodynamic Entropy The entropy of a physical system from the perspective of statistical mechanics is given by: $$S = -k \sumi pi \ln pi$$ where $pi$ is the probability of state $i$ and $k$ is the Boltzmann constant. This formula has the same logarithmic structure as information entropy, reflecting a deep connection between information theory and thermodynamics. Lyapunov Exponents In chaotic dynamics, the Lyapunov exponent measures how quickly two initially nearby trajectories diverge. A positive Lyapunov exponent indicates deterministic chaos: small differences in initial conditions grow exponentially over time, which is why long-term prediction becomes impossible despite deterministic rules. </extrainfo> Complex Logarithm The logarithm can be extended to complex numbers, but this extension reveals surprising subtlety. Definition via Polar Form Any non-zero complex number can be written in polar form as $z = re^{i\varphi}$, where $r > 0$ is the modulus and $\varphi$ is the argument (angle). The logarithm of such a complex number is: $$ak = \ln r + i(\varphi + 2k\pi)$$ for any integer $k$. Here, $\ln r$ is the ordinary real logarithm of the positive number $r$. Notice something crucial: the complex logarithm is multi-valued. Adding $2\pi i k$ to the result gives another valid logarithm of the same number, because $e^{i \cdot 2\pi k} = 1$ for any integer $k$. Principal Value and Branch Cuts To select a single value, mathematicians define the principal value $\operatorname{Log}(z)$ by restricting the argument $\varphi$ to a standard range, typically $-\pi < \varphi \le \pi$ (or $0 \le \varphi < 2\pi$). This selection involves drawing a branch cut—a curve along which the logarithm is discontinuous. The branch cut is conventionally placed along the negative real axis. The multi-valued nature and need for branch cuts is fundamental to complex analysis and manifests in many advanced applications. Generalizations and Related Functions <extrainfo> Higher-Order Logarithmic Functions The iterated logarithm (or "log-star"), denoted $\log^ n$, repeatedly applies the logarithm function until the result is at most 1. For example, $\log^(65536) = 4$ because: $\log2(65536) = 16$ $\log2(16) = 4$ $\log2(4) = 2$ $\log2(2) = 1$ This function grows slower than any logarithm and appears in the analysis of advanced algorithms. </extrainfo> Discrete Logarithm in Cryptography In discrete logarithm problem, we work in a finite cyclic group (often multiplication modulo a prime $p$) and seek the integer $n$ such that: $$g^n = h$$ where $g$ and $h$ are group elements. While computing $g^n$ is fast (using repeated squaring), finding $n$ given $g$ and $h$ is believed to be computationally hard. This asymmetry forms the foundation of public-key cryptography, including the Diffie–Hellman key exchange and digital signatures. Logarithmic Isomorphism of Groups The exponential and logarithm functions establish a fundamental isomorphism between two important mathematical structures: $$\log : (\mathbb{R}{>0}, \times) \to (\mathbb{R}, +)$$ This mapping turns multiplication of positive real numbers into addition of their logarithms. This property is more than convenient—it reveals that these two algebraic structures are essentially the same ("isomorphic"), merely expressed in different forms. Historically, this property enabled slide rules to perform multiplication by converting it to addition using logarithmic scales. Log-Sum-Exp (Logarithmic Addition) In machine learning and numerical computing, the log-sum-exp function is defined as: $$\operatorname{LSE}(x1, \ldots, xn) = \ln(e^{x1} + e^{x2} + \cdots + e^{xn})$$ This function represents the "logarithmic analogue of addition" and provides a numerically stable way to compute logarithms of sums. It's essential in probabilistic inference because it preserves the structure of probability arithmetic while avoiding numerical overflow and underflow. Number Theory Connections <extrainfo> Prime Counting and the Prime Number Theorem The distribution of prime numbers follows a logarithmic pattern. The prime counting function $\pi(x)$ counts how many primes are less than or equal to $x$. The prime number theorem states that: $$\lim{x \to \infty} \frac{\pi(x)}{x / \ln x} = 1$$ This means that for large $x$, approximately $\frac{x}{\ln x}$ primes exist below $x$. In other words, primes become progressively rarer, thinning out at a rate inversely proportional to the logarithm of the numbers. A more precise approximation uses the logarithmic integral: $$\operatorname{Li}(x) = \int2^x \frac{dt}{\ln t}$$ with $\pi(x) \sim \operatorname{Li}(x)$ as $x \to \infty$. Stirling's Approximation Stirling's approximation provides a formula for computing $n!$ (the product $1 \cdot 2 \cdot 3 \cdots n$) for large $n$. The starting point is the logarithmic relationship: $$\ln(n!) = n\ln n - n + O(\ln n)$$ This leads to the familiar formula: $$n! \approx \sqrt{2\pi n} \left(\frac{n}{e}\right)^n$$ Stirling's approximation is indispensable in combinatorics and probability because exact factorials become computationally infeasible for large $n$. Erdős–Kac Theorem The Erdős–Kac theorem connects number theory and probability by showing that the number of distinct prime factors of a random integer approximately follows a normal distribution after normalization by $\sqrt{\ln \ln n}$. This deep result reveals hidden probabilistic structure in the seemingly chaotic distribution of prime factors. </extrainfo> Summary Logarithms permeate mathematics, science, and engineering because they elegantly convert multiplicative relationships into additive ones, compress vast ranges into manageable scales, and measure information and uncertainty. From decibel scales in acoustics to discrete logarithms in cryptography, from algorithm analysis to the distribution of primes, logarithms provide both a practical computational tool and a window into fundamental mathematical structure.
Flashcards
What is the power-series expansion for $\ln(1+z)$ when $|z|<1$?
$\ln(1+z)=\sum{n=1}^{\infty}\frac{(-1)^{n+1}}{n}z^{n}$
What is the formula for decibel level $L{\text{dB}}$ in terms of power ratio $\frac{P}{P0}$?
$L{\text{dB}} = 10\,\log{10}\!\left(\frac{P}{P{0}}\right)$
What is the formula for decibel level $L{\text{dB}}$ in terms of voltage ratio $\frac{V}{V0}$?
$L{\text{dB}} = 20\,\log{10}\!\left(\frac{V}{V{0}}\right)$
How is pH mathematically defined in terms of hydrogen-ion activity $[\mathrm{H}^{+}]$?
$\text{pH} = -\log{10}[\mathrm{H}^{+}]$
What magnitude of change in hydrogen-ion activity corresponds to a single unit change in pH?
Ten-fold change
Which logarithm base is used to measure information $I$ in bits for an event with probability $p$?
Binary logarithm ($\log2$); $I = -\log{2} p$
Which logarithm base is used to measure information $I$ in nats?
Natural logarithm ($\ln$); $I = -\ln p$
In information theory, how many bits of information are conveyed by receiving one of $N$ equally likely messages?
$\log{2} N$ bits
When does a random variable follow a log-normal distribution?
When the logarithm of the random variable follows a normal distribution
Why does the logarithm of a likelihood function reach its maximum at the same parameter value as the original function?
The logarithm is a strictly increasing function
What is the primary advantage of using log-likelihood when dealing with independent random variables?
It simplifies the maximization of products into sums
According to Benford's Law, what is the formula for the probability that a first decimal digit equals $d$?
$\log{10}(d+1)-\log{10}(d)$
On average, how many comparisons are required for a binary search on a sorted list of $N$ items?
$\log{2} N$
What is the proportional running time of Merge Sort for $N$ elements?
$N\log N$
In algorithmic analysis, why is the specific base of a logarithm generally ignored under the uniform cost model?
Changing the base only multiplies the result by a constant factor
What is the formula for the physical entropy $S$ of a system with state probabilities $pi$?
$S = -k\sumi pi \ln pi$ (where $k$ is the Boltzmann constant)
In the study of chaos, what does a positive Lyapunov exponent indicate?
Deterministic chaotic behavior (small initial differences grow exponentially fast)
What is the formula for calculating the interval in octaves between two frequencies $f1$ and $f2$?
$\log{2}\!\left(\frac{f2}{f1}\right)$
What integral function approximates the prime counting function $\pi(x)$?
The logarithmic integral $\operatorname{Li}(x)=\int{2}^{x}\frac{dt}{\ln t}$
According to the Prime Number Theorem, how does the frequency of primes change as $x$ increases?
Primes become less frequent in proportion to $1/\ln x$
What is the logarithmic form of Stirling's approximation for $\ln(n!)$ as $n$ becomes large?
$\ln(n!) = n\ln n - n + O(\ln n)$
After normalizing by $\ln\ln n$, what distribution does the number of distinct prime factors of a random integer follow?
Normal distribution
For a non-zero complex number $z = re^{i\varphi}$, what are the possible values of its logarithms $ak$?
$ak = \ln r + i(\varphi + 2k\pi)$ for any integer $k$
Why is a branch cut (e.g., along the negative real axis) required for the complex logarithm?
To define a single-valued branch because the function is multi-valued
In a finite cyclic group, what is the discrete logarithm problem for elements $g$ and $h$?
Finding the integer $n$ such that $g^n = h$
The mapping $\log\colon (\mathbb{R}{>0},\times)\rightarrow (\mathbb{R},+)$ acts as a continuous group isomorphism by performing what operation change?
Turning multiplication of positive reals into addition of their logarithms
What is the formula for the Log-Sum-Exp (LSE) function of variables $x1, \dots, xn$?
$\operatorname{LSE}(x1,\dots,xn)=\ln\!(e^{x1}+ \cdots + e^{xn})$

Quiz

In the Taylor series for $\ln(1+z)$ that converges for $|z|<1$, what is the coefficient of the term $z^{\,n}$?
1 of 13
Key Concepts
Logarithmic Concepts
Logarithm
Decibel
pH
Information entropy
Log‑normal distribution
Complex logarithm
Discrete logarithm
Statistical and Algorithmic Applications
Divide‑and‑conquer algorithm
Maximum‑likelihood estimation
Benford’s law
Prime number theorem