Hypothesis Testing and Statistical Inference
This tool calculates the Shannon entropy based on a set of probabilities or from a given text message, providing a measure of information uncertainty in bits.
Explore different scenarios to understand how Shannon entropy is calculated and interpreted.
A fair coin has two outcomes (Heads, Tails) with equal probability.
Probabilities: 0.5, 0.5
A six-sided die that is biased. For example, the probability of rolling a 6 is high.
Probabilities: 0.1, 0.1, 0.1, 0.1, 0.1, 0.5
A short, repetitive text message has low entropy.
Text: "abababab"
A text with a variety of characters has higher entropy.
Text: "The quick brown fox jumps over the lazy dog."
p(x)
is the probability of an event x
. log₂(p(x))
represents the information content or 'surprisal' of that event. Events with low probability have high surprisal. We multiply the surprisal of each event by its probability and sum these values. The negative sign ensures the result is positive, as probabilities are ≤ 1 and their logarithms are non-positive.