# Huffman Coding ws14 ex.1g)

Hi,

Is there more than one representation for the letters? For example, I got for L 0001, but in the solutions it's either 001 or 01110. I also got some other letters wrong, but some of them are true.

There is more than one correct solution. In the example, we have probabilities (E,0.5);(O,0.125);(S,0.125);(U,0.10);(L,0.05);(N,0.05);(G,0.05) and Huffman encoding is based on a sorting of the letters according to their probabilities. As there are some letters with the same probabilities, you can sort differently and this way you get different codes. Their average number of bits per symbol should however be the same, even though for certain symbols you will have different number of bits. For example, for L,N,G two will have five bits and one of them just four, which one does not matter for the average number of bits per symbol, but of course for the particular encoding it matters.
by (162k points)
selected
So there could be one representation for example where L,N,G are four bits? Or it strictly has to be two five bits + one four bit?