Article 57665 Approximate results may vary

Approximate results may vary

by
ericlippert
from Fabulous adventures in coding on (#57665)

Part 33 of my ongoing series is coming but I did not get all the code written that I wanted to this week, so it will be delayed. In the meanwhile:

Living in Canada as a child, of course I grew up learning the metric system (with some familiarity with the imperial and US systems of course). If you want to know how many milliliters of liquid a cubic box holds, you just compute the volume of the box in cubic centimeters and you're done, because a milliliter is by definition the same volume as a cubic centimeter.

Despite having lived in Seattle for over 25 years, I still sometimes do not have an intuitive sense of conversions of US units; for a particular project I knew that I needed an amount of liquid equal to about the volume of a two-inch cube, but the bottle was measured in fluid ounces. Fortunately we have this operation in every browser:

2020-08-20.png?w=646

Thanks Bing for those important eight digits after the decimal place there, manufactured from the zero digits after the decimal place of the input. For context, that extra 0043 on the end represents a volume equivalent to roughly the size of a dozen specs of microscopic dust.

But the punchline that made me LOL was for an approximate result, divide the volume by 1.8046875", because of course when I am quickly approximating the volume of eight cubic inches in fluid ounces, the natural operation that immediately comes to mind is divide by 1.8046875.

I have some questions.

That was Bing; what does Google do with the same query?

2020-08-21-1.png?w=584

OK, that's an improvement in that the amount of precision is still unnecessary, but not outright absurd. But the other problems are all the same.

Why division? Maybe it is just me, but I find division by uneven quantities significantly harder mental arithmetic than multiplication; assuming we want the over-precision, would it not be better to say for an approximate result, multiply the volume by 0.5541125''?

Why say to approximate..." and then give an absurd amount of precision in the conversion factor? Approximation is by definition about deliberately not computing an over-precise value.

Surely the right way to say this is for an approximate result, multiply the volume by 5/9" or even better, divide by two. When I saw divide by 1.8046875" the first thing I thought after wow that's so over-precise" was 1.8 is 18/10 is 9/5, so multiply by 5/9.

I'm going to get there eventually; software can shorten that journey. And I'm going to remember that 5/9ths of a cubic inch is a fluid ounce much more easily than I remember to divide by 1.8046875.

Once you start to see this pattern of over-precision in conversions, it's like the FedEx arrow: you can't stop seeing it. Let's ask the browser how much does an American robin weigh?

2020-08-21-3.png?w=584

64.8 grams. An underweight robin is not 64.5 grams, and not 65.0 grams but 64.8 grams.

To be fair, it looks like this over-precision was the fault of a human author (and their editor) not thinking clearly about how to communicate the fact at hand, rather than bad software this time; if you're converting two and a third ounces" to grams it would be perfectly reasonable to round to 65, or even 60. (That third of an ounce is already suspect; surely two to three ounces" is just fine.) Most odd though is that the computations are not even correct! 2 and 1/3rd ounces is 66.15 grams, and 3 ounces is 85.05 grams, making it rather mysterious where the extra few hundred milligrams went.

I was wondering how many earthworms a robin would have to eat to make up a discrepancy of 0.2 grams. A largish earthworm has got to weigh on the order of a gram, right?

2020-08-21-5.png?w=584

Wow! (For my metric readers out there: 1.5 pounds is 680.388555 grams according to Bing.)

Again: what the heck, Bing? I did not ask for world's largest earthworm" or unusually large earthworms" or even Australian earthworms". You know where I live, Bing. (And Google search does no better.)

For some reason I am reminded of Janelle Shane's AI Weirdness" tweets; the ones about animal facts are particularly entertaining. These earthworm facts at least have the benefit of being both interesting and correct, but this is hardly the useful result about normal garden-variety annelids that I wanted.

I am also reminded of my favourite animal fact: the hippopotamus can jump higher than a house. It sounds impressive until you remember that houses can't jump at all.

Obviously all these issues are silly and unimportant, which is why I chose them for my fun-for-Friday blog. And the fact that I can type 8 cubic inches in oz" into my browser or say how much does a robin weigh?" into a smart speaker and instantly get the answer is already a user interface triumph; I don't want to minimize that great work. But there is still work to do! Unwarranted extra precision is certainly not the worst sort of fallacious reasoning we see on the internet, but it is one of the most easily mitigated by human-focused software design. I'd love to see improvements to these search functions that show even more attention to what the human user really needs.

External Content
Source RSS or Atom Feed
Feed Location http://ericlippert.com/feed
Feed Title Fabulous adventures in coding
Feed Link https://ericlippert.com/
Reply 0 comments