Nanocentury

October 24th, 2009 at 9:11 am

It’s often useful to quickly estimate run-times of programs and algorithms without using a calculator.

One useful mnemonic to remember is:

\pi seconds is a nanocentury

According to this page the kudos for the quote goes to Tom Duff. However, I found it in many sources online that aren’t even programming related, so I would take this attribution with a grain of salt.

Anyhow, this mnemonic is surprisingly accurate. Disregarding leap years, there are 3.1536\times 10^9 seconds in a century (100 years). A nanocentury (10^{-9}), therefore, contains 3.1536 seconds, which is less than half a percent away from the real value of \pi.

One Response to “Nanocentury”

  1. C. OwardNo Gravatar Says:

    This mnemonic comes from astronomy. It is standard during admissions to grad school to be asked how many seconds there are in a year or century.

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)