Nepedia
Back to Discover
Advanced Reader
🔢

Binary logarithm

math Maturity 7-9 Next article →

The binary logarithm is a mathematical function that identifies the power to which the number two must be raised to produce a specific value. In simpler terms, it tells you how many times you must multiply two by itself to reach a certain number. For example, the binary logarithm of eight is three because two multiplied by itself three times equals eight. This function acts as the inverse of the power of two function. It is a strictly increasing function over positive real numbers, meaning it has a unique inverse.

Binary logarithm plot with ticks
Binary logarithm plot with ticks

To understand its mechanism, consider the process of repeated division. If you start with a number and divide it by two repeatedly, the binary logarithm counts how many divisions are required to reach one. This concept is closely tied to the binary numeral system used by computers. The binary logarithm can help calculate the length of a number's representation in binary. It also determines the number of bits needed to encode a specific message in information theory.

Binary search into array - example
Binary search into array - example

There are several ways to write the notation for a binary logarithm. In many mathematical texts, it is written as $\log_2 x$. Other authors use $\lg x$, a notation often found in the Chicago Manual of Style. Some scientific literature, particularly in German, uses $\text{lb } x$, which stands for the Latin terms "logarithmus dualis" or "logarithmus dyadis." International standards like ISO 31-11 recommend the notation $\log_2 x$. These standards specify that $\log x$ should be reserved for the common logarithm, which uses base ten.

HP-35 Red Dot
HP-35 Red Dot

The history of this concept spans many centuries and cultures. The 8th-century Jain mathematician Virasena used a precursor called "ardhacheda." This concept measured how many times a number could be divided evenly by two. In 1544, Michael Stifel published the first known table of binary logarithms in his book, *Arithmetica Integra*. He listed integers alongside their corresponding powers of two. Later, in 1739, Leonhard Euler applied binary logarithms to music theory. Euler was a major figure in this field and published a table of binary logarithms for integers from one to eight.

Leonhard Euler - Jakob Emanuel Handmann (Kunstmuseum Basel)
Leonhard Euler - Jakob Emanuel Handmann (Kunstmuseum Basel)

In music theory, the binary logarithm is used to study frequency ratios. The interval between two musical tones is determined by the ratio of their frequencies. An octave represents a frequency ratio of two to one. The binary logarithm of this ratio tells us the number of octaves that separate two tones. This allows musicians to use an additive scale rather than a multiplicative one. This method helps in studying tuning systems and finer distinctions between notes.

SixteenPlayerSingleEliminationTournamentBracket
SixteenPlayerSingleEliminationTournamentBracket

Computer science relies heavily on binary logarithms for analyzing algorithms. A common example is the binary search, which finds an item in a sorted list. This algorithm halves the search area with every step. Because of this, it only takes roughly $\log_2 n$ steps to find a solution in a list of $n$ items. Other complex algorithms, such as the Karatsuba algorithm for multiplication, also use binary logarithms in their time bounds. These processes are often described using "linearithmic" time, which is expressed as $O(n \log n)$.

Binary search into array - example
Binary search into array - example

Binary logarithms also appear in the field of bioinformatics. Scientists use microarrays to measure how strongly different genes are expressed. To compare these expression rates, they use the log ratio of the two rates. A doubled expression rate results in a log ratio of one. A halved expression rate results in a log ratio of minus one. This makes it much easier to visualize and compare changes in biological data.

Mouse cdna microarray
Mouse cdna microarray

Finally, this math is visible in combinatorics and daily life. In a single-elimination sports tournament, the number of rounds is the binary logarithm of the number of players. For a 16-player tournament, there are four rounds. Even the way we shuffle cards involves this math. A mathematical analysis shows that a 52-card deck should be shuffled seven times to become close to uniformly random. This calculation is based on the binary logarithm of the number of possible card permutations.

664 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (6)
File:Binary logarithm plot with ticks.svg
Binary logarithm plot with ticks.svg
File:Leonhard Euler - Jakob Emanuel Handmann (Kunstmuseum Basel).jpg
Leonhard Euler - Jakob Emanuel Handmann...
File:SixteenPlayerSingleEliminationTournamentBracket.svg
SixteenPlayerSingleEliminationTournamentBr...
File:Binary search into array - example.svg
Binary search into array - example.svg
File:Mouse cdna microarray.jpg
Mouse cdna microarray.jpg
File:HP-35 Red Dot.jpg
HP-35 Red Dot.jpg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.