BREAKING THE “ZIP CODE” CODE

Betty Travis University of Texas at San Antonio

As a mathematics educator to preservice teachers, I try to stress the importance of incorporating problem solving strategies into classroom activities. One of the most successful experiences I have had with preservice teachers in problem solving in general and pattern matching in particular is deciphering the zip code on envelopes. This article outlines our process for deciphering the code as a class project.

We organized our approach in the following manner: A. Gathering the Data

We gathered several envelopes with a 78239 zip code. There was no particular reason for this number, other than we wanted each digit to be unique. We then collected codes with 78231, 78234, 78235, 78236, and 78230. Using this approach we could make unique bar assignments for each of the digits 0 – 9.

B. Organizing the Data Here we encountered our first problem. Notice:

78239 78231 78234 78235 78236 78230

By matching we could see the “7823” codes; but there were too many additional bars remaining to account for only one extra digit.

78239 78231 78234 78235 78236 78230

21 bars 11 bars Also, the bars that matched for “7823” numbered 21. How could an even number of digits be represented by an odd number of bars, assuming there was the same number of bars for each digit? Also, the number of unassigned bars remaining in the code was an odd number. Remembering from computer science that some codes use an initial and final bar, we stripped a bar off the beginning and end of each zip code. Since the ‘7823’ group now had 20 bars, we assumed that each digit was written with a 5–bar code. This also meant that there were two remaining digits in the code, instead of just one, since the last group now had 10 bars. The digit code was now deciphered as follows:

78239  _{_{7} _{8} _{2} _{3} _{9}}
78231  _{_{7} _{8} _{2} _{3} _{1}}
78234  _{_{7} _{8} _{2} _{3} _{4}}
78235  _{_{7} _{8} _{2} _{3} _{5}}
78236  _{_{7} _{8} _{2} _{3} _{6}}
78230  _{_{7} _{8} _{2} _{3} _{0}}

or:

1  6
2  7
3  8
4  9
5  0

C. Analyzing the Data

We soon realized that only two long bars were ever used in the code for each digit. Since the 5–bar code had to represent the digits 0 – 9, we needed to find a unique representation for each of the numbers using a combination of either two digits (represented by the long bars) or three digits (represented by the short ones). After some discussion, we hypothesized that the long bars represented numerical assignments of some place value while the short bars represented 0. (If this assumption proved incorrect, we would switch the assignments and try again.) When we ignored the last bar of the 5–bar code for each digit, we saw a similarity with the

binary system – until 7  , 8  , and 9  . For example:

Digit  Code  Binary Code
1  0001
2  0010
3  0011
4  0100
5  0101
6  0110
7  0111
8  1000
9  1001

This led us to believe that the left–most position in the 5–bar code must equal ‘7’.

The rules for establishing the 5–bar code were: a. All small bars equal 0. b. A long bar in the left–most position equals 7. c. A long bar in the next left position equals 4. d. A long bar in the middle position equals 2. e. A long bar in the next left position equals 1. f. Any size bar in the right–most position equals 0.

The “Zip Code” Code was now finalized: 74210. For example:

Digit  Bar Code

1 74210 00010=1

5 74210 04010=4+1=5

9 74210 70200=7+2=9

This assignment was valid for all values except 0. Yet, 0 could be an exception to the rule since the total for 0 = 7 + 4 = 11 was not a valid digit.

We tried to understand why the ‘74210’ system was used. After some discussion, one student suggested that by using this system, \underline{all} digits from 1 – 9 could be represented using only two of the digits in ‘74210’. (Remember, the ‘0’ would be an exception.)

Now our problem was to investigate the reason for the remaining digit on each zip code. What was its purpose? How did it relate to the other digits in the zip code? For example, the coding for 78239 had an extra digit of ‘1’.

78239  _{_{7} _{8} _{2} _{3} _{9} _{1}}

From other envelopes we deciphered:

Zip Code  Extra Digit
78713-9961  9
77097-0049  7
78217  5
88901-6001  7

Remembering the “casting out nines” procedure, one student suggested that we find the sum of the digits in each code. A table was made to suggest a possible explanation for this extra digit.

Zip Code  Sum of Digits Extra Digit Sum of All Digits
78239  29  1  30
78713-9961  51  9  60
77097-0049  43  7  50
78217  25  5  30
88901-6001  33  7  40

The extra digit, used as a check digit, represented the difference between the sum of the digits and the next higher multiple of 10. D. Extending the Problem

Many of my former students have used this problem successfully in their upper Elementary, Middle School and Fundamentals of Math classes. Several have invited a representative from the Post Office to talk to their students about the code. Students were urged to write to the Postal Authorities in Washington, D.C. to inquire about the reasons behind the selection of the check digit. Was there a reason why the “casting out nines” approach was not used? Why use the next higher multiple of 10? How often do errors occur? What is the most common error?

This one problem provided my students with an excellent opportunity to use the problem solving skills that we had discussed during the semester to put problem solving strategies into practice.

Note 1: One of my students noticed that the zip code printed on return envelopes for NCTM (22091-1593) has the following code:

_{2} _{2} _{0} _{9} _{1} _{9} _{9} _{8} _{8} _{2}

The last four digits do not match the coding. Does anyone at NCTM know that the coding is incorrect?

Note 2: The zip code coding system may vary from region to region. The interested reader should check with their local post office for further details.