Sunday, February 28, 2010

Chile’s earthquake 500 times stronger yet less destructive than Haiti’s

and started wondering: how Chile’s quake could be 500x as powerful as Haiti’s when their respective Richter scale magnitudes are 8.8 vs. 7.0? The “less destructive” part is interesting, too, but everyone’s already talking about that so I’ll focus on the scale.

The first clue is that the scale is logarithmic. That means that each increment of 1 is a 10x increase in magnitude. If you were to plot x vs. log10(x), it might look like this:

Well, that’s not very revealing until you realize that the x-axis is increasing logarithmically. Consider the same data but with the x-axis presented linearly:

Now we’re talking. Each increment on the y-axis is a 10x increment on the y-axis. i.e. 8 is 10x greater in magnitude than a 7:

108/107 = 10

So it follows then that an 8.8 (Chile) vs. 7.0 (Haiti) would be:

108.8/107 = 63

Thus an 8.8 is 63 times greater in magnitude than a 7. Wow. OK so how do we get to 500x more destructive? It would seem that the news is using a different factor: energy. I didn’t dig into all the math behind it but the gist of it seems to be that while the Richter scale measures raw amplitude of the little pencil on the paper wheel/strip triggered by the earthquake's waves, the actual energy factor is much higher than 10:

Because of the logarithmic basis of the scale, each whole number increase in magnitude represents a tenfold increase in measured amplitude; in terms of energy, each whole number increase corresponds to an increase of about 31.6 times the amount of energy released.

So I guess the news people are applying this to the log scale with a base of 31.6 instead of 10. Let’s check:

31.68.8/31.77 = 501

Hooray! I honestly didn’t know that would work until I got to this point and calculated it (phew!). So this makes me wonder how effective a scale is when it’s not…intuitive at all. Certainly a simple, scientific number is helpful, but I’m not sure this is the right number to use in casual conversation.

Instead, numbers related to life lost, people displaced, or damage are probably more relevant and appropriate to compare. For example, the current mortality estimates are: Chile 700, Haiti 220,000:

220000/700 = 314

The quake in Haiti has killed (to date) 314 times more people than the quake in Chile. (That article also explains the 500 figure pretty well—I should have read it before writing this post :P)

On a very related note, there’s a super cool Radio Lab podcast about numbers which explores the idea that we count logarithmically when born but learn to count absolutely as children. Neat.

Also of note: decibels—a measurement of sound intensity is in logarithmic units, too, as is pH in chemistry.

Saturday, February 27, 2010

I don’t understand Twitter—how it works, how it makes money, or anything. As a computer engineer, I marvel at how impressive it is in terms of scale. For example, they are now crunching 50,000,000 tweets per day. That’s incredible.

Volume doesn’t make it awesome, though. Most of those tweets are about what uninteresting people are eating, watching, etc. Here’s why it’s awesome: I am empowered to connect with people in otherwise unreachable places. This calls for some examples:

Example 1: Microsoft

I recently ranted a bit about Visual Studio 2010 RC crashes:

If you crash on me one more damn time, VS2010, I will drop kick you onto the roof of my building. I'm not even kidding. 9:58 PM Feb 24th

It turns out that @Pilchie is “Dev Lead for C# IntelliSense/Refactoring/etc at Microsoft”. Well how about that? In a mere 10 minutes, I was getting help from not just Microsoft, but the guy who works on the product I was complaining about. And his link worked!

Example 2: Stackoverflow/Codinghorror

I was working on a project which is using a lot of the same libraries that Stackoverflow uses. I ran into trouble with one of the components: I couldn’t figure out which version to use. So I pinged the lead developer/co-creator of SO:

r @mharen our version is on Google Code, or you can dig through the fork-splosion on github and try to guess which version is "best" 7:33 PM Feb 8th

In three minutes I had my answer from the top guy of the a product that’s used by bajillions (if not gajillions) of people. Even if he hadn’t answered, I was hoping that someone else might (this wasn’t a private query).

Example 3: Red Gate’s Neil Davidson

Via Twitter, I discovered a neat little book on software pricing. I tweeted about it:

It’s at this point that I realize who wrote the book: Neil Davidson, co-founder/joint CEO of Red Gate Software, and founder of the Business of Software conferences among other things. A cool guy to get to know, no doubt. I finished the book and left a review as he asked and took the opportunity to ask about one of his products:

To which I got a very simple and candid reply (the beauty of the 140 character limit!):

@mharen We're not going to do any more work on SQL Log Rescue. Lots of people used it, but nobody bought, and SQL 2000 work would be huge 9:42 AM Nov 3rd, 2009

It’s so cool that this simple medium enables and promotes these types of quick conversations. In 2/3 of these cases, I wasn’t even trying to initiate communication—others were listening for certain things and they found me.

When I first starting toying with Twitter it seemed that its signal-to-noise ratio was cripplingly low. Now I see that by following keywords—not users—the signal is strong.

It also has a unique ability to cut through the BS by forcing you to choose your words carefully. I like that.

I’ve been told that these programming posts are not interesting or funny. For those that have no interest in programming, I offer the following joke:

I hope the next time I move I get a real easy phone number, something that's real easy to remember. Something like two two two two two two two two. I would say "Sweet." And then people would say, "Mitch, how do I get a hold of you?" I'd say, "Just press two for a while. And when I answer, you will know you have pressed two enough." (more classics from the late and invariably hilarious Mitch Hedberg)

Now would be a good time for you to stop reading.

On with the show! This handy method will attempt to update all the fields in the document passed to it:

It makes me cry a little to brute force every container I can think of this way. Surely there’s a better way. Maybe I could just traverse the documents DOM an update anything that looks like a field castable to a Field…I’ll think about that. Until then, this seems to work…