Statistics formula reference

Shannon Entropy

Measures uncertainty in a discrete probability distribution in bits.

Open in editor
LaTeXH(X)=-\sum_i p_i\log_2 p_i

Variables

  • H(X): entropy
  • p_i: probability of outcome i

How to use this formula

Measures uncertainty in a discrete probability distribution in bits.

Important notes

  • Terms with p_i=0 contribute zero by continuity.
  • Changing the logarithm base changes the unit.

Quick example

A fair binary variable has entropy 1 bit.

Applicability, worked calculation, and verification

Assumptions and domain checks

  • Terms with p_i=0 contribute zero by continuity.
  • Logarithm arguments must be positive in the real domain, and the base must be stated when it is not implied.
  • For the Shannon Entropy, the index variable, lower bound, upper bound, and any empty-sum or empty-product convention must be clear.
  • For the Shannon Entropy, identify whether each quantity is a sample statistic, population parameter, estimator, or model value, and check the method assumptions.

Worked example

Input

Output

A fair binary variable has entropy 1 bit.

Common mistakes

  • Do not omit the index or bounds in Shannon Entropy; changing either one changes which terms are included.
  • For the Shannon Entropy, do not interpret a descriptive statistic as a causal or population conclusion without the sampling and model assumptions.

Continue the workflow

Use Shannon Entropy in your own work

  1. Check the domainMatch the variables and assumptions to the problem before substituting values.
  2. Copy the exact notationPreserve grouping, signs, and exponents in H(X)=-\sum_i p_i\log_2 p_i.
  3. Edit or convertOpen the expression in the LaTeX editor, then export it for your document or web page.

Review and verification

Last reviewed: 2026-07-23

Automated quality check: Kept noindex until the missing evidence is supplied.

Formula references

Frequently asked questions

What is the Shannon Entropy used for?

Measures uncertainty in a discrete probability distribution in bits.

Can I copy this formula as LaTeX?

Yes. Copy H(X)=-\sum_i p_i\log_2 p_i or open it in the LaTeX editor.

What should I check before using it?

Confirm that each variable, unit, domain restriction, and assumption matches the problem.

Reuse, attribution, and correction

Share this reference without losing its source

Copy a citation, permanent link, Markdown link, or self-contained embed card. Each reusable format points readers back to the maintained canonical page.

Report an issue

Search the whole reference

Symbols, formulas, guides, tools and commands

Start typing to search.

move · Enter open · Esc close