Treebeard's Stumper Answer
|
Palindromic Dates
Thanks Donna, you pointed out that last Tuesday, October 2, 2001, was a palindromic date. Written in the usual American way (mm-dd-yyyy), that's 10-02-2001. The digits are the same forward and backward! The obvious stumper is when will this happen again, and when did it happen last? In Europe, they write dates as dd-mm-yyyy, so Tuesday was 02-10-2001. The International Standard is yyyy-mm-dd, so it was 2001-10-02. Which way of writing dates will produce the next palindromic date? What if we all decide to write yy instead of yyyy?
The next palindromic date after October 2, 2001 (10-02-2001) will be January 2, 2010 or 01-02-2010 (as mm-dd-yyyy). JP was the first Dunn Middle School student to figure that this last happened way back on August 31, 1380 or 08-31-1380. It's different if we write our dates as dd-mm-yyyy or yyyy-mm-dd, though both give the same result. (Why? D'oh!) The next reversible date will then be February 20, 2002 or 20-02-2002. There are many more reversible dates if we write the year as yy instead of yyyy. For example, yesterday was October 11, 2001 or 10-11-01.
Notes:
Working back to the last palindromic mm-dd-yyyy date was the hard one. The constraint is that months can only be {1 to 12} and days can only be {1 to 28-31} depending on the month. So start working backwards.
mm-dd yyyy 10-02 2001 this palindromic date 00-xx 2000 illegal month xx-91 19xx illegal day, same for 18xx, 17xx, 16xx, 15xx, 14xx xx-31 13xx possible day, so refine it 01-31 1310 possible, same for 1320, 1330, 1340, 1350, 1360 07-31 1370 possible, and better 08-31 1380 possible, and the best so far 09-31 1390 looks good, but September only has 30 days so it's illegal 10-31 1301 wups, it got lower, all done Similar trial and error found the other answers.
Graybear sent this complete answer that considers some other conventions:
I noticed it on the first of the month. One of my students asked the date so I wrote it on the board as 10-1-01 and noticed that it was palindromic and made up of only 1s and 0s. By writing the date in this format (mm-d-yy or mm-dd-yy), the first nine days of this month, as well as the 11th and the 22 are palindromic; then we'll have to wait until 2-01-02 (except if you write the day as 01, you'ld probably write the month as 02 so, for the purists, the next date would be 01-11-10).If you write the date as mm-dd-yyyy, the most recent date was 10-02-2001 the next date is 01-02-2010. As dd-mm-yyyy, the last date was 10-02-2001 (last February 10th), the next date is 20-02-2002 (next February 20th).
Using the yyyy-mm-dd format gives the same palindromes as mm-dd-yyyy! (Why? Duh!)
As for yy formats, I mentioned mm-dd-yy above, for dd-mm-yy, the most recent was in September, 10-9-01, the next in November, 10-11-01.
And, last but not least, is yy-mm-dd. It works the same as dd-mm-yy. This is the format I use for files that I update and want to know what "version" each one is without opening it. For example, if I were to file a draft of this letter, the filename would be: 011008LtrToTreebeard. By doing this, the computer automatically sorts them "alphabetically" by date.
Good answer, Graybear. I use my own modified version of the ISO date standard to name my 1000s of digital photos and still stay with a classic MSDOS 8.3 character file name for my primative database. The 10th picture I took today on October 14, 2001 will become:
1A14-010.jpg --- format (jpg for photos) --- picture (001-999, more than enough for a day) -- day (01-31) - month (1-9, A-C in hex fashion: A is Oct, B is Nov, and C is Dec) - year (0-9, for 2000-2009)
I'll deal with 2010 when it happens! File naming conventions like this are essential, even if they create future personal Y2K-like problems. The International Standard (ISO 8601) is the right way to go if you are just starting a database with long filenames.I thought about writing a computer program to find all palindromic dates by testing all possible dates, and then I realized I didn't have to. There are just 366 legal days in a year (including the occasional leap day), and each one translates into one unique palindromic year. Leap days are interesting, but it turns out that leap day palindromes are legal for both mm-dd-yyyy and dd-mm-yyyy schemes according to the rule that (non-century) years are leap years if the last two digits are divisible by four:
mm-dd-yyyy 02-29-9220 20/4=5, it's legal dd-mm-yyyy 29-02-2092 92/4=23, it's legal There are also a few days missing from history. Because of the transition from the Julian to the Gregorian calendar, October 4, 1582 was followed by October 15 1582 in Catholic countries, and September 2, 1752 was followed by September 14, 1752 in Great Britain and the US. But these "missing days" are not potential palindomes.
I did write a small BASIC program to generate all palindromic dates and count the days between successive dates. Both ways of writing dates have 366 palindromic dates in the years between 0001 - 9999, but the distributions are quite different and have interesting patterns. The complete list is available on a separate Web page. Here's part of that list:
Count Date mm-dd-yyyy Days since last Date dd-mm-yyyy Days since last 77 Jul 31, 1370 07-31-1370 7366 24 Nov 1142 24-11-1142 375 78 Aug 31, 1380 08-31-1380 3684 05 Nov 1150 05-11-1150 2903 79 Oct 02, 2001 10-02-2001 226839 15 Nov 1151 15-11-1151 375 80 Jan 02, 2010 01-02-2010 3014 25 Nov 1152 25-11-1152 376 81 Nov 02, 2011 11-02-2011 669 06 Nov 1160 06-11-1160 2903 82 Feb 02, 2020 02-02-2020 3014 16 Nov 1161 16-11-1161 375 83 Dec 02, 2021 12-02-2021 669 26 Nov 1162 26-11-1162 375 84 Mar 02, 2030 03-02-2030 3012 07 Nov 1170 07-11-1170 2903 85 Apr 02, 2040 04-02-2040 3684 17 Nov 1171 17-11-1171 375 86 May 02, 2050 05-02-2050 3682 27 Nov 1172 27-11-1172 376 87 Jun 02, 2060 06-02-2060 3684 08 Nov 1180 08-11-1180 2903 88 Jul 02, 2070 07-02-2070 3682 18 Nov 1181 18-11-1181 375 89 Aug 02, 2080 08-02-2080 3684 28 Nov 1182 28-11-1182 375 90 Sep 02, 2090 09-02-2090 3683 09 Nov 1190 09-11-1190 2903 91 Oct 12, 2101 10-12-2101 4057 19 Nov 1191 19-11-1191 375 92 Jan 12, 2110 01-12-2110 3014 29 Nov 1192 29-11-1192 376 93 Nov 12, 2111 11-12-2111 669 10 Feb 2001 10-02-2001 295182 94 Feb 12, 2120 02-12-2120 3014 20 Feb 2002 20-02-2002 375 95 Dec 12, 2121 12-12-2121 669 01 Feb 2010 01-02-2010 2903 96 Mar 12, 2130 03-12-2130 3012 11 Feb 2011 11-02-2011 375 I also counted palindromic dates per century. There are nice patterns, and some interesting exceptions that I don't have time to explore now. There were 226,839 days between August 31, 1380 (08-31-1380) and January 2, 2010 (01-02-2010). The largest gaps are 259,698 days (mm-dd-yyyy) and 332,017 (dd-mm-yyyy). Stumpers remain.
![]()
Here are some links for further research:
- There's a French website about this very stumper, but it's posed in the European way (dd-mm-yyyy) for "Le 10 février 2001" (February 10, 2001 or 10-02-2001). It also has a table of palindromic years, but I'm sure they left out a few, eg 04-10-0140. Maybe the author has different assumptions?
- I kept all the leading zeros in my version of the stumper, but most of us drop them for months and days at least. Our shortcuts generate several more variant stumpers which are discussed at Ask Dr. Math and here.
- There's a reference site on the International Standard (ISO 8601). The Calendar FAQ and Calendar Zone have lots more calendar info.
- I wrote a small MSDOS BASIC program to figure all palindromic dates from 0001-9999. PALDAY.BAS is available for download (with BASIC source code) at Treebeard's Basic Vault.
- I've got more tricky calendar stumpers, including Five Fridays (12 Nov 99), Friday the 13th (13 Nov 1998), Full Moon Birthday (2 Oct 1998), and When is Washington's Birthday? (28 Feb 1997). Here's another: we all know about the sixties and the nineties, but what should we call this decade? The oh-ohs sounds about right.
Back to Stumper
Last modified .
Copyright © 2001 by Marc Kummel / mkummel@rain.org