# Nerd stuff

## Sorpresas te da la Roomba

En casa tengo una Roomba, que es una aspiradora robótica que se pasa sola mientras estoy en el trabajo. Toda una comodidad.

Hasta ahora, había pensado en mi Roomba como un simple mecanismo automático cuyo único cometido es, cada dos días, desconectarse de su base, dar unas cuantas pasadas por la casa y regresar directamente a su base cuando la batería está casi descargada. En realidad, no pensaba mucho en ella salvo a la hora de vaciarla y limpiar el filtro.

Os podéis imaginar, entonces, mi sorpresa cuando hoy llegué a casa y descubrí a la Roomba y al cargador de mi portátil en una posición bastante comprometida.

Por supuesto, no puedo permitir que este tipo de cosas ocurra en mi casa, o esto acabará siendo Skynet. De momento los he puesto en diferentes habitaciones y les he prohibido volver a verse, pero temo que eso no sea suficiente. ¿Alguien tiene algún consejo?

## Más invitaciones de Google Wave

Tengo 8 invitaciones más para Google Wave. Si alguien quiere una, que me mande un email con su dirección de GMail (si no conocéis mi dirección, usad el enlace “Contacto” del pie de la página).

La invitación puede tardar unos días en llegar. Daré prioridad a gente que yo conozca, o que me mande emails que me hagan reír :)

**Actualización**: Y que no se dediquen a poner spam en páginas web ajenas.

## Mental arithmetics: the square of a two-digit number

Every once in a while I strain to the maximum my capacity to botch a simple explanation. This time around, I apply it to a method to calculate mentally the square of a two-digit number. Actually, I know two of these: one of them, I have known for years; the other one I learnt on the Internet some months ago following a link to a Wikipedia article on Vedic Mathematics (whose name, I've heard, is purely for marketing :)).

The first method I knew is based on the fact that (a+b)^{2}=a^{2}+b^{2}+2ab. If I call the tens part “a” and the units part “b”, it's just a matter of squaring two single-significative-digit numbers (easy), adding up the results (easy) and then multiplying each number by the other and doubling the result and adding it up to the previous result (less easy, but still feasible).

For example, 37 is 30+7, so 30^{2}=900, 7^{2}=49, 2·30·7=420, I add it all together and it gives 1369.

You can quickly see that the problem with this system is having to remember two or three intermediate results while you multiply three numbers mentally. We just can't fit that many numbers in our short-term memory :)

The system I learnt recently is harder to explain, but it's quicker to calculate because we don't have to hold as many intermediate results in our mind.

This method is based on (a+b)(a-b)=a^{2}-b^{2}. What we do is call the number we want to square “a”, and choose a number “b” which will make the product (a+b)(a-b) easy to calculate (most commonly, we'll choose the smallest number that will make a+b or a-b a multiple of 10). When we've chosen that number, we can calculate the product, add b^{2} to the result and what we get is a^{2}.

Let's see this with the previous example where we wanted to calculate 37 squared. Using 3 as the value of “b”, we can calculate (37+3)(37-3)=40·34=1360. To this we add 3^{2}, which is 9, and we get 1369.

Another example: 72^{2}. If I choose 2, I've got (72+2)(72-2)=74·70=5180. I add 2^{2}=4, and I get 5184.

As you can see, with this system it's only necessary, usually, to multiply a two-digit number with a single-digit one (zeroes don't count), square a single-digit number and add it to the previous result. I don't think there's any faster method to calculate the square of a two-digit number (if you don't count memorising them all, of course).

## Some nerd notes

- The UNIX clock will soon reach 1234567890 seconds. That will happen on February 13
^{th}, 2009, at 23:31:30 UTC. Is anyone going to celebrate?The UNIX clock counts the number of seconds since January 1

^{st}, 1970, at 0:00 hours UTC. In 32-bit computers, the maximum date this clock can record is January 19^{th}, 2038, at 3:14:07 UTC. In 64-bit computers, the maximum date is almost three hundred billion years in the future. - When we buy something in a supermarket, the cashier will wave the product in front of the barcode scanner without having to worry about its orientation. How can that gadget read an upside-down barcode and not get it wrong?
Easy: the codes in a barcode make sense only when they are read in the correct direction, so it's just a matter of reading them in both directions at the same time and then use the code that could be deciphered.

- Speaking about barcodes: in the modern mobile phones you can buy in Europe and the USA we can install QR-code scanning applications (of course, they have had them in Japan for years now). QR codes are two-dimensional codes that can contain text, Internet addresses, contact information, etc.

In Japan you can see QR codes in billboards, and people can visit the associated website by only taking a photo of the billboard with their phone. Another idea is to put a QR code in the back of a business card; in that way, its recipient can store the contact information in their mobile phone without having to type everything.

- The first episode in the last season of Battlestar Galactica is aired today in the USA, and it will be aired next Tuesday in the UK and Ireland.
Who will the fifth cylon be?

## Square root

Every time we solve a square root using pen and paper, we do lots of calculations. But how does the method work? Why do we have to multiply the partial results by two, and then append the digit, and multiply the result by the same digit, and then substract the result...? And how does the end result come together in the end?

I spent a couple of hours yesterday filling a piece of paper with letters and numbers and mathematical symbols, and now I'm sharing what I learned.