0% found this document useful (0 votes)
5 views

cns 3

The document covers fundamental concepts in number theory and finite fields, focusing on divisibility, the division algorithm, and the Euclidean algorithm for finding the greatest common divisor (gcd). It also explains modular arithmetic, including properties of congruences and operations, as well as the concept of multiplicative inverses in modular systems. Key examples illustrate the application of these concepts in various scenarios.

Uploaded by

vijhayalakshmer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

cns 3

The document covers fundamental concepts in number theory and finite fields, focusing on divisibility, the division algorithm, and the Euclidean algorithm for finding the greatest common divisor (gcd). It also explains modular arithmetic, including properties of congruences and operations, as well as the concept of multiplicative inverses in modular systems. Key examples illustrate the application of these concepts in various scenarios.

Uploaded by

vijhayalakshmer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

Basic Concepts in Number

Theory and Finite Fields


By,
S. Savitha,
AP/CSE,
KSRCE.
Divisibility and The Division Algorithm
 Divisibility
 b divides a if, a = mb for some m, where a, b, and m are integers.
 a / b can be notated as b a commonly used to mean b divides a.
 If b a, we say that b is a divisor of a.
 Properties of divisibility for integers:
The Division Algorithm
 Given any positive integer n and any nonnegative integer a, if we divide a by n,
we get an integer quotient q and an integer remainder r that obey the following
relationship:
Ex:
 -11 mod 7 = 3. How?
 Ans: (11 + ?) mod 7 = 0
 (11 + 0) mod 7  0
 (11 + 1) mod 7  0
 (11 + 2) mod 7  0
 (11 + 3) mod 7  0  14 mod 7 = 0
The Euclidean Algorithm
 Basic techniques of number theory is the Euclidean algorithm
 It is used to determine the greatest common divisor of two positive integers.
 Two integers are relatively prime if their only common positive integer factor is 1.
 Greatest Common Divisor
 Nonzero b is defined to be a divisor of a if a = mb for some m, where a, b, and m are
integers.
 gcd(a, b)  greatest common divisor of a and b.
 The greatest common divisor of a and b is the largest integer that divides both a and b.
 gcd(0, 0) = 0.
 The positive integer c is said to be the greatest common divisor of a and b if,
 1. c is a divisor of a and of b.
 2. Any divisor of a and b is a divisor of c.
 gcd(a, b) = gcd(a, -b) = gcd(-a, b) = gcd(-a,-b).

 In general,
 gcd(60, 24) = gcd(60, -24) = 12

 We stated that two integers a and b are relatively prime if their only
common positive integer factor is 1. This is equivalent to saying that a
and b are relatively prime if gcd(a, b) = 1.
 8 and 15 are relatively prime because the positive divisors of 8 are 1, 2, 4, and 8, and the
positive divisors of 15 are 1, 3, 5, and 15. So 1 is the only integer on both lists.
Finding the Greatest Common Divisor
 we have integers a, b such that d = gcd(a, b). Because
there is no harm in assuming a  b  0. Now dividing a by b and applying the division
algorithm, we can state:
 But if r1  0, we can state that d r1.
 This is due to the basic properties of divisibility:
 The relations d a and d b together imply that d (a - q1b), hence d r1.
 Before proceeding with the Euclidian algorithm, we need to answer the question:
 What is the gcd(b, r1)?
 We know that d b and d r1.
 Now take any arbitrary integer c that divides both b and r1.
 The result is the following system of equations:

 At each iteration, we have d = gcd(r i, ri+1) until finally d = gcd(rn, 0) = rn.


Example with relatively large numbers to see the power of
this algorithm:
Euclidean Algorithm Example
Modular Arithmetic
 The Modulus
 If a is an integer and n is a positive integer, we define a mod n to be the remainder when a is divided by n.
The integer n is called the modulus.
 Thus, for any integer a, we can rewrite Equation (4.1) as follows:

 11 mod 7 = 4;
 - 11 mod 7 = 3
 Two integers a and b are said to be congruent modulo n,
 if (a mod n) = (b mod n).
 This is written as a  b (mod n)
if (a mod n) = (b mod n).
 73 mod 23 = 4
 4 mod 23 = 4
 Hence, 73 is congruently equal to 4 when we applying mod 23 on those numbers.
 73  4 (mod 23)

 21 mod 10 = 1
 -9 mod 10 = 1
 Hence, -9 is congruently equal to 21 when we applying mod 10 on those numbers.
 -9  21 (mod 10)
 -8 mod 3 = ? 8+1 mod 3 = 9 mod 3 = 0
 -8 mod 3 = 1
 -8 mod 12 = ? Ans: 4
 -12 mod 24 = ? Ans: 12

 72  24 (mod 8)
 72  72 mod 8  0
 24  24 mod 8  0
 A mod n = b mod n
 A  b mod n
 72  24 mod 8
 117 mod 13 = ?
Properties of Congruences

 Ex:
 -11 mod 8 = 5. How?
 Ans: (11 + ?) mod 8 = 0
 (11 + 0) mod 8  0
 (11 + 1) mod 8  0
 (11 + 2) mod 8  0
 (11 + 3) mod 8  0
 (11 + 4) mod 8  0
 (11 + 5) mod 8 = 16 mod 8 = 0
