## Have you proven a hunch before?

It was one of those morning math lectures. The lecture theatre was unusually quiet, and the only sounds I heard were those of my fellow students’ pens, scratching feverishly across the surface of their note pads. The professor happened to mention that no one’s ever proven the existence of infinite twin primes.

A prime number is a positive integer which is divisible by only 1 and itself. Examples are 2, 3, 5, 7 and 11.

Twin primes are prime numbers that differ by 2. Examples are (3, 5) and (11, 13).

Anyway, after that lesson, I was wracking my brain to find the proof (I felt challenged by the impossibility), and I started making up lists of numbers and adding them up. I’ve already convinced myself that all primes are odd, except for 2, so I focused on odd numbers. To my surprise, I found an interesting relationship in sums of odd integers.

I was adding the odd numbers starting from 1. So I got
1 + 3 = 4
1 + 3 + 5 = 9
1 + 3 + 5 + 7 = 16
1 + 3 + 5 + 7 + 9 = 25

As I got further into the sums, I realised that the sums are square numbers! Ok, so it’s not Nobel Prize material, but hey, I was in freshman year then, so this was pretty cool. Then I got swamped by homework, and I didn’t give this any more thought.

Some time later, my mind was freer and the idea came back with a vengeance. So I thought, “Can I prove it?”. My math lessons included a lot of proving problems, and I was naive then, so I hadn’t yet developed a healthy fear of the Terrifying Triple: show, prove and justify.

So I finally put some effort into it. The sequence looks like an arithmetic series, so I applied the formula for sums of arithmetic series.
S(n) = n[2a + (n – 1)d] / 2
where n is the number of terms, a is the first term, d is the difference between consecutive terms and S(n) is the sum of the first n terms.

The first term a is 1, d is 2 and I substituted the values into the formula:
S(n) = n[2 + (n – 1)2] / 2
= n[2 + 2n – 2] / 2
= 2n2 / 2
= n2

That wasn’t much of an exercise. The point is, have you ever tried to prove a hunch before?

There was this incident where one of our production programs failed. I tried debugging the program, analysing the code and took the whole morning poring over every line, and still couldn’t pinpoint the error.

My colleague came in, took a look at the program code, got an “Aha!” moment, and gave me this priceless advice, “Increase array size“.

Well, I’m not totally without results, since I figured that it was due to an insufficient array size. I was simply trying to pinpoint the exact place where I should increase the size. My colleague’s next piece of enlightening advice, “It doesn’t matter. Increase ’em all.“.

I was at my wit’s end, and I had backlogs of emails and requests coming in, so I gave in. I simply increased the array sizes of all the affected array variables, compiled it and tested it. It worked! I pursued the proving of a hunch too far and too long.

As a perfectionist programmer, this moment of weakness rankled my principles. I’ve since learned that sometimes, I have to let go of some ideals, and use the extra energy for other more constructive purposes.

Have you ever had to give up some of your ideals too?