Let be a Discrete Memoryless Source taking values in
Let be a Code
Define the word length as a Random Variable

The expected word length is