A source generates four messages m1, m2, m3 and m4, with probabilities 0.5, 0.25, 0.125 and 0.125 respectively. The messages are generated independently of each other. A source coder assigns binary code to each message. Which of the following codes has minimum average length and is also uniquely decodable (sequence as per m1, m2, m3, m4)?
A. 00, 01, 10, 11
B. 0, 1, 10, 11
C. 110, 111, 10, 0
D. 0, 10, 110, 111
Answer: Option D
Join The Discussion