Answer to problem 1: A choice between 4 (equally likely) possibilities can be represented as 2 bits of information, so one solution would be

00 for O
01 for +
10 for <
11 for >

or any other assignment of these four 2-bit patterns to the four characters.

Note that a code like, for example

0 for O
1 for +
10 for <
11 for >

is no good because you can't tell if a message 110 means >O, +<, or ++O. If a certain bit pattern codes for one symbol, the same bit pattern cannot also form the first part of the code for another symbol.


back to the article