Question 1204708: In the USA, ZIP codes are used as an alternative to the postcode system
used in the UK. A ZIP code is a five-digit number which may start with a
zero - so there are, in total, 100 000 possible ZIP codes, from 00000 to
99999.
Some ZIP codes are ambiguous, meaning that, when shown on a digital
display, they would show a different code if read the wrong way up.
For example, 10118 (which happens to be the ZIP code for the Empire
State building in New York), if read upside-down, would be 81101 (the
ZIP code for Alamosa, a town in Colorado), so both 10118 and 81101 are
ambiguous ZIP codes.
Given that the figures used on a digital display are the ones shown
below (0 1 2 3 4 5 6 7 8 9), determine the total number of non-ambiguous ZIP codes.
Found 2 solutions by math_tutor2020, ikleyn: Answer by math_tutor2020(3817) (Show Source):
You can put this solution on YOUR website!
Here's the list of possible digits when using a digital display (think of an alarm clock)
Another term for it is called seven-segment display because we need at most 7 lines to form the digits 0 through 9

Image Source
https://codegolf.stackexchange.com/questions/151125/mirrored-digital-clock
0,1, and 8 can be rotated 180 degrees about the center and the digits won't change (as mentioned in the instructions).
If we rotated 6, then it turns into 9, and vice versa.
Rotating a 2 will have it land on itself. Meaning it won't change. Same goes for 5.
Here are all of the ambiguous digits
0, 1, 2, 5, 6, 8, 9
Here are the non-ambiguous digits
3, 4, 7
There are 3 items in that non-ambiguous set of digits.
Having 5 such digits, where repeats are allowed, would give us 3^5 = 243 non-ambiguous zip codes.
Answer by ikleyn(52787) (Show Source):
You can put this solution on YOUR website! .
My understanding is different, and therefore my solution and my answer are different.
As I understand from the problem's description, we should look in each 5-digit number (ZIP-code)
and compare it with another ZIP-code, as if we look "upside-down".
"Upside-down" means that every digit is rotated 180 degrees about its center the order of digits
is opposed to the original order (reversed).
Non-ambiguous codes are those that look the same when we look at them as they are written
and as we look at them "upside-down".
I consider two categories of digits.
First category are those digits, that transform to themselves (with no change)
under the rotation 180 degrees about their center.
This set of digits is T = { 0, 1, 5, 8 }. (T originates from word "Themselves").
Second set are those digits, that transform to some (other or the same) digit
under the rotation 180 degrees about their center.
This set of digits is D = { 0, 1, 5, 6, 8, 9 }. (D originates from word "Digits").
Notice that set D contains set T as a sub-set.
Now, non-ambiguous numbers are the numbers of the form
where a digit designates the image of a digit from the set D
under rotation 180 degrees about their center; "t" is from set T.
In the first (leftmost) position, we have 6 possible digits from set D.
In the next, second position from leftmost position, we again have 6 possible digits from set D.
In the next, third position from leftmost position, we have 4 possible digits from set T.
These 6*6*4 = 144 digits are our "independent variables".
In the 4-th and 5-th position, we have "derivative" digits, so they are not "independent variables".
Thus, the total number of all possible 5-digit zip-codes is 10,000.
Of them, 6*6*4 = 144 codes are non-ambiguous: they remain the same when we look at them upside-down.
ANSWER. The number of non-ambiguous zip-codes is 144.
Solved.
|
|
|