Monday, March 29, 2010

Squaring two digit numbers in your head

All my life I've done mental arithmetic the 'wrong way': I've calculated from left-to-right, instead of right-to-left. So when I do something like 24 + 35 I'll see the 50 first and then the 9. This even applies when there's a carry and I'll do something like 36 + 56 as 80 + 12. I do the same thing for multiplication as well.

Turns out I'm not so weird after all (well, apart from the finding doing mental arithmetic fun bit). I've been reading Secrets of Mental Math: The Mathemagician's Guide to Lightning Calculation and Amazing Mental Math Tricks and the author, Michael Shermer, is just like me: he works from left-to-right.

He, like me, has found this to be a good system because it lets you discard digits early and not hold some enormous calculation in your head. For example, in the calculation 124 + 353 you can immediately say "four hundred" before doing the rest of the sum. This seems to free up headspace (at least for me) and let's me do the rest of the calculation. I'd do it like this: 124 + 353 = 400 + 24 + 53 = 400 + 70 + 4 + 3 = 477.

The books is filled with tricks for doing all sorts of mental calculations, including a nice section about estimation (I've always been an estimator) and working out things like tips and sales taxes. But the most fun part to me was a trick to let you do two-digit squares in your head really, really fast.

Quick, what's 272. Of course, the brute force way to do that is to calculate 27 x 27 which is a bit of a pain because it involves doing something like 27 x 20 + 27 x 7 = 540 + 189 = 729. But there's a much faster way.

Observe that 272 = 30 x 24 + 32. Since you probably know that 32 = 9 this means you have to calculate 30 x 24 + 9 which is relatively easy because the multiplication involves a multiple of ten which means it's really 3 x 24 and then add a zero.

So the rule is that if you want to square number X you first round it to the nearest multiple of 10, called that X + r, and then calculate X - r (i.e. round the same amount in the opposite direction). You calculate (X + r) x (X - r) and add back the square of the amount you rounded by, r2, which will be 1, 4, 9, 16 or 25.

This works because ( X + r ) x ( X - r ) + r2 = X2 - rX + rX - r2 + r2 = X2.

Example: 672 is 70 x 64 + 32 which is fairly easy to do in your head. And naturally the same trick works no matter how many digits you have, it's just that the multiplication gets harder.

The trick is especially impressive/easy with numbers near 100 because the multiplication becomes dead easy. For example, 962 is 100 x 92 + 42 which you (or at least I) can almost instantly see is 9216.

Thursday, March 25, 2010

Goodbye HP Procurve Access Point 420

Over a year ago I discovered a bug in an HP ProCurve Wireless Access Point 420 that we were using in our office. After being treated badly by HP I finally got support from them by blogging my frustration and ending up on the front page of Google search results for procurve support.

Eventually, weeks later, HP acknowledged the problem with the device. But this story doesn't have a happy ending.

In November 2009 HP informed me that the product was being end of lifed.

Out of curiosity I called HP Procurve Support and asked them about the status of my case and they couldn't even look up my case number. Searching around with my name they did manage to find me and my case was active and open. The latest update was on March 19, 2010 and the case had been escalated to Level 3 Support.

My previous experience with HP support wasn't good, but this time Derek was great. He tracked down the ancient case, updated me with information, updated contact information for me. An excellent experience. Unfortunately, waiting over a year for this to be fixed had become intolerable. (If anyone from HP is reading this, email me and I'll tell you Derek's email address since he deserves a special mention).

I replaced it today with an Airport Extreme. Configuration was a breeze with Apple's Airport Utility. And, here's a little known fact, the Airport Extreme can act as a level 2 bridge which means it can successfully extend our existing network without doing NAT and messing up our Bonjour packets (which were the source of the original HP bug).

And, joy of joys, it can perform WPA2 Enterprise authentication against our RADIUS server.

It's nice that HP is working to track down this bug, but 13 months is a little too long to wait for a fix. Sorry.

Tuesday, March 16, 2010

London Transport Museum: Acton Depot Weekend

This past weekend the London Transport Museum held an open weekend at its Acton Depot where they keep a collection of trams, trolley cards, buses and underground trains, plus all the associated equipment. They only open the depot twice a year so this was a chance to see some things that are rarely open to the public.

I didn't include this museum in The Geek Atlas but after a visit it's likely a candidate for a volume 2 since it is packed with interesting stuff.

Like a really big collection of old underground signs:


Or shielding used while constructing the tunnels for the London Underground:


And speaking of the Underground, here's a power control panel with meters indicating hundreds of amps and some serious on/off switches:


And a lovely mercury arc rectifier used to turn AC into DC (the Underground uses 630V DC power).


And here are the wheels of a 1930s trolley car:


And here's the control panel from an Otis elevator:


But the highlight was a ride on the prototype Routemaster RM-1 bus. I forgot to photograph it, so here's a picture from Wikipedia:

Wednesday, March 03, 2010

A welcome bunch of amateurs

Here's me writing in The Guardian's Comment is Free section:

We're all the children of amateurs: amateur parents. There's no government department that will certify you as a parent (thankfully), nor a university department where you get your PhD in being a daddy, nor a professional body ready to strike you off for not following mothering standards. But any parent who's held a newborn child in their arms has unconsciously taken the amateur's oath: "I may not be a professional, but I'm going to do whatever it takes to act like one."

You can read the rest here.