Solution (source code)

= Solution

A <block code for line coding> divides the data into five-<bit> groups and assigns each of the $2^5=32$ possible groups a distinct eight-<bit> <codeword>. The receiver reverses that assignment after finding the eight-<bit> boundaries. There are $2^8=256$ candidate <codewords>, so the designer has substantial freedom to select 32 suitable ones and reserve other patterns for control or synchronization.

The choice can limit long runs of equal <bits> to help <clock recovery>, balance high and low levels to reduce a persistent offset, and distinguish control patterns from data. These properties must hold across adjacent <codeword> boundaries too: two individually acceptable words can concatenate into an unacceptable run. The unused patterns can also help <error detection and correction>: an invalid received pattern exposes some errors, and the <Hamming distance> between valid <codewords> determines stronger guarantees. Redundancy alone does not imply that all errors are detected or correctable. Circuit complexity and propagation of a synchronization error also matter.

Before any further <line coding> or <framing> overhead, the useful fraction and expansion are
$$
\boxed{\text{useful fraction}=\frac58=62.5\%,\qquad \text{transmitted bits per data bit}=\frac85.}
$$
The three extra <bits> per five input <bits> are 60% overhead relative to the input, or 37.5% of the encoded output.