Modular arithmetic

From testwiki
Revision as of 08:02, 12 May 2019 by imported>Texvc2LaTeXBot (Replacing deprecated latex syntax mw:Extension:Math/Roadmap)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Modular arithmetic is a type of arithmetic on finite subsets of the natural numbers

Definition

For n then

a=bmodn iff n|(ab)

This is read as "a is congruent modulo n to b".

Examples

If n=6 then

13=1mod6
10=4mod6
1=13mod6

If n=13 then

26=0mod13
42=3mod13

Calculation

An easy way to calculate in mod{n} is a=bmodn they have the same remainder when divided by n.

Equivalence

Congruence modulo n is an equivalence relation.

Reflexivity

Let n,a. Then (aa)=0 and n|0 so n|(aa). Thus a=amodn.

Symetry

Letn,x,y such that x=ymodn. Then n|(xy). Since (xy)=(1)*(yx),n|(yx). Thus y=xmodn.

Transitivity

Letn,a,b,c such thatx=ymodny=zmodn. Then n|(xy)n|(yz). Then n|((xy)+(yz). Thus n|(xz) and x=zmodn.