Bug in Google Calculator breaks "Capacity Factor" posts

To help myself out in arithmetic-intensive calculations (and to make them more convenient to readers), I often use Google's 'Calculator' feature -- a nifty tool which is units-aware ("10 btu/hour") and can perform units conversions, as well as other convenient shortcuts such as scientific notation ("1e9"), natural-language words ("billion"), abbreviations ("GeV"), and mathematical constants ("Avogadro's number"). Here's a short example using several of them, illustrating how delightfully expressive this calculator language is. Unfortunately, this feature no longer works the same way it did before, creating broken links in many of my old comments. One of the bugs involves Google being "smart" and substituting words with textually "similar" ones (which mean completely different things), so that

1 TWh/year in watts

is reinterpreted as "1 kWh/year in watts" (kWh being a far more common search phrase) -- introducing an error of 109. Previously, the abbreviation "TWh" would be correctly interpreted as "terawatt hour". For added confusion, this "smart search" is not consistent in its buginess: e.g., slightly tweak the previous query to

1 TWh/hour in watts

And suddenly 'TWh' is back to "terawatt-hour"! Quite an insidious bug.

I would worry for physics students who use this tool. You input the expression correctly, and the wrong answer comes out. Worse, the wrong answer comes out where previous versions of the Calculator yielded the right answer. And most-worstest, this bug is dangerously silent: often the result retains the correct units, so it looks superficially correct. You only see that something went horribly wrong if you read the "parse" preceding the result, which often you won't because

  • It is very verbose on even small inputs, full of natural-language words and superfluous parentheses
  • It is nothing more than a 1-to-1 rewording of the expression you just entered (...except when it's disastrously wrong)

Anyway, a heads-up and an apology: there are some confusing broken links in my archived posts, due to this issue.

2 comments:

  1. Note that Google uses a tweaked version of the "units" tool, found on many Unix-like system, as its backend (see http://www.gnu.org/software/units/ ). This bug may actually be a result of their tweaking trying to make it more "user friendly" (after all, terawatts are not really what the average person deals with on a day-by-day basis).

    Someone even prepared a version of units for Windows, though I'm not sure how well it works since I haven't tried it (see http://gnuwin32.sourceforge.net/packages/units.htm ).

    ReplyDelete
  2. You can fix Google's behavior by adding the nfpr=1 parameter:

    http://www.google.com/search?q=1+TWh%2Fyear+in+watts&nfpr=1

    ReplyDelete