Darren_Richardson
Posted on Thursday, 13 November, 2003 - 07:48 pm:

In the November 15+ Challenges problem: Check Codes , it mentions modulo. How do you work out a modulo?
Matthew Buckley
Posted on Thursday, 13 November, 2003 - 08:49 pm:

Darren,

The best way to introduce modular arithmetic is to think of the face of a clock. The numbers go from 1 to 12, but when you get to "13 o'clock," it actually becomes 1 o'clock again (think of how the 24hour clock numbering works.) So 13 becomes 1, 14 becomes 2, etc etc.

This can keep going, so when you get to "25 o'clock," you are actually back round to where 1 o'clock is on the clock face (and also where 13 o'clock was too.)

So in this "clock" world, you only care where you are in relation to the numbers from between 1 and 12. So in this world, 1,13,25,37,...... are all thought of as the same thing, as are 2,14,26,38,......etc etc.

The way we write this mathematically is 13 = 1 (mod 12), and 38 = 2 (mod 12), etc. This is read as "13 is congruent to 1 mod 12" and "38 is congruent to 2 mod 12." It is basically just the way of writing down in symbols: "13=1+some multiple of 12", and "38=2+some multiple of 12."

But you don't have to work only in "mod 12" (that's the technical term for it.) For example you could work mod 7, or mod 46 instead if you wanted to (just think of a clock numbered from 1 up to 7, and 1 up to 46 respectively, and that every time you get past the biggest number, you "reset" to 1 again.)

Just a slight note if you are looking at problems involving this type of thing:

Going back to the normal clock face with the numbers 1 to 12 on it - for good reasons mathematically, we prefer to put a 0 where the 12 should be, so that you would never really write (for example) that 24 = 12 (mod 12) (although that is correct,) but they prefer to write 24 = 0 (mod 12) instead, ie we think of a normal clock face as being numbered from 0 to 11 instead.

So in general, to make it a bit more mathematical, if you are working mod n (where n is any number,) you keep subtracting off multiples of n untill your number is between 0 and n-1 inclusive, and then that is your new number, which is your old one "mod n".

This can be extended. For example, if you know that a = b (mod n), and that c = d (mod n), then a+c = b+d (mod n), and ac = bd (mod n).

If you would like to know any more, or if you need help showing those last two statements, do post back.

Hope that helped,

Matt.
David Chen
Posted on Sunday, 16 November, 2003 - 06:20 pm:

Hi Matt, I don't know modulo at all, but it's very nice to see your messages above. I have got a question.

Is that n can be any numbers including fractions and complex numbers? And how about the multiple? (the one you multiplied by n + b = a)

Thanks advanced,

David
James
Posted on Sunday, 16 November, 2003 - 06:42 pm:

I dont think that n can be a complex number because think about it this way, which is bigger,
5 + i4 or 3 + i9? The answer is, you dont know.
Nicola Coles
Posted on Sunday, 16 November, 2003 - 07:22 pm:

Hi James,

The modulus (i.e. the 'size') of a complex number is defined as the length of the corresponding vector on the Argand diagram.

So the modulus of x+i y is
|x+i y|=   _____
Öx2+y2
 

(using Pythagoras' Theorem).

Therefore,
|5+i4|=   _____
Ö52+42
 
=   __
Ö41
 

and
|3+i9|=   ___________
Ö32 +92
 
=   __
Ö90
 

.

Therefore, 3+i9 has a larger modulus (i.e. is 'bigger') than 5+i4.

However, you can not order complex numbers like you can real numbers. This may have been what you were trying to tell David.

Let me know if you want me to explain any of the terms I've used or want any further explanation.

Hope this helps,

Nicola :)

James
Posted on Sunday, 16 November, 2003 - 09:45 pm:

That is pretty much what I meant, however, on an argand diagram, there is no scale, so for instance, 3 + i4 and 4 + i3 would have the same length, but not the same size (which is why |z| comes with arg z, otherwise it would be meaningless), but this is what you mean by ordering, I'm probably just missusing terms.
Mark Durkee
Posted on Sunday, 16 November, 2003 - 10:31 pm:

Just to clarify this, modulo arithmetic is normally restricted to integers - the modulus of complex numbers that you're referring to is something different.
Matthew Buckley
Posted on Sunday, 16 November, 2003 - 10:57 pm:

Sorry Darren - I may have misinterpreted what you were asking me!

Oh well - now you know about both those topics!

Matt.
Nicola Coles
Posted on Sunday, 16 November, 2003 - 11:56 pm:

Sorry, I should have clarified this earlier. Thanks for pointing out the possible confusion Mark - the words are very similar!

Modulo arithmetic (what Matt explained) is restricted to integers i.e. no fractions or complex numbers.

The modulus of a complex number (what I explained) is unrelated - I just wanted to clarify James' use of a 'bigger' complex number.

Matt, you didn't misinterpret what Darren was asking - I just went off at a tangent.

Sorry for any confusion,
Nicola
Vicky Neale
Posted on Monday, 17 November, 2003 - 08:25 am:

What Nicola means by ordering is that while for real numbers we can use the symbols < and > to mean something (0 < 1, 3 > e etc.), we cannot do this with the complex numbers. If this is not clear to you immediately, just try to work out what < would mean for complex numbers. Would we say that 0 < i? 3+4i < 4+3i? Thus we can only talk about relative sizes of complex numbers by considering the modulus (since this gives a real number, and we can compare these).

Post back if you want any of this explaining any more!

Vicky