Wednesday, 29 February 2012

Ordinal Numbers and Leap Years



Linda's always been mad about Scotland's rugby squad, and just recently she's been busily accumulating points for badges on their Six Nations website to prove herself a superfan! As you can see from the above graphic, she's notching up some success in the endeavour, having collected 2,000 points and been ranked eleventy second (112nd) overall at that point.

Looks like their web dev could use a refresher on English ordinal numbers? This little exercise in natural language expression always reminds me of today's leap day calculation. It has just enough of an exceptional clause to ensure frequent failures of implementation. For every code monkey who ever forgot that last rule about years divisible by 400, another has forgotten the "teens" exception to the suffix rule,
  • 1 takes "st" (so 1st, 21st, 101st, etc),
  • 2 takes "nd",
  • 3 takes "rd",
  • everything else takes "th".
The exception is of course that any number ending in 11, 12 or 13 takes "th", instead of the corresponding suffix for 1, 2 or 3. The close analogy with leap year rules is striking, as its etymology has nothing in common with the scientific basis of the latter (which itself does have direct analogies to things like modular arithmetic, games of Monopoly, and drawing smooth inclined straight lines on a pixel raster).

Update (1st March): Since the time of writing, Linda has climbed to rank 75th nationally with 2,600 points, and been promoted from "National Squad" to "1st Cap". Problem solved!
Update (3rd March): 66th nationally, 3,100 points, promoted to "Starting XV". Girl takes her rugby seriously.
Update (17th March): 57th nationally, 4,700 points, promoted to "Captain". Meanwhile, the team collected yet another wooden spoon today.

No comments:

Post a Comment