Title: Mathematical backgroundnumber theorem
1Mathematical backgroundnumber theorem
- Integers Z ,-3,-2,-1,0,1,2,3,
- Division and properties of divisibility
- Modular a mod b a b ?a/b?
- Greatest common divisor dgcd(a,b)
- Whenever ca and cb, then cd.
- Least common multiple dlcm(a,b)
- Whenever ac and bc, then dc.
- Fact if agt0, bgt0, then lcm(a,b)ab /gcd(a,b)
2Prime
- If pgt2, the only divisors of p are 1 and p, then
p is called prime, otherwise, composite - Prime number theorem ?(x) denotes ?primes ? x
- ?(x) /(x/ln x) ? 1
- x?17, then ?(x) ? x/ln x
- x ? 1, then ?(x) ? 1.25506 x/ln x
3Relatively prime (co-prime)
- If gcd(a,b) 1, then a and b are co-prime.
- Zn0,1,,n-1
- Zn 0? b ? n gcd(b,n)1
- Fact (Zn,?) forms a group.
4Fundamental theorem of arithmetic
- Any number gt2 has a unique factorization as a
product of prime powers, regardless of order of
primes. - gcd and lcm facts
- Example
- let a48642819, b3458271319 then
- gcd(a,b) 219 38
- lcm(a,b) 28 71319 442624.
- Facts
- if p is prime and pab, the pa or pb.
- If ma and na, and gcd(m,n)1, then mna.
5Algorithms in Z and complexity
- Number of bits k lg n
- Bit operations supposue kmax(lg a, lg b)
- a b O(k)
- a - b O(k)
- a ? b O(k2) (precisely, O(lg a lg b))
- a / b O(k2)
- Example estimate the complexity of n!.
(n-2) (nk k) O(n2 (lg n)2)
6Euclidean algorithm
- Fact if agt0, bgt0 and agtb, then gcd(a,b)gcd(b,a
mod b) - Algorithm
- While b ? 0 do the following
- Set r ? a mod b, a?b, b?r.
- Return a.
- Complexity
- O((lg a)3), more precisely, O((lg a)2)
7Modulo, congruence and Zn
- a ? b mod n iff n divides a-b. called a is
congruent to b modulo n. - Facts
- a ? b mod n iff a and b have the same remainder
when divided by n. - Reflexivity
- Symmetry
- Transitivity, therefore, equivalent class
- If a1 ? b1 mod n and a2 ? b2 mod n
- then a1a2 ? b1b2 mod n and
- a1a2 ? b1b2 mod n
- Define Zn 0,1,,n-1
8Multiplicative inverse
- Given a and n, the multiplicative inverse of a is
an integer x such that ax ? 1 mod n. - If exist, then unique, denoted as xa-1
- Given a,b ? Zn , define a/b mod n ab-1 mod n,
only if b has multiplicative inverse. - Fact a ? Zn , then a is invertible iff
gcd(a,n)1.
9Extended Euclidean Algorithm
- Algorithm computer b-1 mod a
- t0 ? 0, t1 ? 1.
- While b ? 0 do the following
- Set q ? ?a/b?, t ? t0 ? q?t1, t0 ?t1, t1 ?t.
- Set r ? a mod b, a?b, b?r. ,
- If a is 1
- then t0 is b-1 mod a (or a ? t0)
- else no inverse
- Complexity O((lg a)3), more precisely, O((lg
a)2)
10Chinese remainder theorem
- Suppose m1,,mr are pairwise co-primes
- Then the following congruence system
- x ? a1 (mod m1)
- x ? a2 (mod m2)
- .
- x ? ar (mod mr)
- has a unique solution modulo Mm1??mr, which is
given by - x ? ?i1raiMiyi mod M. Where MiM/mi and yi ?
Mi-1 mod mi.
11Specific CRT fact
- If gcd(n1,n2) 1, then
- x a mod n1
- x a mod n2
- Has a unique solution
- x a mod n1n2
12Multiplicative group Zn
- Zn a ? Zn gcd(a, n)1
- In particular, if n is prime, Zn 1,,n-1
- Order of Zn is defined as Zn .
- If a ? Zn , then the order of a, denoted as
ord(a), is the least positive integer t such that
at ? 1 mod n. - Fact for any multiplicative group G of order N
and g ? G, ord(g)N. (Lagrange theorem) - Fact if ord(a)t and as ? 1 mod n, then ts.
13Euler phi function ?
- ?(n) denotes the integers co-prime to n.
- ?(n) Zn
- Fact
- If p is prime, then ?(p) p-1
- If p is prime and a?1, then ?(pa) pa pa-1
- If gcd(m,n)1, then ?(mn) ?(m) ?(n)
- If np1e1 p2e2 pkek , then ?(n) n
(1-1/p1)(1-1/p2) (1-1/pk) - Fact
- For n?5, ?(n) gtn / (6 ln ln n)
14Euler theorem and Fermat theorem
- Fact let n?2,
- If a ? Zn , then a?(n) ?1 mod n. (Euler theorem)
- If n is a product of distinct primes and r ?s mod
?(n) then ar ? as mod n for all integers a. - Fact let p be a prime
- If gcd(a, p)1, then ap-1 ? 1 mod p. (Fermat
theorem) - r ?s mod p-1 then ar ? as mod p for all integers
a - In particular, ap ? a mod p
15Generator or primitive element
- let ?? Zn , if ord(?) ?(n), called generator.
- In this case, Zn ?i mod n 0? i ??(n) -1
- If Zn has a generator, then Zn is said to be
cyclic.
16Properties of generators
- Zn has a generator iff n2,4,pk or 2pk where p
is a prime and kgt1. - In particular, if p is a prime, Zp has a
generator. - If ? is a generator of Zn , then b ? ?i mod n is
also a generator iff gcd(i, ?(n))1. - If Zn is cyclic, the number of generators is ?
(?(n)). - ? is a generator of Zn iff ??(n)/p ?1 mod n for
each prime divisor p of ?(n).
17Quadratic residue modulo n
- let a? Zn, a is said to be a quadratic residue
modulo n or a square modulo n if there exists an
x such that x2 ? a mod n. otherwise a is called
quadratic non-residue modulo n. - The set of all quadratic residue modulo n is
denoted by Qn, The set of all quadratic
non-residue modulo n is denoted by Qn
18Quadratic residue (cont.)
- Fact let p be an odd prime and ? is a generator
of Zp , then - a is a quadratic residue iff a(p-1)/2 ? 1 mod p
- a ? Zp is a quadratic residue iff a ? ?i mod p
and i is even. - Therefore Qp Qp (p-1)/2.
- Fact let npq and p, q are odd primes, then
- a ? Zn is a quadratic residue iff a ? Qp and a
? Qq . - Therefore Qn Qp Qq (p-1)(q-1)/4.
19Square root
- let a? Zn, if x ? Zn satisfies x2 ? a mod n,
then x is called the square root of a modulo n. - Fact
- if p is an odd prime, and a? Qp, then a has
exactly two square roots. - More generally, let np1e1 p2e2 pkek where
the pi are distinct primes and eigt0. If a? Qp,
then a has exactly 2k square roots.
20Algorithms in Zn and complexity
- If a, b ? Zn , then
- (ab) mod nab or ab-n , O(lg a)
- ab mod n, O((lg a)2)
- Multiplicative inverse O((lg a)3) or O((lg a)2)
- Modular exponentiation ak mod n
- square-and-multiply algorithm
- O((lg a)3)
21Legendre symbol
- Let p be an odd prime and a an integer, Legendre
symbol is defined as
0, if pa,
1, if a ? Qp
-1, if a ? Qp
- Fact properties of Legendre symbol (page 72 of
textbook HAC)
22Jacobi symbol
- Let n ? 3 be odd with prime factorization
- np1e1 p2e2 pkek , then Jacobi sysbol is
defined as
In particular, if p is a prime, then Jacobi
symbol is just Legendre symbol.
- Facts Properties of Jacobi symbol (See page 73
of textbook HAC)
23Abstract Algebra--group
- Definition (G, )
- Closed
- Associative
- Identity element 1,
- Inverse element
- If commutative, called abelian group.
- Example
- (Z, ) infinite group,
- (Zn , ) group of order n (modulo n).
- (Zn, ?) is not a group
- (Zn, ?) is a group of order ?(n).
24Abstract algebra--ring
- Definition (R, , ?)
- (R, ) abelian group with identity denoted 0.
- ? is associative
- Exist a multiplicative identity 1 ? 0
- ? is distributive over .
- If a ? b b ? a, then commutative ring.
- Example
- (Z, , ?) infinite commutative ring
- (Zn , , ?) commutative ring (modulo n)
- (Zn, , ?) is not a ring.
- An element a of a ring R is called a unit of an
invertible element if a has an inverse. - The set of units in a ring R forms a group under
?, called the group of unit of R. - Example the group of units of Zn is Zn.
25Abstract algebra--field
- Definition (F, , ?)
- A commutative ring in which all non-zero elements
have multiplicative inverse. - Example
- (Z, , ?) is not a field.
- (R, , ?) is a field.
- Fact
- (Zn, , ?) is a field iff n is a prime.
26Polynomial rings
- Definition
- Degree, Division, remainder
- Irreducible
- Modulo
- Extended Euclidean algorithm