Skip to content
Free standard shipping to supported destinations
Delta-Xi LogoDelta Xi
ShopOur storyLearnHelp
Learn
OverviewConcepts
Back to Concepts
🧠
CS Theoryequation

Shannon entropy

Measure uncertainty in a set of possible messages.

H(X)=−∑xp(x)log⁡2p(x)H(X)=-\sum_x p(x)\log_2 p(x)H(X)=−x∑​p(x)log2​p(x)

Library note. Check the assumptions and further reading before applying a formula.

What Is This?

Entropy measures the average uncertainty of a random outcome. An outcome that is nearly certain tells you little when it happens. A rare outcome tells you more. Shannon entropy averages that surprise over all outcomes. Using base-two logarithms gives bits. The probabilities describe the source; entropy does not measure whether a message is useful, truthful or meaningful.

Try an example

A fair coin has one bit of entropy per toss. A coin that always lands heads has zero. Knowing the next result of the second coin adds no information about its outcome.

Where it needs care

This sum is for a discrete distribution, with zero-probability terms taken as zero. Continuous differential entropy has different properties and is not a direct substitute.

Historical Context

Claude Shannon introduced the framework in "A Mathematical Theory of Communication" (1948) to study communication and coding limits.

Real-World Applications

  • Find theoretical limits for lossless compression.
  • Measure uncertainty in classification models.

Further reading

  • Further reading: Shannon entropy
Difficulty:Intermediate
Delta-Xi LogoDelta Xi

A place for good ideas, on a shirt or off the page.

Say hello

Explore

  • Shop all
  • Mathematics T-shirts
  • Accessories
  • Learn
  • Our story

Here to help

  • Contact
  • Size & care questions
  • Shipping & returns
  • Your orders
  • Track an order

Keep in touch

  • Instagram
  • Discord
  • Telegram
  • Affiliate programme

© 2026 Delta Xi. Prices in USD.

PrivacyTerms

Your cookie choices

Essential cookies keep your basket and sign-in working. Optional cookies help us understand visits and measure ads. Privacy details.

Related Concepts

🧠

Halting Problem

The undecidable problem of determining whether a p

🧠

NP-Completeness

Class of problems that are both in NP and NP-hard,

🧠

P vs NP Problem

The most important open problem in computer scienc