Modular Arithmetic Part 1 PDF
Modular Arithmetic Part 1 PDF
ivisihiy
he sct inkeaem Conis adpoai tive inteaes
all ncgakive intgos and zeo it i dorotd b
Le Z
1-... *3,-2,-1, 0, 1, 2,3 - -.
-j
0,t,t2, t3.
Conbides 2 inteqtis a and b he ato a divids b
ere cuists an
inteac k such Rar b ka
divide)
9)13-s2 S2 -4x13
9 dos no divide 7« )
78 an inlegex) 9
Division Alge m
ard b he aro tuoo unqne
a
Cuven
Given oo intqed
duch h a
Can 'aluoays
be found
and h
nleges as divibion
Kreen
this is
.
0<hza
huc
h
b:9at Called
i s Called
Caed e quolien and h is
al geti m i6
mainda.
es oivisicn is loDs
he
a)b (Y
wewe <nka
b-qa : ^
Oh<a
I b ath
4 alb
a:2s b:18
s)18 (o
18 7 0x 2S +18
IS2 h: S
2589 1S2x7tS
Q 17 b 2, SS
7-245 (-1S
-25S
S h: 10 - 24S-IS x17 t IO
Note
n al divisiond m a be osihve negakive.
O Zens bu t is aluoays Posihrclon zeo) and le
Ran Re divison
Pote
inteqer d such
ahe not zeo urgle
Har
aboh a and b
d is Ke Cemmon diviso
i dla, d|b
and bb dinides
dinides d.
d
Common divison.o a
) vcy
and b a\d.
i a
bdaidas is outen
ine G.Cà 2 numbeis a and
Ca.b) ic d- lab)
12 and 18
1,2,3,
2 , 3 ,
6,9,
6,,
anc
18
divieAb a
Ihe peiHe a e 1 , 2 ,
3, 65.
13
12 and
Common
divisons o 2 and 18
2 and s
he
GCD
6 Re 18
Clay and
2
Comon
divissA
6 i sKe
ie 612 618 divids
18 divids
6
12
and 18 Mmxm2-
diviseA
on
) Sxa4 and 66
2l6, 3
ii 6 Re G.cD 2
mehod
mehod
o ind
nd GC
G cD
D..
Algeuhm
he
h e
e
exxpp h
re st
s
Euclids and to
and b
a
numkets
Nen
a t by acalrs divisea o
Cemmen diviseA
Cemmon
aealzs
inding Re y e
Re
omalles
malles
Ameod4 e langu by
Re lage
dividing Acmama
um
beus He hna
hoo h e m a i n d e n .
Re
Smalles by ancl
ancl c e
en
on
unlzl
cmainder
Common
Aecondl
he
hence
Me giates
he gicates cxaut
oblaind
is akes
division divisot .
Re Cxau a
diviseA is
Ewlidian Algen m an
a all
)Srep l nd gco inggcol
azb in cach
andbwi
integenda
any hoo
hoo umbeiy
be Ke onucaiA
L a,b
Stp)
R.
a mod b
Sp and bR
Sep3 Le a-b
and b is
Step4Repra
Shp2 and 3 unt D.S.C.E.
caruAan d.
Find ReG-cD 32 andd Sy
SH and expAs
32 S4
32 Su -
0
32
22
22 : S-(33)
32( 0 32-(22) -
22
o 22( 2 22-2l1o)
Acmainoa is
ne as non 3ns
2 10(S 2
. aCD is
2 22-2(10)
2:ts4-)-2[m-(2)
2 Sh - 3(3a) + 222)
SH 332) +2 [ S 1(2)) -
5)-s ()
S4l3) + 32(-s)
2 S4 +32y u 3 y
numbe
a and b ae said to be Aelaivcy
Re.
Pim and nluy la )=1 i
&cD a and b is
saic to be Conguent
Rn a is
nteas
d ony ma-b
ndymbes a s Congucn le b madulo m
wten as a bmod m)
Ihus a abmod m R mab 4 Convesely i
ma-b Ren a Ebmod m)
ie 16-64
i)-69 -s(mod 16) 16 -6145
dih is
Considu Re Con9una 134 108 (mod 13)
13) 134(o
104
humainder
divided b 13, Ke same
134 and 108 axe
hen
4i obBaind This gavs Ke altunatt dcinikon oKe
Conuerce
db
poatve intego (>1) and
a ae
Dinition. m isa
b modulo
oio. to be Conguent
o
is
ahy inteqes en
a
AS= 3 (mod )
AS 3 42
442
124-172(mod 12)
172 4 8
1248
- 124+
1nad ) buc
256-1
:255 1725s
(2")1:
P o p e c b i o
Congucnc
l o n g u u e n c c
b(
b (m
mood
d
m) t tud
(madm) m) ::
(mat
m)Hen
hen a
(mod
ab
h e l a r i o n
td
Ik ean
n lence
eauva
an
ió
Cerescl Aelahon
C o n g u c n u
inkege
In is any
2 and
d:bmod
m)
4 (mod
m)
atc
(btc)
)
(bc){mod m) huc aluoa
aloays.
ac
bi) id no
3i) Conghuuen
Popely be
Convee a
ned no
hen
Ken
s
be (mod m)
Vis a c
m oduoays) ine9
to b module
m s a posiive
and
inlegus Ren.
4. a b, C.d a Cdmod m)
and
Ha
asb(mdm)
sudh
1d) (mad m)
t) arc) lb
bd (mod m)
ac: numbu
ta) wc n d a posibive
a b (mod m)
wa
k
Aome integes
a-b
1Km on
en
Neke asblmed m)
Aincar lenguuerd ih a m
sis a
a
ax b
bmod
:
m)
(madm)
Conguenc o h e koum
A integuu
[unknouorsaa
ih Aatisis
ax eb (med m) is
value
Any
Aduhion o e Cengtuence
sclubhion oa
hos a unique
Conoutn a E mao m
and n n , a th,m:
n t a e n,
n , a 1 n,m-1
0
,atnm
(mod m)
180
n,mo (mod.m)
-
' n , a I mod m)
n3
exists namely
0x(mod m)
a
seluon
solurion e Conguu
ni
anoa
is
asume
Re n
U
n a imod m ) -
Inen
Thom4 hax
n,a-na omod m)
n,aEngo (mod
m)
Aclabircy paime
( ' a ord m ae
D,E n3 (modm)
d bd
b lmod n) Ren qcd (an)
Ramal F o A ax obBaine d
we
Acuton cists
and Rheon
Rn h u e K: 1,
2,3.
Lxat_
y otE
umber dAcuiens
rakes
in uneo Cengluent
Raules inding
axib/nod n) Aanl
Genual koama i n cach
Find Gco (a,n) d (luk)
iposble 5 Acuhion eis lonucaiA-
qAoluuhion a pombl
hede no
Find d mad n
d.
Divide bek Ade by
a
Mul ivose D.S.C.E.
sMulhpuy boh sidis by
i ad)x = b.a med n)
oution tau is +k ue
)enua k o,1,2.rdi)
y #
12 (mod 18)
ax
b (modn)
n 18
a 4
b= 12
ba 1% ournu s l *
18 2 2
n 2 mad
mad
e side
Dinidle bek
+)
H1(mod)
7a 6 mod )
sides by mul inveac a
sMulipy bo
77 6 7 mad ) aa
6.7mod 9).
a
(7-c) madn = ( a c ) medn I
7xc)mood
C 7mad #
e2 4 mod 9 4
C:3 21 mod9t
C 28 mod9)
X 6-h mod 7
2 4 maol 9
Ceneal scluhon
x i a (mool is )
3 Selve
a (mod s)
a b modm)
abtmk
3-H sk
ab m
3mod s)
Guenua Soukon is
n
M:maM2-
3*()
3+ SK
x3s,>
a blypcd n)
n 13
a- 4 12
Gc , 1 ) 2 S d-p
f26
bd
od) cxau
ned a) he lakes
( x 6 (mod S
i n coch
ax blmod n) he
nS
a a b 6 MonaCa iA
G-cd a,1s) 3 => d-3.
(med )
3 x 2(mod s)
(mod s
832
2 3 (mod s)
(3.c) mods I a(ac)(mods)
C: 3 mod #|
3.2 modS : 6mod s I
C:2
C 2
2:2 (mod s
4od s)
4+1) ,:4tS 9
seuhon
ae Atuked
and 4
, 9
8 x 2mod 28)
ax b (mad n)
o 12 n23
a 8
(3,28)4d.
Gcd (a,n)
Aouion cus
bd 1/3
2(mod 2
2 3 mod.7)
3 4 (mod 7)
22 8.2" (mod 7)
3 2 (mod 7) a 12 (mod 1)
1
a c)(mod 7)
C1
2 mad 7
4mod7 +
C 2
G med 7 +
C 3
I
8 mod 7:
= 19g :26
nc ino
Remainder hokesm
he i n e Remainde Retum (CR?) is wd avc a l
vauable bu dikunt
quaons oiR one
duyguunt Conguen
as shoon belouo
moduli ch ae Aloively pume
a , mod m,), xag (mad m,) iag(mod ma)
--
Qn (med mn)
cRT Aas hat Re above eqarions have a wnge
selulion oRe mooluli ote helahvely pume
MM1
M, M M M
M
be Re soluron hapuively
Lr MM M
t CongAuentd eAuahons
Example ie xauE-
CRT
Solv he ollouoing eguakona using Ahe akes
3mod s) XE2tmod 7)
2mod 3) hac alc.
irn
Toind has calls-
a, 2 m, 3
M, "35M, 2 l s in corh
ME105
a 3
m SM, los : 2
OS
M Monica id-
a2 ma7 Mg 10-1 S ns
10S
M:m,x m ma 3xS x7:
as.1) mod s) #I
35 1mod s) ss2(mods) = }
MC) tod s
M I (mod ma)
N 21-1) mods
(mod s)
2 M
IS (mod 7)
Mm 1
(15)(mod 7)
2x15x1mod. 10s
X =2 xas x2 3x2) *1 1
1oS 2332
x 233 (mod los 110
X23
7 x 5 (mod 9
3 s mcd 4)
x 8 mod 9 > 0
26mod 20) 2
(2c)mo
2 (mod 10) Mm m,-9x10 9 0
3(mool 1o)
To Hhd
Gaen
a, 8 m
M, 1o M M 40
a-b m10 M, M
m1: 9 . m9
mm mod10
Dcabg Mm i(mool m)
m1 9m mool to)
to (mod )
9c)mod o) :
C : 1 , 2 , 3 , 4 , S , 6 , 7 , 8 , 9
C-9
X 8 x t o»| +
3x9x9) mod 1g)
As o) 323 (3
X 323 mod 9o 270
x 53 mod 90
io ind
Guien
Mm SS
m,-3 M:165
a- 2 m S
Mn 33
m a 1 , =1s
a m Ma:
l63
Il
x m,x m
3 xSX (medim
M,
(mod s)
mod m, m,m, mod
M,M,
I
(mod s)
33m
I mod 3
SS m, M
mod s)= mc)mat
SSe)mod 3 m,e)
IS3)(mad
ss mod 3
=
C
l6s)
ixISx3) (mod
X:SxsS
2x 33x2 t
16sAS2
S30
XAS2 mad l6S
X 122
Solve ke llawinq quaton ing CRL
x 8 mod ) x3ltmad 20)
Sou
a, m,- 9 3020 M S A-120
a 3 , 20 M M - 130 9 M 9
M:mzO2
D.S.C.E.
Solu
a,2
M6
n
t9,+n omod m
an n- -
baiol o
and a--- An Gz) Audh an souation
n a,
bu cdugke n ian ?o (mod m) i
isisCalld Re degt kO (maed
m)
dukion o e polynemia Congkuenct ts an nege
u in (o, 1, ma) 2 kl): o
Thcom Lagrange 3)
n>i lek kl): an an+
Lepbe
a
pume and intequ,
n
modulo P
be polynomial dene
+9,4
+a,4
a
Then R Conguence k #o
Ci Ono (mod m))
has a mest n
muhuoy in
Conguentt olubong
mod P)
Modulo P
med m)
Roo o t) )(mod m) bo Glt):o
(med m)
Called mod
c io
Snampl
=
*+2x-3 = o (mod s)
Solvekx)
meo,1,2,3,4
S hen
Given m
O 1 (moa T
Buk 0,3,4 a nor Aoos o ) (mods)
Solve h)26- 31 b-76 tS7:e (mad a)
Rdue R given eguaion to obtain equivalen
LonguuenL tguakion.
a) 2 x'-7»*+ 6x'-4x tl s o (mad 8
Agai'n 7 -1(mod 8) 4 6-2(mod 8
uio soluion
selulion a
ab atby C
tby:C
a paubiulas
dlc Atps.
usinq
Me olloing
ollouoing
Can be keund
Souno
to by:C hy einolinq
. Recute he uakon
is psibte
cualren bu
d.This
boAids e
h he asunpkion
e asumpkien
dirids a b and C h
betauht d
aelalion a,+b,t: 1
2. Selvc o s and t in Re
2adula
soluion lan be ound
In
Genua soulnon
olurion Me qenual
indina h pauliuuar
At
Aoluion Can be pund : ot)K
9 YeA)K a e k is
an imtA
ind pahiulas and genealalution e He
cqualion 21t1y 35
a9) ))
:S Yo -S
Gunenal So uion
St2k
o A) :S+)
-S-12)k yS-3k
y)- ) (7,-8)(9.-). . - .
2S+10u :1S
equatiorn
solutèn: o *A)s y-A)t
'potiudor
e
xe:3 6
Genaal une n
*:3+ 2)
x 3 +Q)K
S , - 1 1 ) (,-16)(,-2)-
a tHy S (mod1)
7 Imc 1a)
2x Sy
= S (mod ia) -
3
2 5y 7 (mod 1a) -
A: :SS
A
A:
A: 7
7 n: 13
n:13
d:S
b: c2
a:3 4
Geda s
-42, 3)
a d -be, n)
:
Gcd
Gcd 7,)
custs
ungueL Aouion
S and tou b4
Cenguences
caOhy
malkiplying
2s (mod 13) -
IS+2oy
8 x t 20y
28 med 13) -
14 -6 (mod 13)
1x
7 (mad 13)
Sustem inca Congnuentts
- =
sourion usts
ungm
hy S and coub4
Malkiplyng Congauenes cq
IS +20y 2s (mod 3) - 3
8x +20y 28 mod 13) -
Sa-co h E -2(mad 1a) - -
mulkplys4S by a
4 6 (mod 13)
1 7 (mac 13)
and
Ageinmu plynq
ConguenS
cq 2
7 n mod18) .-(
7 lo(mod 16) -0
2 Sy:9 mod 16)
a:1 b-3 n:1o
n:16
C2 d:2 ^:9
29 (mad 1e)
13
13x -7 16 k
16Kt7
i k 2 grentaral value
x 3 mod 16)
16 3y+
3yt+11 : 6k
y:"
hk:2 :7
y:7 (mod 3)
solre Re Aysterns aons
Sx6y o (mod 1a) -0
6x-7 2 (mad 1a) -
a S b:6 hz 1
h 1
A 2
C 6 d:-7
Gcd (a, b, n) Sed (s,6, 13) :1
he yslem has V
2x6y I (mod 7)
4x+34 2 (mod 7)
a:2 b:6 A:1
n 7
d:3 b:2
C: 4
x t6y ) (mod 1)
4t3y 2 (mod 1) *2
6 3 (mod 7)
2 (mod 7)
72x
) 22-1 : 7K
E+ mod 7)
21 6y 1 (mod 7)
l4)+6y I (mod 7)
8+6y mod 7)
6y:-7(md7)
7/6yt7
6yt7: 7k
yomoc 7