Modular Arithmetic Operations

 The (mod n) operator maps all integers into the set of integers {0, 1, …., (n -
1)}.
 Modular arithmetic exhibits the following properties:
 1. [(a mod n) + (b mod n)] mod n = (a + b) mod n
 2. [(a mod n) - (b mod n)] mod n = (a - b) mod n
 3. [(a mod n) * (b mod n)] mod n = (a * b) mod n
 11 mod 8 = 3; 15 mod 8 = 7
 [(11 mod 8) + (15 mod 8)] mod 8 = 10 mod 8 = 2
 (11 + 15) mod 8 = 26 mod 8 = 2
 [(11 mod 8) - (15 mod 8)] mod 8 = -4 mod 8 = 4
 (11 - 15) mod 8 = -4 mod 8 = 4
 [(11 mod 8) * (15 mod 8)] mod 8 = 21 mod 8 = 5
 (11 * 15) mod 8 = 165 mod 8 = 5
Example for the 3 properties:
 11 mod 8 = 3; 15
mod 8 = 7

 [(11 mod 8) + (15 mod 8)] mod 8 = 10 mod 8 = 2


 (11 + 15) mod 8 = 26 mod 8 = 2

 [(11 mod 8) - (15 mod 8)] mod 8 = -4 mod 8 = 4


 (11 - 15) mod 8 = -4 mod 8 = 4

 [(11 mod 8) * (15 mod 8)] mod 8 = 21 mod 8 = 5


 (11 * 15) mod 8 = 165 mod 8 = 5
 The rules for ordinary arithmetic involving addition, subtraction, and
multiplication carry over into modular arithmetic.
Multiplicative inverse

 In ordinary arithmetic, there is a multiplicative inverse, or reciprocal, to each


integer.
 In modular arithmetic mod 8, the multiplicative inverse of x is the integer y such
that (x * y) mod 8 = 1 mod 8.
 Now, to find the multiplicative inverse of an integer from the multiplication table,
scan across the matrix in the row for that integer to find the value 1;
 The integer at the top of that column is the multiplicative inverse;
 Thus, (3 * 3) mod 8 = 1.
 Not all integers mod 8 have a multiplicative inverse;
Arithmetic Modulo 8
 Table 4.2c shows that the integers 1, 3, 5, and 7 have a multiplicative inverse in
Z8; but 2, 4, and 6 do not.
Find multiplicative inverse of 3 (mod 26)

 We want some v, such that,


 3 x v  1 (mod 26)
 V  1/3 (mod 26)
 V  3-1 (mod 26)
Properties of Modular Arithmetic
 Define the set Zn as the set of nonnegative integers less than n:
 Zn = {0, 1, ...., (n - 1)}
 This is referred to as the set of residues, or residue classes (mod n).
 Each integer in Zn represents a residue class.
 We can label the residue classes (mod n) as [0], [1], [2], ...., [n - 1], where
 [r] = {a: a is an integer, a  r (mod n)}
 The residue classes (mod 4) are Residue class. : the set
of elements (such as
 [0] = {…., -16, -12, -8, -4, 0, 4, 8, 12, 16, …..} integers) that leave the
same remainder when
 [1] = {…., -15, -11, -7, -3, 1, 5, 9, 13, 17, …..}
divided by a given
 [2] = {….., -14, -10, -6, -2, 2, 6, 10, 14, 18, ….} modulus.

 [3] = {…., -13, -9, -5, -1, 3, 7, 11, 15, 19, ……}
 Of all the integers in a residue class, the smallest nonnegative integer is the
one used to represent the residue class.
 Finding the smallest nonnegative integer to which k is congruent modulo n is
called reducing k modulo n.
 Properties of Modular Arithmetic for Integers in Zn
 Equation (4.4) is consistent with the existence of an additive inverse. Adding
the additive inverse of a to both sides of Equation (4.4), we have,
 ((-a) + a + b)  ((-a) + a + c) (mod n)
b  c (mod n)
 if (a x b)  (a x c) (mod n) then b  c (mod n) if a is relatively prime to n.
 Recall that two integers are relatively prime if their only common positive
integer factor is 1.
 Applying the multiplicative inverse of a to both sides of Equation (4.5), we
have
 ((a-1)ab)  ((a-1)ac) (mod n)
b  c (mod n)
 The integers 6 and 8 are not relatively prime, since they have the common
factor 2. We have the following:
 6 * 3 = 18  2 (mod 8)
 6 * 7 = 42  2 (mod 8)

 The reason for this strange result is that for any general modulus n, a
multiplier a that is applied in turn to the integers 0 through (n - 1) will fail to
produce a complete set of residues if a and n have any factors in common.
 In general, an integer has a multiplicative inverse in Z n if that integer is relatively
prime to n. Table 4.2c shows that the integers 1, 3, 5, and 7 have a multiplicative
inverse in Z8; but 2, 4, and 6 do not.

You might also like