
32 ◾ Computational Thinking for the Modern Problem Solver
Every bit that is added to a bit string doubles the number of patterns
that the string can exhibit. is leads us to a very useful generalization to
the question of how many patterns a bit string can exhibit. More speci-
cally, we note that the number of patterns that a bit string of length N can
exhibit is 2
N
. Figure2.4 gives insight into this pattern.
Real-world information can then be encoded as data by arbitrarily
associating pieces of information with a particular bit pattern. We might,
for example, associate the color red with the pattern 100, the color green
with the patter ...