[Edu-sig] A Quick Puzzle

kirby urner kirby.urner at gmail.com
Wed Mar 8 01:09:06 CET 2006

Here's a quick puzzle, that'd make a good source of Python programs,
or programs in other languages:

Assume dogs live at 7 times the rate of a man, such that when a man
ages but one year, the dog ages by 7.  Now assume a dog is born later
than you, and you get her as a puppy (feel free to mess with these
gender assumptions).

At some point, as long as you keep living (assume that you do), the
dog will catch up to you, and overtake you in age (the dog too, keeps
living, at least long enough for the two life-lines to intersect).

So challenge:  write a program where you input the two birth dates,
yours and your dog's.  What the script returns is the very day of the
very month of the very year, on which you and your dog might
reasonably celebrate a "same age" intersection, a "birthday in common"
if you will (we could get more precise, but only if the birth times
are known with equal precision).

I'm actually working on this project now, in anticipation of earning
five dollars.  Jon Bunce, another Wanderer, has already worked out a
formula and shared it around.  But I'm thinking just for fun, to do
something totally brute force using Julian dates.  Anyway, it'll be
fun to compare different solutions, in terms of accuracy, quirkiness,
readability, speed -- lots of interesting criteria.

Just another puzzle for the literature, not my invention, just
something I've thought about.  A guy with a real dog and a real
interest in the answer, came to Don Wardwell with it, looking for the
services of a real think tank.

Over on the Math Forum, I couched it as a puzzle for cgi scripters,
i.e. make up a web site calculator around this, using JavaScript or
whatever (a new way to do story problems).

Of course similar games may be played with other animals with
different "life rates."  Don't get too hung up on what actual ratios
to use, unless that's a stated goal of the lesson.  In most cases,
just take these as puzzles, like Sudoku, not as literally true biology


More information about the Edu-sig mailing list