Skip to content
← All questions

What is the formal definition of entropy H(X)H(X) for a discrete random variable X, and what does it represent?

Entropy H(X)H(X) is formally defined as the expected surprise of a random variable XX. It is calculated using the formula H(X)=−∑xp(x)log⁡2p(x)H(X) = - \sum_{x} p(x) \log_2 p(x), where p(x)p(x) is the probability mass function of XX. Using a logarithm base of two means the entropy is measured in bits. It quantifies the inherent uncertainty of XX; the more evenly distributed the probabilities are, the higher the entropy.

Conditions

  • XX is a discrete random variable.
  • The summation runs over all possible values of xx.
  • p(x)p(x) is the probability mass function, satisfying p(x)≥0p(x) \ge 0 and ∑xp(x)=1\sum_x p(x) = 1.
  • Using logarithm base two yields entropy measured in bits.

Reasoning, step by step

  1. Identify the random variable XX and its possible values xx.
  2. Determine the probability mass function p(x)p(x) for each value.
  3. Apply the formula H(X)=−∑xp(x)log⁡2p(x)H(X) = - \sum_{x} p(x) \log_2 p(x).
  4. Interpret the result as the expected surprise or uncertainty about XX.

Example

For a fair coin with P(H)=0.5P(H)=0.5 and P(T)=0.5P(T)=0.5, the entropy is exactly 1.0 bit. For a biased coin with P(H)=0.9P(H)=0.9 and P(T)=0.1P(T)=0.1, the entropy drops to approximately 0.47 bits.

Common misconceptions

  • Assuming entropy depends only on the number of possible outcomes; it actually depends on how uniformly the probability distribution is spread.
  • Confusing entropy with the probability of a single specific outcome.

Watch the explanation

Connected concepts

Explore next

Related questions

Meet the concept

↗
Understand why

↗
Meet the concept

↗
Understand why

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.