54 Entropy
Table 4.1 Calculation of entropy associated with the result of rolling two dice. The columns show the
different possibilities of obtaining values from 2 to 12, the corresponding probability p and the product
−p log
2
p whose summation (bottom) is the source entropy H, which is equal here to 3.274 bit/
symbol.
Sum of dice numbers Probability (p) −p log
2
(p)
2 = 1 + 1 0.027 777 778 0.143 609 03
3 = 1 + 2 = 2 + 1 0.055 555 556 0.231 662 5
4 = 2 + 2 = 3 + 1 = 1 + 3 0.083 333 333 0.298 746 88
5 = 4 + 1 = 1 + 4 = 3 + 2 = 2 + 3 0.111 111 111 0.352 213 89
6 = 5 + 1 = 1 + 5 = 4 + 2 = 2 + 4 = 3 + 3 0.138 888 889 0.395 555 13
7 = 6 + 1 = 1 + 6 = 5 + 2 = 2 + 5 = 4 + 3 = 3 + 4 0.166 666 667 0.430 827 08
8 = 6 + 2 = 2 + 6 = 5 + 3 = 3 + 5 = 4 + 4 0.138 888 889 0.395 555 13
9 = 6 + 3 = 3 + 6 = 5 + 4 = 4 + 5 0.111 111 111 0.352 213 89
10 = 6 + 4 = 4 + 6 = 5 + 5 0.083 333 333 0.298 746 88
11 = 6 + 5 = 5 + 6 0.055 555 556 0.231 662 5
12 = 6 + 6 0.027 777 778 0.143 609 03
= 1.
Source entropy
= 3.274.
where the first bit x is zero for all six outcomes. Nothing obliges us to attribute to each
outcome its corresponding binary value. We might as well adopt any arbitrary 3-bit
mapping such as:
x = 1 → 100 x = 2 → 010 x = 3 → 110
x = 4 → 001, x = 5 → 101, x = 6 → 011.
The above example illustrates a case where entropy and symbol information are equal,
owing to the equiprobability property. The following examples illustrate the more general
case, highlighting the difference between entropy and information.
Two-dice roll
The game consists in adding the spots obtained from rolling two dice. The minimum
result is x = 2(= 1 + 1) and the maximum is x = 12 (= 6 + 6), corresponding
to the event space X =
{
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
}
. The probability distribution
p(x) was described in Chapter 1, see Figs. 1.1 and 1.2. Table 4.1 details the 11 differ-
ent event possibilities and their respective probabilities p(x). The table illustrates that
there exist 36 equiprobable dice-arrangement outcomes, giving first p(1) = p(12) =
1/36 = 0.027. The probability increases for all other arrangements up to a maximum
corresponding to the event x = 7 with p(7) = 6/36 = 0.166. Summing up the values
of −p(x)log p(x), the source entropy is found to be H = 3.274 bit/symbol. This result
shows that, on average, the event can be described through a number of bits between 3
and 4. This was expected since the source has 11 elements, which requires a maximum
of 2
4
= 4 bits, while most of the events (namely, x = 2, 3, 4, 5, 6, 7, 8, 9) can be coded