ArticleslgStudy

mathematics

Binary logarithm

Binary logarithm is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Binary logarithm rather than just read about it. In short: In mathematics, the binary logarithm (log2 n) is the power to which the number 2 must be raised to obtain the value n. That is, for any real number x, x=log2n⟺2x=n.

Binary logarithm — main illustration
Binary logarithm — illustration

Key takeaways

  • Binary logarithm belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Binary logarithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Binary logarithm from memory before moving on to harder problems.

Reference excerpt

In mathematics, the binary logarithm (log2 n) is the power to which the number 2 must be raised to obtain the value n. That is, for any real number x, x=log2n⟺2x=n. For example, the binary logarithm of 1 is 0, the binary logarithm of 2 is 1, the binary logarithm of 4 is 2, and the binary logarithm of 32 is 5. The binary logarithm is the logarithm to the base 2 and is the inverse function of the power of two function. There are several alternatives to the log2 notation for the binary logarithm; see the Notation section below. Historically, the first application of binary logarithms was in music theory, by Leonhard Euler: the binary logarithm of a frequency ratio of two musical tones gives the number of octaves by which the tones differ. Binary logarithms can be used to calculate the length of the representation of a number in the binary numeral system, or the number of bits needed to encode a message in information theory. In computer science, they count the number of steps needed for binary search and related algorithms. Other areas in which the binary logarithm is frequently used include combinatorics, bioinformatics, the design of sports tournaments, and photography. Binary logarithms are included in the standard C mathematical functions and other mathematical software packages.

History

The binary logarithm of a power of two is its position in the ordered sequence of powers of two, and the powers of two have been known since antiquity. They appear in Euclid's Elements, Props. IX.32 (on the factorization of powers of two) and IX.36 (half of the Euclid–Euler theorem, on the structure of even perfect numbers). The 8th century Jain mathematician Virasena defined the concept of ardhacheda to be the number of times a given number can be divided evenly by two. This coincides with the binary logarithm on the powers of two, but it is different for other integers, giving the 2-adic order rather than the logarithm. Michael Stifel's 1544 book Arithmetica Integra contains several tables that show the integers with their corresponding powers of two. Reversing the rows of these tables allow them to be interpreted as tables of binary logarithms, in the same sense that Virasena's ardhacheda, applied to a power of two, can be interpreted as a binary logarithm. The modern form of a binary logarithm, applying to any number (not just powers of two) was considered explicitly by Leonhard Euler in 1739. Euler established the application of binary logarithms to music theory, long before their applications in information theory and computer science became known. As part of his work in this area, Euler published a table of binary logarithms of the integers from 1 to 8, to seven decimal digits of accuracy.

Definition and properties The binary logarithm function may be defined as the inverse function to the power of two function, which is a strictly increasing function over the positive real numbers and therefore has a unique inverse. Alternatively, it may be defined as ln n / ln 2, where ln is the natural logarithm, defined in any of its standard ways. Using the complex logarithm in this definition allows the binary logarithm to be extended to the complex numbers. As with other logarithms, the binary logarithm obeys the following equations, which can be used to simplify formulas that combine binary logarithms with multiplication or exponentiation: log2xy=log2x+log2y log2xy=log2x−log2y log2xy=ylog2x. For more, see list of logarithmic identities.

Notation In mathematics, the binary logarithm of a number n is often written as log2 n. However, several other notations for this function have been used or proposed, especially in application areas. Some authors write the binary logarithm as lg n, the notation listed in The Chicago Manual of Style. Donald Knuth credits this notation to a suggestion of Edward Reingold, but its use in both information theory and computer science dates to before Reingold was active. The binary logarithm has also been written as log n with a prior statement that the default base for the logarithm is 2. Another notation that is often used for the same function (especially in the German scientific literature) is ld n, from Latin logarithmus dualis or logarithmus dyadis. The DIN 1302, ISO 31-11 and ISO 80000-2 standards recommend yet another notation, lb n. According to these standards, lg n should not be used for the binary logarithm, as it is instead reserved for the common logarithm log10 n.

Applications

Information theory The number of digits (bits) in the binary representation of a positive integer n is the integral part of 1 + log2 n, i.e. ⌊log2n⌋+1. In information theory, the definition of the amount of self-information and information entropy is often expressed with the binary logarithm, corresponding to making the bit the fundamental unit of information. With these units, the Shannon–Hartley theorem expresses the information capacity of a channel as the binary logarithm of its signal-to-noise ratio, plus one. However, the natural logarithm and the nat are also used in alternative notations for these definitions.

Combinatorics

Although the natural logarithm is more important than the binary logarithm in many areas of pure mathematics such as number theory and mathematical analysis, the binary logarithm has several applications in combinatorics:

… excerpt ends here. Continue reading the full article.

Illustrations

Binary logarithm: Graph of .mw-parser-output .texhtml{font-family:"Nimbus Roman No9 L","Times New Roman",Times,serif;font-size:118%;line-height:1;font-variant-numeric:lining-nums tabular-nums;font-kerning:none}.mw-parser-output .texhtml .texhtml{font-size:100%}.mw-parser-output .texhtml-big{font-size:165%}.mw-parser-output .mvar{font-style:italic}@media(min-width:420px){.mw-parser-output .texhtml{white-space:nowrap}}log2 x as a function of a positive real number x
Graph of .mw-parser-output .texhtml{font-family:"Nimbus Roman No9 L","Times New Roman",Times,serif;font-size:118%;line-height:1;font-variant-numeric:lining-nums tabular-nums;font-kerning:none}.mw-parser-output .texhtml .texhtml{font-size:100%}.mw-parser-output .texhtml-big{font-size:165%}.mw-parser-output .mvar{font-style:italic}@media(min-width:420px){.mw-parser-output .texhtml{white-space:nowrap}}log2 x as a function of a positive real number x
Binary logarithm: Leonhard Euler was the first to apply binary logarithms to music theory, in 1739.
Leonhard Euler was the first to apply binary logarithms to music theory, in 1739.
Binary logarithm: A 16-player single elimination tournament bracket with the structure of a complete binary tree. The height of the tree (number of rounds of the tournament) is the binary logarithm of the number of players, rounded up to an integer.
A 16-player single elimination tournament bracket with the structure of a complete binary tree. The height of the tree (number of rounds of the tournament) is the binary logarithm of the number of players, rounded up to an integer.
Binary logarithm: Binary search in a sorted array, an algorithm whose time complexity involves binary logarithms
Binary search in a sorted array, an algorithm whose time complexity involves binary logarithms
Binary logarithm: A microarray for approximately 8700 genes. The expression rates of these genes are compared using binary logarithms.
A microarray for approximately 8700 genes. The expression rates of these genes are compared using binary logarithms.

Worked examples

Example 1 — a first encounter with Binary logarithm

Start with the simplest possible case. Write down what Binary logarithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Binary logarithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Binary logarithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Binary logarithm

In research
Binary logarithm appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Binary logarithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Binary logarithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Binary arithmetic, Calculus, Logarithms, so understanding it makes those chapters shorter.
In everyday life
Look for Binary logarithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Binary logarithm” →

How to study Binary logarithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Binary logarithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Binary logarithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Binary logarithm in simple terms?

In mathematics, the binary logarithm (log2 n) is the power to which the number 2 must be raised to obtain the value n. That is, for any real number x, x=log2n⟺2x=n.

Why does Binary logarithm matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Binary logarithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Binary logarithm.

Tags

  • Binary arithmetic
  • Calculus
  • Logarithms

Keep exploring