Wolfram Alpha is My Master Now

Posted: June 6th, 2010 | Author: | Filed under: Computers | Comments Off

Part of my research lately has involved asking a lot of questions like “What’s 100 TB / X / (N*D) in MB per second?” and “What’s the amount of time it takes for a 7200 RPM disk to go through half a revolution?” (reasons for this will be revealed later). Google Calculator is great for this. If you’ve never heard of Google Calculator, that’s because it’s built into Google Search. Try going to Google and search for “10 hectares in square parsecs” to get an idea for what I mean. It supports tons of unit conversion formats, but it’s lacking in support for calculations relating to bytes.

Megabytes or Mibibytes?

As a bit of exposition: a common question when buying hard drives is “I just bought a 500 GB drive but it only has 465 GB of capacity when I hook it to my computer. I want my extra space back!” This discrepancy isn’t because hard drive companies want to screw you over (OK, they might be trying to screw you over, but not with this), it has to do with how computer science deals with bytes. In a network setting, measurement is typically done in powers of 10, so a gigabyte is 1000 megabytes. With storage, measurement is typically done in powers of 2, so a gigabyte is 1024 megabytes. So when you buy a 500 GB drive, your computer will tell you it’s a 465.7 GB drive because they gave you the powers-of-10 capacity and the OS displays it in powers-of-two. I know that Snow Leopard no longer does this to avoid confusion, but I’m not sure what Windows 7 does.

In an effort to resolve the confusion, the International Electrotechnical Commission (IEC) instituted a set of units of measurement that used powers of two, and kept powers of ten as the default. So according to IEC, a megabyte is 1000 kilobytes, and a mibibyte is 1000 kibibytes. The ‘-’-bi’ was supposed to invoke the word “binary” in the user’s mind. Personally I think they deliberately did this to make computer scientists sound ridiculous. Once you get up high enough you hit yobibytes, for Pete’s sake; that sounds like something you’d give Scooby Doo’s second-cousin Yobi Doo to make him cooperate.

Google Calculator deals explicitly in IEC units, but doesn’t follow the standard: if you ask it “how many bytes in a yottabyte” and “how many bytes in a yobibyte”, you get the same answer. This is intensely irritating if you care about powers of ten when you’re dealing with bytes.

Enter Wolfram Alpha

Wolfram Alpha is basically a thin veneer on top of Mathematica that allows you to access some of its simpler functionality for free. Mathematica is a mathematical toolbox that is so absurdly sophisticated and full-featured that I’m expecting it to gain sentience any minute. Just to give you an idea, the Mathematica documentation – complete with typesetting and figures – was written entirely in Mathematica. Scary.

I was hunting around for an alternative to Google Calculator’s unit conversion (and considering writing my own, such was my level of desperation) when I decided to ask Alpha. After all, you can ask Alpha “How many roads must a man walk down before you can call him a man?” so it must be able to do unit conversion, right? Turns out it can, and it honors the IEC specification! So if I ask it “how many bytes in a kilobyte”, not only will it give me powers of ten, it will ask me if that’s what I wanted and suggest kibibytes as an alternative!

It can also convert between decimal, binary (twos-compliment and unsigned), hex and octal. Hot damn.

No related posts.


Comments are closed.