Hello again, everybody!
Last time, I told you about my juggling collection.
I said if I put my juggling balls
into piles of two, I'm going to have one left over.
If I put them into piles of three,
I'm going to have two left over.
If I put my collection into piles of five,
I'm going to have four left over.
If I put my collection into piles of seven,
I have six left over.
And if I put my collection into piles of eleven,
I'm going to have ten left over.
And the question was,
how many juggling balls do I have?
Now, did you work it out?
Is there only one solution?
Well, I can tell you
that I have
2,309.
Yes, I have a lot of balls.
To work this out,
you can use something called
"The Chinese Remainder Theorem."
This was first published by 3rd century Chinese mathematicians.
Let x be the size of my collection.
We know that if I divide my collection
into piles of five,
I'm going to have four left over.
We'll use something called 'modular arithmetic.'
I'm going to write it as
x equals, with that super equals sign, with three lines,
x equals four, mod five. [x ≡ 4 mod 5]
This means that if I put my collection, x,
into piles of five,
I'm going to have four left over.
So x could be nine,
it could be fourteen,
it could be nineteen, it could be twenty-four,
that would work.
It could be four as well.
And if we include negative numbers,
it could be minus one,
minus eleven,
minus sixteen,
and so on, all the way down.
But we also know
that if I put my collection
into piles of three,
we're going to have two left over.
So
it could be two,
it could be five,
it could be eight,
it could be eleven,
it could be fourteen,
and so on.
The Chinese Remainder Theorem tells us
which numbers fit both equations.
Let us solve this first.
This only works if the two piles
are co-prime.
This means I can add and subtract
copies of three and five,
to make the number one.
So something like this:
You see here, I've got two times three,
that's six, take away one times five,
okay, and that gives us the number one.
So they are co-prime.
Then the Chinese Remainder Theorem says
x is equal to something mod 15.
This fifteen comes from the three times five.
Then the solution to find the question mark
uses the remainders in this way--
we have a little equation here,
which uses the two remainders
it multiplies, it adds,
and we get the answer fourteen.
So in other words, I can say
That x is 14 mod 15.
That means that if I put it in piles of fifteen,
I'm going to have 14 left over.
So that could be
well, it could be fourteen,
it could be twenty-nine,
it could be forty-four,
and so on, all the way up.
Now, there is another way to do this,
without using that formula.
I could just spot that
fourteen was a common solution
to both equations.
Then I can use that
and simply say
x equals 14 mod 15.
So I could just do it by inspection.
If I add in the other equations,
like this,
there we go--
we've got five of them.
The Chinese Remainder Theorem tells me
that
x, the size of my collection, is going to be something mod 2,310.
That 2,310 comes from
2 times 3 times 5 times 7 times 11.
To work out this question mark
is a lot harder now,
but we can do it.
And we can do it by simply spotting a common solution.
And if you notice
minus 1
is a common solution to these equations.
So I can say
that x is equal to minus 1 mod 2,310.
So it could be
well, it could be minus one,
it could be 2,309,
it could be 4,619
and so on, all the way up to infinity.
But the smallest positive answer
was 2,309.
And that's how you do it!
And, if you have been,
thanks for watching.