Saturday, November 1, 2008

Pascal's Triangle

I was a computer science major and a math minor. Here I'll pause while all the single ladies frantically scramble away in frightful panic. And now another pause, while all the male computer programmers and mathematicians, angry with my exceedingly unfair stereotype, hit the browser's X button in disgust.

Now that that unpleasantness is behind us...

One of the reasons why I made it all four years with my hopelessly left-brained minor in math was the frequency that one result was magically linked to something else completely different and unrelated. It's like we learned all these seemingly pointless things in middle and high school, but we managed to connect all of these dots in my college courses. I came across something the other day that reminded me of this. If you'll indulge me for about 10 paragraphs...

If you made it through high school algebra, you learned how to multiply what were called binomials by using something called the distributive property. The simplest of these is: (x+1) * (x+1), or (x+1)2, which is (x2 + 2x + 1). Remember those? Yeah, they sucked. But just because we have nothing better to do, let's try something:

(x+1)0 = 1
(x+1)1 = x + 1
(x+1)2 = x2 + 2x + 1
(x+1)3 = x3 + 3x2 + 3x + 1
(x+1)4 = x4 + 4x3 + 6x2 + 4x + 1

We could do this forever. But that's no fun, and if there's one thing I was taught as a math minor, it's to recognize patterns. Lo and behold, if you arrange the coefficients a certain way...

<
Way easier. This is called Pascal's Triangle. And you could keep going and going...


Now just for fun, let's shade in the boxes that contain numbers not divisible by three. (Why not?)


Where did all those triangles come from? Magic. In fact, if you were to keep doing this forever (in mathspeak, as the number of rows in the triangle approaches the infinite limit), you get the Sierpinski triangle.


The Sierpinski triangle is a fractal, which is what you get by splitting geometric shapes apart and duplicating them ("recursively"...there's more math jargon for you) infinitely until you get something purty, like the famous Mandelbrot Set, for example:


Call me whatever you want, but I think that's pretty fascinating. And it's amazing how often things just happen to work out perfectly that way.

See? That wasn't so bad...

No comments: