23 October 2014

We'll be counting... numbers

You may have learnt the formula in school:

$\sum\limits_{r=1}^n r = \frac{(n+1)(n)}{2}$

$n$ here is the last value in the series to be added up. $a$ is the starting value. $r$, the value after the summation sign is the formula for any term - and here it is simply on its own, meaning if you are on the 3rd term of the series, r will be equal to 3. In other words, the series is simply a number line from a to n.
However, this formula in itself is not very intuitive, what makes that formula work? Well, you may also have learnt "the" proof, which involves pairing up the numbers in reverse order and adding them up to give the sum of double the series, then dividing by 2. However, as you will soon discover, this is definitely not the only way of thinking about this problem. There are various other ways which may help you to get a much more in-tune understanding of what makes this formula tick.
N.B. This is of course the general formula for the sum of numbers going up in 1's, I will attempt to expand this formula to be valid for any arithmetic progression later.

For the purposes of this exercise, I will be using the set of numbers 1 to 10, who's sum (work it out on a calculator if you do not trust me) happens to be 55.

Preamble

Interesting note: the word preamble comes from the prefix' pre', meaning 'before' and the addition amble, coming from the Latin verb 'ambulare' meaning 'to walk'. It is meant to signify a stroll before a run, or a gentle introduction.

Any operation you perform on a number can be regarded as a transformation, much like you would do to a graph. You could, say, take the number 1. You could then ADD 2 to it. Here, we can think of the reference point as being the number 1 and the operation to be to add 2 to it. On a number line, this would simply be jumping two whole number spaces ahead. Very simple. However, you could achieve the same operation, by multiplying by 3. This can be regarded as an addition to the reference point 0 of 3 lots of 1. It can also be regarded as a sort of stretch as you would stretch out a piece of rubber to multiply its length by 3. Subtraction is simply the opposite of division. You take away a set of whole numbers to get your new value, with your original value acting as the reference point. Division is similar. Lets say you wanted to divide the number 1 by 3 this time. This can be regarded as either splitting the number up into 3, or in terms of a multiplication again, with x being the division's answer:

$3x = 1$

So, it is the number you add to zero three times to get one. What I am saying is that you can think of multiplication and division as addition or subtraction.

Method 1 - even numbers

Suppose we start with the numbers 1 to 10. We need to add them up. You could either use a calculator, or you could do as the mathematician Carl Gauss supposedly did when his teacher tried to occupy his students by telling them to add up the numbers 1 to 100: see the patterns in the numbers.

The numbers 1 to 10 can be laid out as follows:

 1  2 3 4 5
10 9 8 7 6

Let us take $x$ to equal the number last term ($x$th term in a sequence) and let us take $n$ as the actual value of the last term. For the purposes of jumps of 1, starting on 1 these values happen to be equal for a sequence. However, if the value of the "jump" changes or we start on a value other than 1 then they will not be. For now, we can consider them to be equal.

$\sum\limits_{r=1}^n r = \frac{(n+1)(n)}{2}$

is therefore better written (in more general cases):

$\sum\limits_{r=1}^x r = \frac{(n+1)(x)}{2}$

N.B. This is simply the notation I have chosen to use. Please do not assume that this is the convention.

As can be seen from the layout of the numbers 1 to 10, each row contains half the numbers: the lower row contains the bigger ones, the upper row contains the smaller ones. If we add up the columns, we find every column will add up to 11. There are five columns and five times 11 is 55 - our answer.

The sum of each column is in fact equal to $(n+1)$ with n being the final number. There are $\frac{x}{2}$ columns, where $x$ is the number of numbers to be added, and so the sum of the numbers from 1 to n can be generalised (for now for even values of n only, with a jump of 1 between each number):

$\sum\limits_{r=1}^n r = \frac{(n+1)(n)}{2}$

But say our starting number was not 1, but another number which we will call $a$, how do we now use this formula?

Well, its pretty simple if you think about it. If you want to add up the numbers 3 to 5, then you can simply add up the numbers 1 to 5 and take away the values in the unwanted range: 1 and 2. These values are simply in the range 1 to one below the starting number. The maximum value of the range -the range is here 1 to 2 - will always be one less than the starting value of the range you actually want. (In a more general sense, it is the x=0th term of ANY arithmetic series, where a is x=1th term - arithmetic series are simply formulae to calculate the nth term of a series which have the form $nth term = a + nr$).

So...

$\sum\limits_{r=a}^n r = \frac{(n+1)(n)}{2} - \frac{(a)(a-1)}{2}$

Here $\frac{(a)(a-1)}{2}$ simply gives you the sum of all the values up to one less than the value a.

Note: we can only actually use $\frac{(a)(a-1)}{2}$ as a formula, since once again, the value of a will be equal to its number in the overall sequence on the first term of the sequence we want to add up.

Method 2 - odd numbers

The above operation is very good for sums of numbers up to even numbers - but what happens when the value of n is odd? A good question. Say we had to add up all the numbers from 1 to 9 instead? What happens then?

Well, actually - all you need to do is think about the problem in a different way. We can obviously not make pairs from 9 numbers, since that would require 9 to be divisible by 2, which it isn't.

We can however, approach the problem by trying to convert the set of 9 numbers into a set of 10 numbers without affecting the overall sum: the way we do this is by including 0 as one of our numbers.

0 1 2 3 4
9 8 7 6 5

There... all those numbers added up would equal $\sum\limits_{1}^9$. Here, every column added up would equal 9. There are in fact 5 columns which is equal to the value of $\frac{(n+1)}{2}$. Hang on a minute... so the value of the sum of a series of odd numbers is...

$\sum\limits_{r=1}^n r = \frac{(n+1)(n)}{2}$

