handle and decompress the payload). Block codes are used, for instance, in error-correction, which will be described in Chapter 11. Here, we shall focus on the simplest type of block codes, which make it possible to encode source symbols with higher bit/codeword efficiency. As we shall see, block coding results in significantly longer codewords, and the codeword dictionary is also significantly greater. The key advantage is that the mean bit/codeword is considerably reduced, which enables much more data to be packed per 9.3 Block codes Block Block symbol codeword 1 1.00 11101 11011 11010 11001 11000 01110 111001 111000 011111 011110 Figure 9.4 Block coding by symbol pairs XiXj of the source X = {X1, X2, X3, x4}, with respective probabilities p(x) = {0.5, 0.2, 0.2, 0.1} through the Huffman-coding algorithm. The column at left shows the block codeword probabilities in decreasing order. The column at right shows the block codeword assignment resulting from the algorithm implementation. transmitted bit. I shall illustrate this property with three examples, which have also been designed to make the subject entertaining. Example 9.1: Four-event source Consider the four-event source X = {x1, X2, X3, x4} previously analyzed in Fig. 9.1, which is defined by the distribution p(x) = {0.5, 0.2, 0.2, 0.1}. As we have seen, its entropy is H(X) = 1.76 bit/symbol, and its optimal mean length (Huffman coding) is L(X)=1.80 bit/symbol. The corresponding coding efficiency is n = 1.76/1.80 = 97.8%. We shall now implement block-coding by grouping the sym- bols in ordered pairs (xixj), forming the new and extended 16-event source {x1x1, X1X2, X4X2, X4X3, X4X4} with associated probabilities p(xixj) = p(xi)p(xj), the events being assumed to be independent. It is a patient exercise to determine the Huffman code for X'. The result is shown in Fig. 9.4, with details and results summarized in Table 9.3. We find that the extended source entropy is H(X') = 3.522 bit/symbol, which is equal to H(X), as expected for a source of joint independent 