So start.

So this is four is out,

I start from the fifth,

and now I go 1, 2, 3,

4, 5, 6, 7,

8, 9, 10, 11,

12, 13, 14, 15,

16, 17, 18, 19.

So okay this is out.

So the two is out.

I would start again on the third sweet.

That's going to take a long time.

We can do better than that.

Because really, we're wrapping around the number 19

around the number of sweets around five sweets.

So that means that 19 covers the five sweets three

times and then there's four more words to

use so the fourth chocolate is out.

Yes, that's what we got.

Then, I start counting on the fifth

and I've got four chocolates to count over.

Nineteen covers it four times, that's 16.

Then, there's three more words left.

So the third chocolate after the fifth,

which is a third, that is number two and that is out.

Then, I've got three chocolates left.

I starts on the third chocolates,

19 covers it six times that makes 18,

and then there's one word left so

the third chocolate is out.

Then, I'll do it again.

I have two chocolates left,

I start on the fifth,

and then I'll just go even and odd, even and odd,

alternating between the fifth and the

first and the fifth is out.

So I will eat the first sweet first.

I'll eat my cupcake first.

You can do it yourself with

your traits and check my math.

So we really didn't need to do

the counting around every time.

What we needed was the remainder of

the division of 19 by

how many sweets were left on the table.

So 19 divided by five is three with remainder four,

so the fourth chocolate is out and I start on the fifth.

So I've got the fifth, the first,

the second, and the third available.

Then, starting on the fifth,

I'll do 19 divided by four,

which is four remainder three,

and from five, one,

two, the second is out.

Then, I start on the third chocolate

and I have the third,

the fifth, and the first.

So 19 divided by three is six with a remainder one,

so the third chocolate is out.

Then, I start on the fifth chocolate,

I've got the fifth and the first,

19 divided by two is nine with remainder one,

so the fifth chocolate is out and

so I will eat the first.

All we needed were the remainders,

this wrapping around numbers and

requiring only remainders of

division is the core of what we do in modular arithmetic.

You and I use it every

day to work with hours and minutes and seconds.

You see 20 minutes after 1:56 PM, it's 2:16 PM.

You add 56 minutes with 20 minutes,

that makes 76 minutes,

and then you take away the 60 minutes giving

you 16 minutes past the hour.

Then that extra 60 minutes,

you convert into one more hour so you add one to the

1:00 PM making it to 2:16 PM.

Modular arithmetic is often referred

to as clock arithmetic.

But instead of working always with

60 minutes of 12-hour clock faces,

we work with the size of

the clock we need for each problem.

With the chocolates, we did 19 divided

by five equals three with remainder four,

so here we were working with

a clock face with five hours.

When we did 19 divided by

four equals four with remainder three,

we actually want a clock face with four hours.

Nineteen divided by three

which was 16 with remainder one,

we were working on a clock face with three hours.

Nineteen divided by two,

which is nine with remainder one,

we actually want a clock face with two hours.

Well, the two-hour clock just highlights if

the number we were working is even or odd.

Like in binary, odd numbers end

with a one and even numbers end with a zero.

What's cool about this concept of working with

remainders of division is that

the rules of arithmetic are very

similar to the ones with common numbers.

What I mean is that 45

divided by four leaves remainder one,

and that's because four times 11 is

44 and that's the highest multiple

of four fitting into 45.

So the remainder is one. I'll write that.

So 45 divide by four leaves remainder one,