So I've not posted for a while... 2 weeks' worth of lectures to be precise. Well, in hindsight week 6 and 7 involved Lots of Proofs (with Caps). Well, definitions of different types of proofs. Not much to say about that; I'm sure you can read about proofs by contradiction or by case or by pretty much anything in any Logic (or Math) textbook till your eyes fall out if you so desire.
So, instead, let's talk about
Diagonals!
On the Friday before we all dispersed to various corners of the earth (or continent, or simply to our rooms) for Reading Week, we spent the lecture working on another rather fun problem (this time involving drawing on paper, not folding it!) It goes as follows:
you are given a rectangular grid of (mxn) squares, with m and n representing positive whole numbers. If you draw a diagonal line from the upper left corner to the lower right, how many grid squares will this line pass through the interior of?
Let's remember good ol' Polya.
Step 1: the problem - we want to find the number of squares the diagonal passes through. More specifically, we want a general formula for finding this number, given m and n.
Step 2: devise A Plan - first, obtain grid paper; then, draw! More specifically: start small, draw a few rectangles and try to find a general trend between m, n, and the number of diagonal squares (let's call it d.)
There's a few things in particular that we can pay attention to: if m = n, we know the diagonal will pass through m squares, because it will pass exactly through the intersections of the horizontal and vertical grid lines.
Similarly, we don't care if m > n or n > m, because the diagonal will still be the same length, and still pass through the same number of squares.
Next, if either m or n is 1 (for simplicity let's assume it's m), we know that the diagonal will pass through n (in this case) squares.
Armed with these observations, we can then begin drawing some examples, and trying to find similarities:
Step everything-else-jumbled-together: As you can see in the quite hazy (apologies, but you'll survive) picture above, I started with small examples, and tried to find patters based on the difference between m and n, and whether they were even or odd. I (eventually) found a few patterns:
1.) Regardless of the difference between m and n, with a little algebra the number of squares the diagonal passed through was clearly (
m + n - 1),
when m and n did not have a common divisor other than 1 (as seen in the examples of m = n - 2, m,n = odd , and m = n - 3. In both cases gcd(m,n) = 1). In these cases, the diagonal did not pass through any intersections of the horizontal and vertical grid lines
.
2.) In cases where the rectangle we drew could be broken into smaller ones (ie when the diagonal did pass through some of the vertical and horizontal grid intersections), the problem was a bit different. You can see some of these cases by looking at the 2x4, 4x6, 6x9, and 9x15 rectangles.
Take the 4x6 one, for example: we can easily see that this large rectangle can be broken into 4 smaller 2x3 rectangles (let's say a = 2, b = 3), of which the diagonal will pass through the top left and bottom right ones. Therefore the number of squares the diagonal passes through is 2x (# squares passed in 2x3), which is 2(a + b - 1) = 2a + 2b - 2 =
m + n - 2, since m = 2a, and n = 2b. Similarly, the 6x9 rectangle can be broken into 9 smaller 2x3 rectangles, of which the diagonal will pass through 3. Therefore d = 3(a + b - 1) = 3a + 3b - 3 =
m + n - 3, since m = 3a and n = 3b. We can see through more examples (or simply by sitting down and turning your brain on for a bit) that this trend holds for all such rectangles. Therefore, the above trend, (m + n - 1), can be rewritten to work for all rectangles as:
d = (m + n - gcd(m,n)) (QED.)
So to recap:
Polya's a decent bloke to listen to when in a pinch, and, considering this question took a few days of staring blankly at paper and tracing squares when it should have only taken a few minutes of deep (well, superficial, but still), meaningful insights,
Hindsight really is a B****!
Some memorable quotes:
On talking of variables used in proofs: "Just the fact that they're in a familiar alphabet and don't....REEK of Calculus so much should make it easier."
On talking about Natural numbers used in proofs: "We're computer scientists; we let 0 into the exclusive club of natural numbers. So do Calculus people, who are narrow minded, so that should say something..."
And finally, seemingly on life in general: "Just take a break and draw some pictures!" to which I'll say, after doing this proof, I don't want to even contemplate the existence of pictures for a few weeks.
Looking forward to the next long-winded blabbing session. Till then, cheers!
Pip