 (and been famous). Let's say I somehow magically know the codewords {y1,..., YN}, and I now want to figure out the best cells Figure 4.17 Quantizer graph indicating the {R1,...,RN} (best from the standpoint of variables of the quantizer minimizing the mse). It simply makes sense that if I'm trying to minimize the error, the best cell R1 (inputs X mapped to y') is the set of values of X that are closest to y1; the best cell R2 (inputs x mapped to y2) consists of the values of X closest to Y2; and SO on. That's the first rule. Let me state this rule formally for you: Rule 1: Nearest Neighbor Rule Given the codewords { , yn }, the best cell R is the set of values of X that are closer to yi than any other codeword. To make the rule look more impressive, we'll write it mathematically as R {xe/x-ypsx-y,ji = As a very simple example of this rule, consider the earlier example of my saying a number between 1 and 10 and you, the quantizer, saying back the integer that mini- mizes the error between the number I shout and the integer you shout back. I shout 8.7 and you shout 9 (error 0.3); I shout 1.2 and you scream 1 (error 0.2). In this game it's easy to see that if we're trying build a quantizer to minimize the average error (or average squared error), the values I shout between (for example) [7.5, 8.5) are mapped to 8 by you. In other words, the cell R8 is made up of the values closest to y's = 8. That's exactly what our Rule 1 says. Now for Rule 2. This rule is all about how to do this: I give you a cell R, and you give me the "best" codeword for that cell, yi. (By best, I mean the codeword that minimizes the mse.) How do you do that? You choose yi to be the average value of all Source Coding and Decoding: Making it Digital the values in the cell R So, if my cell is R8, and it's made up of the X values [7.5,8.5), and all these X values are equally likely, then the best choice for yi is the average value of 8 (best for minimizing the average value of squared error). Let's define this rule with more mathematical detail. 