RunRyder RC
 1  Topic Subscribe
WATCH
 1 page 1223 views POST REPLY
HelicopterOff Topics › A Zip Code Problem...
12-13-2004 12:04 AM  13 years agoPost 1
rchelipilot121

rrNovice

Crap!! I'm here again!!

My Posts: All  Forum  Topic

In America they make use of ZIP (Zoning Improvement Plan) codes to help direct mail. Each city/town makes use of a 5-digit code (we shall ignore ZIP+4 codes); for example, Hillsgrove, Pennslyvania, is 18619.
However, due to rotational symmetry certain codes, like the one used for Hillsgrove are detour-prone, as they could be read as a different code upside down. As a result, 61981 (Hillsgrove's ZIP code read upside down) is not used.
How many 5-digit ZIP codes are detour-prone?

PM  EMAIL  Attn:RR  Quote
12-13-2004 11:14 AM  13 years agoPost 2
rchelipilot121

rrNovice

Crap!! I'm here again!!

My Posts: All  Forum  Topic

Bumped so tvhalter could find it.

PM  EMAIL  Attn:RR  Quote
12-13-2004 12:40 PM  13 years agoPost 3
Colibri

rrKey Veteran

The Netherlands

My Posts: All  Forum  Topic

Thanks, I will work on it later as I'm at work right now.

Tim

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 03:31 PM  13 years agoPost 4
Drunk Monk

rrProfessor

Preston, UK

My Posts: All  Forum  Topic

I work it out as 3125 possible detour prone codes.

I reckon there are 5 numbers than can be read either way up; 1,6,8,9,0

And so for 5 possible numbers per digit of zip code, I reckon 5 x 5 x 5 x 5 x 5 gives 3125 possible combinations of those numbers for a 5 digit number. That's including 00000.

Possibly.........

Maybe............

Hopefully?......


Stephen

I only open my mouth to change feet.....

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 04:19 PM  13 years agoPost 5
Colibri

rrKey Veteran

The Netherlands

My Posts: All  Forum  Topic

You are not meeting all requirements.

A number must be 5 digits so if it ends with a '0' it will start with a '0' if read upside down. I assume zip codes consisting of 5 digits will not start with one or more '0'.

One other requirement is that it must lead to a different zip code when read upside down. This means that a code that reads the same if upside down it is not considered different (detour prone). For example 16091 reads the same when upside down.

Still working (ahum ) so still no time to work on it.

Tim

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 05:25 PM  13 years agoPost 6
Drunk Monk

rrProfessor

Preston, UK

My Posts: All  Forum  Topic

hmm, back to the drawing board then


Stephen

I only open my mouth to change feet.....

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 05:37 PM  13 years agoPost 7
Drunk Monk

rrProfessor

Preston, UK

My Posts: All  Forum  Topic

Ok, attempt 2 then

I think there will be 100 that can be read either way up to give the same thing. So how about 2500, also knocking the ones off that start with zero


Stephen

I only open my mouth to change feet.....

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 06:09 PM  13 years agoPost 8
Colibri

rrKey Veteran

The Netherlands

My Posts: All  Forum  Topic

If you knock off the ones starting with 0 you end up with 2500 (4x5x5x5x5) . I don't see why you think 100 will read the same upside down. Calculation???

Tim

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 06:13 PM  13 years agoPost 9
Colibri

rrKey Veteran

The Netherlands

My Posts: All  Forum  Topic

Maybe rchelipilot121 can confirm that indeed zip codes starting with 0 are not valid 5 digit zip codes hence not detour prone. It does seem to have a rather big impact.

Tim

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 06:20 PM  13 years agoPost 10
Drunk Monk

rrProfessor

Preston, UK

My Posts: All  Forum  Topic

don't know, that bit is completely wrong


Stephen

I only open my mouth to change feet.....

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 07:52 PM  13 years agoPost 11
Colibri

rrKey Veteran

The Netherlands

My Posts: All  Forum  Topic

Editing your calculation? Not sure any more?

The answer is 3050 if leading zeros are allowed. The answer is 1940 if leading zeros are not allowed.

I'll post the calculation later; got to run now.

Tim

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 08:29 PM  13 years agoPost 12
jb_turner

rrElite Veteran

USA

My Posts: All  Forum  Topic

09470 is a zip code.
All this zip codes has to be current ones as designated by USPS right?.

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 08:34 PM  13 years agoPost 13
Colibri

rrKey Veteran

The Netherlands

My Posts: All  Forum  Topic

The numbers that can be read upside down are as posted earlier 0,1,6,8,9
Of these numbers 0,1,8 read the same upside down and 6,9 read 9,6 upside down. Only zip codes consisting of these 5 digits exclusively can be read upside down.

There is still the question of whether or not zip codes with leading zeros are allowed. (For example is 00100 a valid zip 5 digit zip code or not?)

I'll make two calculations based on whether they are allowed or not.

-------------- Leading zeros are allowed ---------------------
The total number of combinations that can be made from the above 5 digits is 5^5 = 3125.

We now have a couple combinations that are the same when read upside down. These numbers can have all 5 digits in the 1st position, all five in the 2nd position but only 3 (0,1,8) in the middle position. If a 6 or 9 is in the middle it will never read back the same upside down. The 4th and 5th position can not be chosen freely as they have to be the upside down equivalent of the 2nd and 1st position. This leads to 5*5*3*1*1 = 75 combinations that read the same upside down.

This makes the total number of 'detour prone' zip codes 3125-75 = 3050. (If leading zeros are allowed).

-------------- Leading zeros are NOT allowed ---------------------
This is a slight variation of the above. The 1st and 5th digit can not be 0 so the total number of combination you can make are now 4^2 * 5^3 = 2000.
The combinations that will be the same upside down are now 4*5*3*1*1=60 so that leaves 2000-60=1940 'detour prone' zip codes (if leading zeros are NOT allowed).

Tim

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 08:45 PM  13 years agoPost 14
Drunk Monk

rrProfessor

Preston, UK

My Posts: All  Forum  Topic

Yeah, I edited it because my thinking was very flawed. Plus I was starting to get a headache


Stephen

I only open my mouth to change feet.....

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 09:32 PM  13 years agoPost 15
Colibri

rrKey Veteran

The Netherlands

My Posts: All  Forum  Topic

Good thing then that you are not a mail man. From your RR handle I'll assume you would 'detour' to the next local pub anyway.

Tim

PM  EMAIL  GALLERY  Attn:RR  Quote
12-13-2004 09:38 PM  13 years agoPost 16
rchelipilot121

rrNovice

Crap!! I'm here again!!

My Posts: All  Forum  Topic

We shall consider 18619 and 61981 (its rotational partner) as two separate detour-prone codes.
All detour prone ZIP codes will exclusively contain the digits 0, 1, 6, 8, and 9; that is, 55 = 3125 5-digit numbers.
However, codes like, 66899, are not detour prone, as it reads the same upside down. In fact, any ZIP code with the following criteria will not be detour prone:
0, 1, or 8, as middle digit.
First/second digit is 0, 1, 6, 8, or 9 (with corresponding last/fourth digit will being 0, 1, 9, 8, and 6, respectively.)
This accounts for 5 × 5 × 3 = 75.
Hence there are 3125 − 75 = 3050 detour prone 5-digit ZIP codes.


Sorry it took so long. I don't have access to a pc during the day as I'm always on the go.

PM  EMAIL  Attn:RR  Quote
12-13-2004 09:39 PM  13 years agoPost 17
rchelipilot121

rrNovice

Crap!! I'm here again!!

My Posts: All  Forum  Topic

Haven't stumped you guys yet, but I'll keep trying.....

PM  EMAIL  Attn:RR  Quote
12-13-2004 09:50 PM  13 years agoPost 18
Drunk Monk

rrProfessor

Preston, UK

My Posts: All  Forum  Topic

Well I was close. Time for another glass of wine methinks


Stephen

I only open my mouth to change feet.....

PM  EMAIL  GALLERY  Attn:RR  Quote
12-14-2004 01:41 AM  13 years agoPost 19
rcsoar4fun

rrKey Veteran

Boise, Idaho

My Posts: All  Forum  Topic

There are a lot of Zip codes on the east coast with leading zeros.

Don't forget 74137. Don't ask me how, but the Postal Orafice around here looses my crap all the time

If anyone really wants a complete list of Zipcodes let me know, I happen to have that list laying around.

Kristopher

PM  EMAIL  GALLERY  Attn:RR  Quote
WATCH
 1 page 1223 views POST REPLY
HelicopterOff Topics › A Zip Code Problem...
 Print TOPIC  Make Suggestion 

 1  Topic Subscribe

Wednesday, April 25 - 1:44 pm - Copyright © 2000-2018 RunRyder   EMAILEnable Cookies

Login Here
 New Subscriptions 
 Buddies Online