Chapter Questions
What is the smallest length of a block code with the same source alphabet $\{A, B, \ldots, Z\}$ and the same code alphabet $\{\cdot,-$, space $\}$ as the Morse code?
Is the code in Figure 5 uniquely decodable? Is it instantaneous? Can you find an instantaneous code with the same lengths of code words?
Is the code in Figure 6 uniquely decodable? If not, exhibit two source messages with the same code.
Is the code in Figure 7 uniquely decodable?
Can you decide unique decodability of the two crides in Figure 8 by using Kraft's inequality?
Construct a binary instantaneous code for the following source alphabet with the prescribed lengths of code words:$$\begin{array}{c|cccccccccccc}\hline \text { Symbol } & \text { A } & \text { B } & \text { C } & \text { D } & \text { E } & \text { F } & \text { G } & \text { H } & \text { I } & \text { J } & \text { K } & \text { L } \\\text { Length } & 2 & 4 & 7 & 7 & 3 & 4 & 7 & 7 & 3 & 4 & 7 & 7 \\\hline\end{array}$$
Construct a ternary (three code symbols) instantaneous code for the following source alphabet with the prescribed lengths of code words:$$\begin{array}{c|cccccccccc}\hline \text { Symbol } & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 0 \\\text { Length } & 1 & 3 & 3 & 3 & 3 & 2 & 2 & 2 & 2 & 2\end{array}$$
How many code symbols are needed if the following source alphabet is to be encoded into an instantaneous code with the prescribed lengths of code words:$$\begin{array}{cccccccccccccccc}\hline \text { A } & \text { B } & \text { C } & \text { D } & \text { E } & \text { F } & \text { G } & \text { H } & \text { I } & \text { J } & \text { K } & \text { L } & \text { M } & \text { N } & \text { O } & \text { P } \\1 & 2 & 2 & 2 & 1 & 2 & 2 & 2 & 1 & 2 & 2 & 2 & 2 & 2 & 1 & 2 \\\hline\end{array}$$
Prove that for each instantaneous code for which Kraft's inequality is not an equality, it is possible to add a new source symbol and extend the given code to an instantaneous code (with the same code alphabet). Demonstrate this on the code found in Exercise 1.6.