Introducing Informational Entropy
Abstract
The concept of Shannon's informational entropy is introduced through a series of exercise problems. The problem was designed by the author as a part of assignment of Brown PHYS 1530.
- Published
- Reading time
- 4 min
- Level
- Intermediate
Problem
The concept of entropy in a thermodynamic context is directly tied to the multiplicity () of accessible microstates. A remarkably similar idea exists in information theory, where entropy quantifies the actual information content of a bit string, setting a fundamental limit on how efficiently it can be compressed.
Typically, we deal with a system described by a probability distribution over possible outcomes. We begin with the simplest case: a binary string where the probability of encountering a 0 is and a 1 is . (Note: Throughout this problem, all logarithms are base 2, i.e., .)
-
Calculate the multiplicity , i.e., the total number of distinct -bit strings containing exactly 0's and 1's.
-
To uniquely map all possible configurations into -bit compressed strings, we require . Using Stirling's approximation in the limit of large , show that the minimum required length is , where the Shannon entropy is defined as
-
Examine the properties of the Shannon entropy :
-
For what value(s) of does reach its minimum and maximum?
-
What symmetry does have?
-
How many "logical" bits are contained in "physical" bits?
-
Is it plausible to interpret as both (i) the optimal compression ratio and (ii) the average number of logical bits per physical bit?
-
-
By the time this problem was written, this document contained 0's and 1's when converted to binary. What is the total Shannon entropy of this document (in bits)? How many bits can it be compressed into?
-
Now generalize Eq. (1) to a system with discrete outcomes with probability distribution satisfying and . By considering the multinomial multiplicity of an -character string, show that the generalized Shannon entropy per character is
-
Alternatively, we can divide a binary file into 8-bit chunks (bytes), matching standard ASCII character encoding. The table below lists the 10 most frequent characters and their counts in this document:
␣ 2225 n 516 e 1099 o 500 t 965 r 484 i 690 s 482 a 622 \ 396 Assuming the entire document only consists of these 10 characters, approximate the entropy . Does exceed 1? Why is that result consistent?
Solution
-
It is just choosing where the 's should go among places.
-
Using Stirling's approximation,
-
Some properties of the Shannon entropy are:
-
has a minimum value of at and ; and the maximum value of at . This is in agreement with our intuition that we have zero uncertainty about obtaining (or ) with unit probability and that we have maximum uncertainty when the probabilities for getting and are equal.
-
is symmetric with respect to ; we would still have the same amount of uncertainty about the information source if we obtained 's with probability .
-
We can interpret the results as "physical" bits containing "logical" bits.
-
So it follows that can be understood in both ways.
-
-
's appear with probability and 's with probability .
Effectively, logical bits are contained in a single physical bit. It cannot be compressed efficiently.
-
We begin with the same idea of taking logarithm to the multiplicity:
In the last line we define the -independent part as the generalized entropy (including the minus sign).
-
If you convert the letter frequencies into probabilities and calculate with the formula obtained in the previous problem, you get . This should be interpreted as `containing logical bits per physical byte (8 bits)'. Although the entropy value itself may exceed 1, this is still consistent with our intuition that the optimal compression ratio cannot exceed 1.



Comments
Loading…