ArticleslgStudy

mathematics

Binary entropy function

Binary entropy function 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 entropy function rather than just read about it. In short: In information theory, the binary entropy function, denoted H⁡(p) or Hb(p), is defined as the entropy of a Bernoulli process (i.i.d. binary variable) X with probability p of one of two values, and is given by the formula: H⁡(X)=−plog⁡p−(1−p)log⁡(1−p). The base of the logarithm corresponds to the choice of units of information; base e (natural logarithm) corresponds to nats and is mathematically convenient, while bas…

Binary entropy function — main illustration
Binary entropy function — illustration

Key takeaways

  • Binary entropy function 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 entropy function to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Binary entropy function from memory before moving on to harder problems.

Reference excerpt

In information theory, the binary entropy function, denoted H⁡(p) or Hb(p), is defined as the entropy of a Bernoulli process (i.i.d. binary variable) X with probability p of one of two values, and is given by the formula:

H⁡(X)=−plog⁡p−(1−p)log⁡(1−p). The base of the logarithm corresponds to the choice of units of information; base e (natural logarithm) corresponds to nats and is mathematically convenient, while base 2 (binary logarithm) corresponds to shannons and is conventional (as shown in the graph); explicitly:

H⁡(X)=−plog2p−(1−p)log2(1−p). Note that the values at 0 and 1 are given by the limit 0log⁡0:=limx→0+xlog⁡x=0 (by L'Hôpital's rule); and that "binary" refers to two possible values for the variable, not the units of information. When p=1/2, the binary entropy function attains its maximum value of 1 shannon (1 binary unit of information); this is the case of an unbiased coin flip. When p=0 or p=1, the binary entropy is 0 (regardless of the unit), corresponding to no information, since there is no uncertainty in the variable.

Notation Binary entropy Hb(p) is a special case of H(X), the entropy function. Hb(p) is distinguished from the general entropy function H(X) in that the former takes a single real number as a parameter whereas the latter takes a distribution or random variable as a parameter. Thus the binary entropy (of p) is the entropy of the particular distribution X∼Ber⁡(p), so Hb(p)=H(Ber⁡(p)). Writing the probability of each of the two values being p and q, so p+q=1 and q=1−p, this corresponds to

H⁡(X)=−plog⁡p−(1−p)log⁡(1−p)=−plog⁡p−qlog⁡q=−∑x∈XPr⁡(X=x)⋅log⁡Pr⁡(X=x)=H(Ber⁡(p)). Sometimes the binary entropy function is also written as H2(p). However, it is different from and should not be confused with the Rényi entropy, which is also denoted as H2(X).

Explanation In terms of information theory, entropy is considered to be a measure of the uncertainty in a message. To put it intuitively, suppose p=0. At this probability, the event is certain never to occur, and so there is no uncertainty at all, leading to an entropy of 0. If p=1, the result is again certain, so the entropy is 0 here as well. When p=1/2, the uncertainty is at a maximum; if one were to place a fair bet on the outcome in this case, there is no advantage to be gained with prior knowledge of the probabilities. In this case, the entropy is maximum at a value of 1 bit. Intermediate values fall between these cases; for instance, if p=1/4, there is still a measure of uncertainty on the outcome, but one can still predict the outcome correctly more often than not, so the uncertainty measure, or entropy, is less than 1 full bit.

Properties

Derivative The derivative of the binary entropy function may be expressed as the negative of the logit function:

ddpHb(p)=−logita(p)=−loga(p1−p). d2dp2Hb(p)=−1p(1−p)ln⁡a, where a denotes the given base of the logarithm.

Convex conjugate The convex conjugate (specifically, the Legendre transform) of the binary entropy (with base e) is the negative softplus function. This is because (following the definition of the Legendre transform: the derivatives are inverse functions) the derivative of negative binary entropy is the logit, whose inverse function is the logistic function, which is the derivative of softplus. Softplus can be interpreted as logistic loss, so by duality, minimizing logistic loss corresponds to maximizing entropy. This justifies the principle of maximum entropy as loss minimization.

Taylor series The Taylor series of the binary entropy function at 1/2 is

Hb(p)=1−12ln⁡2∑n=1∞(1−2p)2nn(2n−1) which converges to the binary entropy function for all values 0≤p≤1.

Bounds The following bounds hold for 0<p<1:

ln⁡(2)⋅log2(p)⋅log2(1−p)≤Hb(p)≤log2(p)⋅log2(1−p) and

4p(1−p)≤Hb(p)≤(4p(1−p))(1/ln⁡4) where ln denotes natural logarithm.

See also Metric entropy Information theory Information entropy Quantities of information

References

Further reading MacKay, David J. C. Information Theory, Inference, and Learning Algorithms Cambridge: Cambridge University Press, 2003. ISBN 0-521-64298-1

Illustrations

Binary entropy function: Entropy of a Bernoulli trial (in shannons) as a function of binary outcome probability, called the binary entropy function.
Entropy of a Bernoulli trial (in shannons) as a function of binary outcome probability, called the binary entropy function.

Worked examples

Example 1 — a first encounter with Binary entropy function

Start with the simplest possible case. Write down what Binary entropy function 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 entropy function 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 entropy function 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 entropy function

In research
Binary entropy function 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 entropy function 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 entropy function is common in secondary-school and first-year university syllabi. It links to neighbouring topics Entropy and information, so understanding it makes those chapters shorter.
In everyday life
Look for Binary entropy function 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 entropy function” →

How to study Binary entropy function in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Binary entropy function 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 entropy function out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Binary entropy function in simple terms?

In information theory, the binary entropy function, denoted H⁡(p) or Hb(p), is defined as the entropy of a Bernoulli process (i.i.d. binary variable) X with probability p of one of two values, and is given by the formula: H⁡(X)=−plog⁡p−(1−p)log⁡(1−p). The base of the logarithm corresponds to the ch…

Why does Binary entropy function 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 entropy function?

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 entropy function.

Tags

  • Entropy and information

Keep exploring