Cryptography & Security
Advanced

Shannon Entropy

Average information content — and the theoretical strength of a random source.

Formula

H=ipilog2piH = -\sum_i p_i \log_2 p_i

Variables

HEntropy (bits)
p_iProbability of symbol i

Example

Fair coin: H = -2(0.5 log 0.5) = 1 bit

Did You Know?

Claude Shannon coined the term 'bit' and founded information theory in a single 1948 paper.

Share this formula