Thursday, August 23, 2012

Pascal's Triangle and Square Numbers


Below are the first few rows of Pascal's triangle:
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 21 15 6 1
The numbers in bold are the third diagonal in when Pascal's triangle is drawn centrally. These are the triangle numbers, made from the sums of consecutive whole numbers (e.g. 15 = 1 + 2 + 3 + 4 + 5), and from these we can form the square numbers. All we have to do is add up consecutive numbers from these and we get the square numbers. To get the first square number, we have to add a 0 on to the front of the list:
0, 1, 3, 6, 10, 15, 21...
0 + 1 = 1 = 1^2
1 + 3 = 4 = 2^2
3+ 6 = 9 = 3^2
6 +10 = 16 = 4^2
10 +15 = 25 = 5^2
15 +21 = 36 = 6^2
Incidentally, you can also get the square numbers by taking the differences of numbers two places apart on the 4th diagonal in of Pascal's triangle. The fourth diagonal goes 1, 4, 10, 20 35... , and the differences you get are 1-0 = 1, 4-0 = 4, 10-1 = 9, 20-4 = 16, 35-10 = 25 and so on.
To understand why you get the square numbers from adding together consecutive triangle numbers, you can use a variety of methods. Firstly, if you know that the formula for the nth triangle number is (n^2 + n)/2, then the previous triangle number is n less than this, as it's the same sum of numbers but with (n-1) and not n as the last number you add. If we then add together these two numbers, we get
(n^2 + n)/2 + (n^2 + n)/2 - n
= (1/2)n^2 + n/2 + (1/2)n^2 + n/2 - n
= n^2 + n - n
= n^2
If that method was not to your liking, we can also show this result pictorially. Triangle numbers derive their name from fact that you can make them by adding up the number of dots that make different sizes of triangle, and square numbers from the number of dots that make up different sized squares. So all we need to do is make a square from two triangles of dots. If you try this out with coins or counters, or on paper, and make right-angled triangles, you should find that you can make a square from two triangles, but one has to be one counter smaller on each of its sides. Okay, that wasn't that rigorous a method for proving it, but it was a lot easier than doing a lot of algebra, wasn't it?

Monday, August 13, 2012

The Formula for Pascal's Triangle


The formula for Pascal's triangle is n!/(r!(n-r)!). This needs quite a lot of explaining. Firstly, what are n and r supposed to be in this formula? In this equation, n means the row in which the number you're trying to find the value of is. For the formula to work, we must count the row 1,1 as row 1. r is the number of numbers across your number is. In slightly better English, you count from left to right how far along the number you want to calculate is, and this gives you a value for r. The catch, however, is that we count the leftmost 1 as r=0, so you then have to subtract 1. Let's look at an example:
1 1
1 2 1
1 3 3 1
1 4 6 ? 1
So, what values would I use for n and r if I wanted to calculate the number in the position of the question mark? We are in the fourth row down, so n=4. Counting from left to right, the question mark is the fourth number along (okay, a question mark isn't a number, I know, but you get my point). However, we must remember that the first 1 in the row is r=0. Counting up from 0 gives r=3. So, in this example, we get 4!/(3!(4-3)!).
This is all very well, but we still don't know what this actually equals. However, have patience, as I am about to explain what all those "!" signs were for (no, they weren't just punctuation to show how amazing the formula is!)
To calculate n! you have to multiply together every positive whole number up to and including n itself. Perhaps a few examples will clarify this:
1! = 1
2! = 1 x 2 = 2
3! = 1 x 2 x 3 = 6
4! = 1 x 2 x 3 x 4 = 24
10! = 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 = 3628800
It should now be clear how to use the formula for Pascal's triangle! I have given one example here just to you how cool it is:
Say I was walking down the street one day and suddenly needed to know (as one so often does) what the 5th number along on the 14th row of Pascal's triangle was. What do I do?
Firstly, I would have to decide what n and r are. n = 14 as I am interested in the 14th row, and r = 4, as we count along five numbers starting from 0. So, we get 14!/(5!(15-5)!)
= 87178291200/(24×3628800)=1001
So, the number I was looking for was therefore 1001.
This is definitely one of my favourite mathematical formulas. I suggest you try out a few examples yourself to get a feel for how it works. Then, you can try it on your friends and impress them with how fast you can calculate numbers in Pascal's triangle. Have fun!

Wednesday, August 1, 2012

The Fibonacci Sequence


The first two terms of the Fibonacci sequence are 1,1. From then on, each term is the sum of the previous two terms. This makes the third term 1 + 1 = 2, and the fourth term 1 + 2 = 3, and so on. The first ten Fibonacci numbers are shown below:
1, 1, 2, 3, 5, 8, 13, 21, 34, 55
A classic "real life" example of Fibonacci numbers is with rabbits. It goes a bit like this: I start with a pair of young rabbits in month 1. For their first month, they do not breed, as they are too young. However, for every month after this, they produce one new pair of young rabbits, which in turn grow up in a month and start breeding. If we call a junior pair of rabbits JJ and a senior pair SS, this is what happens:
Month
1. JJ = 1 pair
2. SS = 1 pair
3. SS + JJ = 2 pairs
4. SS + SS + JJ = 3 pairs
5. SS + SS + SS + JJ + JJ = 5 pairs
6. SS + SS + SS + SS + SS + JJ + JJ + JJ = 8 pairs
The number of pairs of rabbits gives the Fibonacci numbers! Luckily, in reality, there are certain factors that limit this growth in population. The rabbits will eventually die and stop producing new pairs, there will be limited food and space, etc. According to the sequence, by the end of two years, I would have over 46,000 pairs of rabbits, so it is a good thing that this is not really what happens in nature!
However, the Fibonacci sequence does have some closer links with nature. For example, flowers tend to have a Fibonacci number of petals. This is why it's so hard to find a four leaved clover! If you ever get really bored, you can count the number of petals on a daisy - it may not be exact, but it should be around 55 or 89! Other links with nature include the arrangement of seeds in sunflowers and pines in pine cones, and even the spirals of the shells of some animals.
One final interesting property of Fibonacci numbers is that they can be found in Pascal's triangle. They are perhaps the hardest pattern to spot of all the commonly discussed sequences that can be found in Pascal's triangle, but they are worth searching long and hard for, because they are one of the amazing patterns that can be found in Pascal's triangle! (If you want a hint, then don't look for the numbers themselves, but try adding together numbers from the triangle to make them).