I tried calculating the Shannon entropy for a which is 0.. I am confused how huffman would encode and store this, as it's programmatically impossible to store string "a" with 0 bits in a computer system.
1 Answer
Indeed the code for a single symbol would be zero bits. However you have to answer some other questions.
- How is the code itself transmitted to the receiver?
- How does the receiver know that it is done decoding?
To answer those questions, you'd need more bits in the stream for the receiver.