![]() |
|
Binary logarithm - Printable Version +- MKLab (https://mklab.gr) +-- Forum: [INDEX] (https://mklab.gr/forumdisplay.php?fid=1) +--- Forum: MATHEMATICS (https://mklab.gr/forumdisplay.php?fid=3) +---- Forum: ARTICLES (https://mklab.gr/forumdisplay.php?fid=13) +----- Forum: ALGEBRA (https://mklab.gr/forumdisplay.php?fid=147) +----- Thread: Binary logarithm (/showthread.php?tid=1896) |
Binary logarithm - mklabgr - 09-07-2026 Binary Logarithm The binary logarithm, written $\log_2 n$, is the logarithm to base $2$. It gives the exponent to which $2$ must be raised to obtain $n$: $\log_2 n = x \Longleftrightarrow 2^x = n$. For example, $\log_2 8 = 3$ and $\log_2 32 = 5$. It is therefore the inverse of the exponential function $2^x$. Like other logarithms, it satisfies the identities $\log_2(xy)=\log_2x+\log_2y$, $\log_2\left(\frac{x}{y}\right)=\log_2x-\log_2y$, and $\log_2(x^y)=y\log_2x$. It can also be calculated using natural logarithms through $\log_2 n=\frac{\ln n}{\ln 2}$. Binary logarithms are especially important whenever a process involves repeated doubling or halving. In computer science, binary search repeatedly halves the number of possibilities, so searching among $n$ items requires approximately $\log_2 n$ steps. The number of bits needed to represent a positive integer $n$ is $\lfloor\log_2 n\rfloor+1$. For this reason, $\log_2$ occurs throughout information theory, algorithm analysis, binary trees, combinatorics, and data structures. A balanced binary tree containing roughly $n$ elements has height approximately $\log_2 n$, while algorithms such as binary search have complexity $O(\log n)$. In Big-O analysis, the logarithm's base is usually omitted because changing the base only changes the result by a constant factor. Binary logarithms also appear in bioinformatics, music theory, photography, and tournament scheduling. Their fundamental interpretation is simple: $\log_2 n$ measures how many doublings are needed to reach $n$, or equivalently how many halvings are required to reduce a quantity. Key Takeaways
ARTICLE |