We’re going to look at a way to add up all
the counting numbers from one to a hundred,
or a thousand, or even more, really quickly,
but first we’re going to find out about
a brilliant German mathematician called Johann
Carl Friedrich Gauss, who managed to devise
this method on the spur of the moment when
he was about eight years old, much to the
annoyance of his teacher!
If it hadn’t been for his reluctance to
show his working out in full, Gauss would
probably have been my favourite mathematician
ever! He was born in Germany in 1777, and
showed an incredible aptitude for mathematics
from a very early age.
For example, it’s said that his mother,
who couldn’t read or write, never wrote
down his date of birth, but remembered that
he’d been born on a Wednesday, and that
it was eight days before the Feast of the
Ascension that year. In the Christian tradition,
the Feast of Ascension is celebrated on the
40th day of Easter, which moves each year
based on the phases of the moon. Gauss quickly
used this information to work out that he
must have been born on the 30th April, but
he didn’t just do that, he came up with
a clever way of working out the date of Easter
in any past and future years.
I particularly love this approach of not just
answering the narrowest possible interpretation
of the question that was asked, but instead
coming up with a general approach that can
be used to answer similar questions in the
future. Mathematics can be used to describe,
and understand the structure and nature of
the world around us, so that we can make predictions
about it in the future.
I also admire Gauss’s enthusiasm and tenacity.
Lots of people would just be annoyed with
their mother if she set them a complicated
puzzle in answer to the question “When’s
my birthday?”, but he cheerfully solved
the problem, and then came up with a general
solution to lots of similar problems!
When my eight year old son asked me how old
I was, I said “Well, in seven years’ time
I will be less than three times as old as
you for the first time.” But he couldn’t
be bothered to work it out and said “Alright,
I’ll just ask Mum.”
One of Gauss’s great early achievements
was showing how regular polygons can be constructed
using compasses and a straight edge if their
number of sides is the product of distinct
Fermat primes and a power of 2. He also made
lots of other great mathematical contributions
including proving the quadratic reciprocity
law, which enables us to see whether quadratic
equations are solvable in modular arithmetic.
He completed important work on the prime number
theorem, to help us to see how prime numbers
are distributed among the whole numbers. He
couldn’t have known how useful this sort
of work was going to become in the internet
age, as we use prime numbers to help us encrypt
secure messages and internet transactions,
and understanding them better becomes a matter
of security.
He worked on various types of geometry, magnetism,
geodetic surveys, making astronomical calculations
a lot easier and more efficient to do, least
squares regression analysis, and the statistical
normal distribution was named the Gaussian
distribution after him.
In short, we all benefit from his work in
all sorts of ways every day, from the statistical
methods used to assess new drugs, to the regression
analysis used by machine learning algorithms
that help us to improve the effectiveness
and efficiency of our decision making.
But what I want to look at in this video is
the story of how, when he was only eight years
old, Gauss used his brilliant mathematical
intelligence to solve a problem that was apparently
set by his mathematics teacher as a punishment.
As with most old mathematical anecdotes, it’s
impossible to know exactly what happened,
and depending on where you do your research,
you’ll find slightly different variations
on this story, and his age at the time, but
this is my favourite version.
It’s often said that Gauss was a child prodigy,
and his school teachers found him quite difficult
to deal with because he was quite restless
in class, knew so much, and thought so quickly!
One tale tells of a time when his teacher
told him to sit down and add up all the numbers
from one to 100, just to try to get him to
sit quietly for a while. They thought that
working out “one plus two is three”, “three
plus three is six”, “six plus four is
10”, “10 plus five is 15”, “15 plus
six is 21”, and so on, all the way up to
100 would take him ages, but he very quickly
came back with the right answer, 5050.
Rather than doing all the individual calculations,
Gauss realised that if he wrote out all the
numbers from 1 to 100, he could organise them
into pairs of numbers that summed to 101.
So 1 + 100 is 101, 2 + 99 is 101, 3 + 98 is
101, and so on up to 50 + 51 equals 101.
So he had 50 pairs summing to 101 each, and
the total sum, then, is 50 lots of 101, or
50 times 101. And then 5 times 101 is 505,
and then times 10 times 505 is 5050. Job done!
Now, that’s a neat method, but let’s try
to do the generalising thing – can we describe
the method, or write it out as a formula,
so that it works for all similar problems?
Well, in this example we were summing up 100
consecutive numbers, and we could group them
into half that number (that’s 50) pairs
of numbers that each summed to 101, which
is the sum of the first number, one, plus
last number, 100, making a total of 101.
So, if we generalise, and say we’ve got
‘n’ numbers, rather than specifically
100 numbers, then we can write out our method
mathematically.
In words, we’ve got the sum of the numbers
from one to n is equal to half the number
of numbers (so that’s the number of pairs)
times the sum of the first and the last number.
So, let’s call that sum ‘s’, and the
number of numbers is ‘n’, so half the
number of numbers is ‘n over two’. And
we’re multiplying that by the sum of the
first and last number. That’s one (the first
number) plus n (the last number, whatever
that happens to be).
Then the general formula is that the sum,
s, is equal to n over two times one plus n.
Now, we put together that formula by representing
the calculations that we did, step by step,
but it does leave us with, maybe, a little
concern. It worked fine when we had an even
number of items in the list to add up, but
would it still work if we had an odd number
of items? Then the pairing of numbers would
leave us with another number left over in
the middle, which we’d need to take account
of.
Let’s illustrate that with a smaller list,
to make things easier! For example, if we
added up all the whole numbers from one to
five. We’d have one plus five is equal to
six. Two plus four is equal to six. But we’d
have this number left over in the middle.
So if this had been our starting point for
the problem, we’d have said that for five
numbers we can manage to get four of them
to pair-up to create two pairs, and then we’d
have this one number left over in the middle.
And that three is the mean of the first number
and the last number in the sequence, so one
plus five, add them together, divide by two
because there are two numbers there, and you
get six over two, which is three.
And if we were trying to produce our general
formula from this line of thinking we’d
say that the sum of the numbers is equal to
the sum of the pairs plus the middle number.
Now, what’s the sum of the pairs of the
numbers? Well, we have five numbers, and we’ve
managed to use four of them to pair-up to
make two pairs. So, however many numbers we’ve
got, n, if we reduce that by one, that tells
us how many numbers we’re going to be able
to pair-up. And the number of pairs (because
each pair consists of two numbers) is going
to be half of that number. And the sum of
each pair is still the first number plus the
last number.
So we’re going to multiply that number of
pairs by the sum of each pair, one plus n.
And we said that the middle number was just
the mean of the first and the last number.
So that’s one plus n (the last number) all
divided by two.
Now I’ve got a common factor of a half,
which I can factorise out. So I’ve got a
half times n minus one times one plus n plus
one plus n. Well, now I’ve got a common
factor of one plus n for those two terms,
so I’m going to factorise that out. And
that’s going to leave me with just n minus
one as the first term in the brackets there,
and one as the next term in the brackets,
because it’s one lot of one plus n.
So I’ve adjusted the formula to a half of
one plus n times n minus one plus one. Well,
because we’re just adding and subtracting
here, I can actually remove these brackets
to leave me with n minus one plus one, and
of course if I subtract one, and then add
one, that’s nothing so inside those brackets
that just simplifies down to n. And, of course,
if I’ve just got n in the brackets there,
I actually don’t even need the brackets.
So, my sum (we’ve called s) is equal to
a half of one plus n times n. Well, again,
I can rearrange that, and we get the same
formula we had last time, so whether we’ve
got an even number of terms, or an odd number
of terms, we can still use the same formula
to add up all those numbers.
Now it doesn’t matter whether I add up the
numbers one, two, three, up to a hundred,
or if I do that backwards, from 100, 99, 98,
down to one, so I’ve written both methods
out here.
And if I add those two rows together I’ve
got s plus s gives me two s, so I’ve got
two times the sum of the numbers from one
to 100 is 101 plus 101 plus 101, and so on,
and so on a hundred times.
And that means that double the sum is going
to be 100 times 101. In other words, two times
the sum I’m looking for is 10100. So if
I divide both sides by two I find that the
sum of those numbers is 5050, which is the
answer that I got before.
But the important thing is, if I generalise
this formula, I won’t have any worries about
odd or even numbers of terms because I’m
using every single term in the sequence.
So, writing out the sum of the numbers from
one to n forwards and backwards, and then
adding those two rows together, firstly we
get s plus s is equal to two s. One plus n
is one plus n. Two plus n minus one, well
two minus one is one, so that’s just one
plus n again. Three plus n minus two, well
three take away two is one, so we’ve got
one plus n again. And so on. And then we get
n minus two plus three, well negative two
plus three is one, so again we’ve got n
plus one, or one plus n. And so on.
So we end up with two times the sum is equal
to n lots of one plus n, or n times one plus
n. And then, if I divide both sides of that
by two, that’s the same formula we got before
but using a different method, so using that
different method has helped us to verify that
the formula is correct.
The useful difference with this method, though,
was that it didn’t seem to cause any confusion
whether we had an even or an odd number of
terms in the sequence.
But, finally, let’s try to visualise the
problem in yet another different way, by drawing
out dots in a pattern.
Let’s just say we want to sum the numbers
from one to five, we can represent those numbers
using rows of one then two then three then
four then five dots.
One, two, three, four, five.
So we’ve got a triangle of dots 5 rows high,
and 5 columns wide. How can we easily count
how many dots that it’s got? Well, one way
is to repeat the pattern, then we can rotate
that second triangle of dots by 180 degrees,
and then slide it along over here. Now we’ve
got a rectangle of dots with five columns
and five plus one rows.
We’ve got twice as many dots as we need,
but more importantly, they make a nice rectangular
pattern, which makes them easy to count.
In this configuration we just need to do five
times six to give us 30 dots.
But the number of dots that we’re looking
for is half that number, and a half times
30 is 15, so there were 15 blues dots, or
in other words, summing the numbers from one
to five gives us 15.
Now let’s generalise that to n rows in our
triangle. I know it looks like there are five
rows, but imagine there are loads more, and
we don’t know how many there are. There
are n columns, and n plus one rows when we
take that copy of our triangle of dots and
make them into a rectangular pattern.
So, summing up double the number of dots that
we want, that’s two times the sum, we’re
going to do n times n plus one.
As we said, that’s twice the number of dots
we were looking for, so halving that gives
us the sum is equal to n over two times n
plus one. And so now we’ve got a third method
of coming up with the same formula, and of
course, checking our work.
Now, when we visualise the problem in that
way, and we think about when n is one, or
two, or three, and so on, we get a series
of patterns, and the sums that we get when
n is one, and two, and three, and so on are
called the triangular numbers, and Gauss also
went on to work on the mathematics of these!
Now, having arrived at the same formula three
different ways, and I might say that there
are lots of different ways of expressing that
algebraically, we can apply it to any sequence
of numbers from one to some number:
So, when n is 100, as we saw, the sum is 5050.
When n is 1000, the sum is 500 500. When n
is 1000000, the sum is 500 000 500 000. And
even when we start off with a slightly less
friendly number like 3643, the calculation
isn’t trivial if you haven’t got a calculator,
but it’s still a lot easier than adding
up 3643 different numbers!
When you subscribe to our channel, remember
to click the bell to ensure you get notifications
about our new videos, and for more mathematics
content, why not follow the link in the description
below to Nagwa.com?
