## Invitation to Computer Science 8th Edition

The fixed-length 4 -bit representation of ALOHA requires $5 \times 4=20$ bits. Using the variable-length code requires the following: $\begin{array}{cccc}{A} & {L} & {0} & {H} & {A} \\ {00} & {1111111} & {0111} & {010} & {00}\end{array}$ which is a total of 18 bits. The compression ratio is $20 / 18=1.11 .$
The fixed-length 4 -bit representation of ALOHA requires $5 \times 4=20$ bits. Using the variable-length code requires the following: $\begin{array}{cccc}{A} & {L} & {0} & {H} & {A} \\ {00} & {1111111} & {0111} & {010} & {00}\end{array}$ which is a total of 18 bits. The compression ratio is $20 / 18=1.11 .$