Reminder: for these sequences, n=x.

They are both the same! Except they are derived in slightly different ways. However - this now seems to be a general formula.

However, we can also use another method: calculate the value of the numbers 1 to 10 instead and simply take away the number 10.

$\sum\limits_{r=1}^n r = \frac{(n+1)(n+2)}{2} - (n+1)$
$\sum\limits_{r=1}^n r = \frac{(n+1)(n+2) - 2(n+1)}{2}$
$\sum\limits_{r=1}^n r = \frac{(n+1)(n+2-2)}{2}$
$\sum\limits_{r=1}^n r = \frac{(n+1)(n)}{2}$

Again, here I am using (n+2) as x since the sequence is equivalent to the number line and n=x.

Again - the same formula!

Method 3 - averages

Now, we have not yet thought about this very nifty trick! It should make sense that if we have a set of numbers which are each separated by one unit (e.g. 1 to 10 or 1 to 9) then we can calculate the average of these numbers by finding their sum and dividing by the number of terms we have.

$Sum = \frac{(n+a)(x)}{2}$
$Average = \frac{(n+a)(x)}{2x}$
$Average = \frac{(n+a)}{2}$

Here, as you may have noticed, we are using the value $a$ instead of 1, to make the thing more general, as well as $x$, since $x$ may not be equal to $n$ in some cases.

It works equally well using the above proofs, look at this diagram:

a (a+1) (a+2)
n (n-1) (n-2)

This is a similar construct to that which I used to prove that the sum of all the pairs in series which start at 1 were equal to $(n+1)$. You can now see that more generally:

$Sum = \frac{(n+a)(x)}{2}$

Where $x = n$ if the numbers go up in 1's. This general formula will work for all differences (usually denoted using the letter $d$ in arithmetic sequences).

Now - this general formula for the average makes sense! Instead of adding up ALL the numbers, we simply take the biggest number - $n$ in this case, and the smallest number - $a$. Adding the biggest and the smallest number and dividing by 2 gives you the number exactly in between both - the average in the case that the numbers which separate the biggest and smallest numbers are all equally spaced.

Now, we can simply multiply the average by the number of terms, $x$, to get the sum of the numbers from $a$ to $n$.

$Sum = \frac{(n+a)(x)}{2}$

Although this proof seems like it loops back on itself, since we proved that the average of a number by deriving from a formula for the sum, it is useful, since you can prove that:

$Average = \frac{(n+a)}{2}$

simply by applying a bit of common sense. In effect this proof can worth both ways, depending on whether you are sure the average of a number follows the formula given above, or that the sum of numbers follows the formula.

Another note on finding the sum of series

There is another clever way to find the sum of a series which does not start with the number 1. That is to imagine that it is a series that starts with 1, and then simply trim off the start of the series up to 1 before your starting value.

For example, we already have the formula:



Visualising what we have learned using geometry

Now, this is a very useful thing to do if you want an intuitive understanding, since we as humans operate in a world filled with geometry and physical objects. You will see in a later post that  the same thing helps to really explain imaginary numbers and i.

So, we've got this formula:

$\sum\limits_{r=1}^n r = \frac{(n+a)(x)}{2}$

But how do we visualise this? Using a rectangle of course!

We can visualise, for example, the sum of the numbers 3 to 10 as a series of dots.

ooo
oooo
ooooo
oooooo
ooooooo
oooooooo
ooooooooo
oooooooooo

If we've got two of these:

xxx
xxxx
xxxxx
xxxxxx
xxxxxxx
xxxxxxxx
xxxxxxxxx
xxxxxxxxxx

Now we add them together.

oooxxxxxxxxxx
ooooxxxxxxxxx
oooooxxxxxxxx
ooooooxxxxxxx
oooooooxxxxxx
ooooooooxxxxx
oooooooooxxxx
ooooooooooxxx

We have made a rectangle, of height $x$ and width $(n + a)$ I'm sure you agree: the area of which is simply

$x(n+a)$

But we've got double the amount of dots, so the area is simply...

$Sum = \frac{x(n + a)}{2}$

Once again... the same formula!

Another cool way of adding numbers together

Now that we know the formula 

$Sum = \frac{x(n + a)}{2}$

to be true for any series, here's a cool way to work out the sum of all the odd or even numbers between a set of two values.

Lets say you want to add up all the even numbers between 1 and 20. We can think about this problem in a few ways, one of which being that we can simply work out the sum of the numbers 1 to 10 and then double the sum. This will, in effect, double each term in the series, giving us all the even numbers between 1 and 20. You can see this by looking at the upper and lower limits: the lowest number you can get is 2, this is the first even number between 1 and 20. The highest number is 20, this is the last number you get between 1 and 20.

$EVEN \sum\limits_{r=1}^{20} r =( \frac{(10+1)(10)}{2})(2)$
$EVEN \sum\limits_{r=1}^{20} r =110$

Now we have calculated that value, why not simply calculate the odd values? Since aren't they just the negative space of the even values?

We can do this by taking the value above away from the sum of the values to 20.

$ODD\sum\limits_{r=1}^{20} r =( \frac{(20+1)(20)}{2}) - ( \frac{(10+1)(10)}{2})(2)$
$ODD\sum\limits_{r=1}^{20} r =100$

You can see here that the value of the odd and even numbers added together are simply $\frac{n}{2}$ apart, when the highest value in the series is even - with the sum of the evens being higher. If the highest value is odd, then they are $\frac{n+1}{2}$ apart - with the sum of the odds being higher.

Now that you have read this article: go and look at this question for an interesting discussion.

Credit goes to Better Explained for some of the ideas. This website is fantastic!

No comments:

Post a Comment