ength is used indifferently to represent long 10.4 Lempel-Ziv coding or short phrases (and even single symbols), all of them having nearly equal occurrence probability. This should not be confused with the principle of block codes (Chapter 9) where the codeword length is fixed but the corresponding distribution is nonuniform. Another key difference is that LZ is an adaptive algorithm, which is capable of learning from the source's characteristics (the most frequently used symbol-sequence patterns, like English words or their fractions) and to generate optimal codewords on the fly, without having to parse the entire message sequence, or to assume any probabilistic model for the source. We shall now analyze the details of the LZ algorithm by considering a binary sequence and parsing it into distinct phrases. In the following, we shall use binary message strings with 1 and 0 bits as the symbol alphabet, but this does not remove the generality of the LZ algorithm in terms of alphabet size. As a working example, assume the following 25-bit sequence: 0101101101001000101101100. Parsing the sequence consists of generating a list of all distinct phrases that can be identified in the sequence, each one being different from any one previously observed. Each phrase is then assigned an address number 1, 2, 3, which called pointer. Using the above sequence, this parsing action gives: Phrase: 1 01 10 11 010 0100 0101 101 100; Pointer (decimal): 12345678910; Pointer (binary): 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010. We note that the 10 identified phrases have equal probability, namely p= 1/10. We also note that each phrase is the prefix of some other phrase coming up in the list: for instance, phrase 3 (01) is the prefix of phrase k=6 (010); in turn, phrase k = 6 is the prefix of phrases = 7 (0100) and k = 8 (0101), and SO on. We can, therefore, associate a prefix phrase with the two other phrases that differ only by the last bit, for instance 7 <-> (6, 0) and 8 (6, 1), where the first number is the prefix pointer and 