News for hackers. Stuff that matters.
Re:Squaring two digit numbers in your head by barrkel on Monday March 29, 2010 @06:14AM (#1226224)
In case this observation isn't immediately obvious:

    Observe that 27^2 = 30 x 24 + 3^2
It's derived from this:

    (x + c)(x - c) = x^2 + cx - cx - c^2
                   = x^2 - c^2
    => x^2 = (x + c)(x - c) + c^2
(I note that the blog explains this later, but I had to stop when I read the observation and work it out for myself on paper - when reading the text, it seemed like this step was missing.)
Re:Squaring two digit numbers in your head by bkz on Monday March 29, 2010 @09:50AM (#1226503)
IMHO, a clearer version:

                 x^2 = x^2
   x^2 + (r^2 - r^2) = x^2
   (x^2 - r^2) + r^2 = x^2
(x + r)(x - r) + r^2 = x^2

If we continue you'll also notice that:

      (x + r)(x - r) = x^2 - r^2 
Which is useful if you need to calculate the opposite where two numbers are mirrored around a suitable even number, i.e. 28 * 32 -> (30 + 2)(30 - 2) = 30^2 - 2^2
Re:Squaring two digit numbers in your head by barrkel on Monday March 29, 2010 @10:03AM (#1226528)
I don't think that's clearer. Factoring quadratic equations is taught in schools, and that's where you learn how to multiply out expressions of this form:

    (ax + b)(cx + d) = ax(cx + d) + b(cx + d)
                     = acx^2 + adx + bcx + bd
A special case of these factorizations is:

    (ax + c)(ax - c) = ax(ax - c) + c(ax - c)
                     = a^2x^2 - acx + acx - c^2
                     = a^2x^2 - c^2
The reason it's a special case is because there's cancellation of the terms. So starting out with this is useful, as it's likely to be something people have met in school - but people needn't remember the factorization (which isn't strictly speaking needed much - we have an equation for solving this), just how to multiply the terms (which is used more often). From it, we can derive all that's needed for the trick, without any odd moves.

With your own version, you have to introduce a term which adds up to zero - (r^2 - r^2) - for no obvious reason, and then you need to already know how to factor x^2 - r^2 to (x + r)(x - r) in order to understand the last step.

So I think your version is less easy to understand because it's not clear why the first step is what it is, and it relies on more recollection of school arithmetic.

(The only reason I expound at length on this is because I think what makes something obvious or easy to understand is a deep topic, linked to what's assumed to be known beforehand and the size of inferential jumps between steps, and is important for programming, writing, and indeed all communication.)

Re:Squaring two digit numbers in your head by ScottWhigham on Monday March 29, 2010 @07:00AM (#1226264)
I'm too dense to understand your explanation, but thanks anyway :)

Edit: It took me a while but I figured out his version and your version. Thanks!