Unwanted Zip Codes

In a certain country, they make use of ZIP (Zoning Improvement Plan) codes to help direct mail. Each city/town makes use of a 5-digit code (which could start with 0). For example, Rose Hill's ZIP is 18619.

Because certain codes could be interpreted differently when read upside down, they have been marked as unwanted. For example, Rose Hill's ZIP code becomes 61981 when read upside down, hence it is not used.

How many 5-digit ZIP codes are unwanted?

Note: This not an original problem.


The answer is 3050.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Jimmy Qin
Dec 1, 2014

Consider the digits 0 through 9. 0,1,8 have rotational symmetry; 6,9 are rotationally symmetric with each other.

This means that all possible unwanted zip codes must contain only 0,1,6,8,9. Otherwise, the code would not be a number when read upside down. Since we have 5 possible digits in {0,1,6,8,9}, and the zip codes contain 5 digits, we have a preliminary total of 5^5 unwanted codes.

A code containing only 0,1,6,8,9 is still good if it reads the same upside down as right side up. Suppose the code ABCDE reads the same upside down. This means

  • A and E are rotationally symmetric with each other
  • B and D are rotationally symmetric with each other
  • C has rotational symmetry.

The pairs (A,E) and (B,D) could be (0,0), (1,1), (8,8), (6,9), (9,6). C can be 0,1, or 8. The number of these good codes is #(A,E) * #(B,D) * #C = 5 * 5 * 3.

Hence, the number of unwanted zip codes is 5^5 - 5 * 5 * 3 = 3050.

I actually considered codes such as ( 6 9 ) (*6*9*) , ( 9 6 ) (*9*6*) , ( 66 99 ) (66*99) , ( 99 66 ) (99*66) , ( 69 69 ) (69*69) and ( 96 96 ) (96*96) as wanted because they read the same upside-down. And I ran out of tries.

Chew-Seong Cheong - 6 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...