Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example.

Similar documents
8+4 0 mod (12), mod (12), mod (12), mod (12), mod (12).

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

Fields in Cryptography. Çetin Kaya Koç Winter / 30

Chapter 4 Mathematics of Cryptography

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

ax b mod m. has a solution if and only if d b. In this case, there is one solution, call it x 0, to the equation and there are d solutions x m d

Mathematical Foundations of Cryptography

Discrete Structures Lecture Solving Congruences. mathematician of the eighteenth century). Also, the equation gggggg(aa, bb) =

1. multiplication is commutative and associative;

1 2 3 style total. Circle the correct answer; no explanation is required. Each problem in this section counts 5 points.

CHAPTER 3. Congruences. Congruence: definitions and properties

Commutative Rings and Fields

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Notes on Systems of Linear Congruences

With Question/Answer Animations. Chapter 4

Mathematics for Cryptography

Chapter 4 Finite Fields

Basic elements of number theory

Basic elements of number theory

4.4 Solving Congruences using Inverses

8 Primes and Modular Arithmetic

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

Finite Fields and Error-Correcting Codes

A. Algebra and Number Theory

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Introduction to Information Security

ECEN 5022 Cryptography

Algorithms CMSC Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse

Lecture Notes. Advanced Discrete Structures COT S

LECTURE NOTES IN CRYPTOGRAPHY

5 Group theory. 5.1 Binary operations

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Modular Arithmetic and Elementary Algebra

Homework #2 solutions Due: June 15, 2012

Finite Fields. Mike Reiter

Chapter 5. Modular arithmetic. 5.1 The modular ring

MATH 361: NUMBER THEORY FOURTH LECTURE

Wilson s Theorem and Fermat s Little Theorem

Discrete Logarithms. Let s begin by recalling the definitions and a theorem. Let m be a given modulus. Then the finite set

MODULAR ARITHMETIC KEITH CONRAD

Congruences and Residue Class Rings

Course 2316 Sample Paper 1

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Linear Cyclic Codes. Polynomial Word 1 + x + x x 4 + x 5 + x x + x f(x) = q(x)h(x) + r(x),

COMPUTER ARITHMETIC. 13/05/2010 cryptography - math background pp. 1 / 162

Chapter 2 - Relations

Relations. Binary Relation. Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation. Let R A B be a relation from A to B.

Quasi-cyclic codes. Jay A. Wood. Algebra for Secure and Reliable Communications Modeling Morelia, Michoacán, Mexico October 12, 2012

3.2 Solving linear congruences. v3

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

3 The fundamentals: Algorithms, the integers, and matrices

GRE Subject test preparation Spring 2016 Topic: Abstract Algebra, Linear Algebra, Number Theory.

Part V. Chapter 19. Congruence of integers

Number Theory Proof Portfolio

The number of ways to choose r elements (without replacement) from an n-element set is. = r r!(n r)!.

12x + 18y = 50. 2x + v = 12. (x, v) = (6 + k, 2k), k Z.

Rings. EE 387, Notes 7, Handout #10

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

Lecture 7: Polynomial rings

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

Finite Fields: An introduction through exercises Jonathan Buss Spring 2014

Chapter 1 : The language of mathematics.

The Euclidean Algorithm and Multiplicative Inverses

A connection between number theory and linear algebra

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

Computations/Applications

The Chinese Remainder Theorem

Algebra for error control codes

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Math 109 HW 9 Solutions

Definition For a set F, a polynomial over F with variable x is of the form

1 Overview and revision

Definition List Modern Algebra, Fall 2011 Anders O.F. Hendrickson

Linear Cyclic Codes. Polynomial Word 1 + x + x x 4 + x 5 + x x + x

EXTRA CREDIT FOR MATH 39

Math 511, Algebraic Systems, Fall 2017 July 20, 2017 Edition. Todd Cochrane

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6

17 Galois Fields Introduction Primitive Elements Roots of Polynomials... 8

Discrete Math, Second Problem Set (June 24)

Introduction to finite fields

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions

CIS 6930/4930 Computer and Network Security. Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

Abstract Algebra, Second Edition, by John A. Beachy and William D. Blair. Corrections and clarifications

Arithmetic and Algebra

Numbers, Groups and Cryptography. Gordan Savin

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

Chinese Remainder Theorem

Elementary Properties of the Integers

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

Math 2070BC Term 2 Weeks 1 13 Lecture Notes

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

The Chinese Remainder Theorem

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 3

Transcription:

Coding Theory Massoud Malek Algebra Congruence Relation The definition of a congruence depends on the type of algebraic structure under consideration Particular definitions of congruence can be made for groups, rings, vector spaces, modules, semigroups, lattices, and so forth The common theme is that a congruence is an equivalence relation on an algebraic object that is compatible with the algebraic structure Every congruence relation has a corresponding quotient structure, whose elements are the equivalence classes (or congruence classes) for the relation Examples Integers For a given positive integer n, two integers a and b are called congruent modulo n, written a b (mod n), if a b is divisible by n (or equivalently if a and b have the same remainder when divided by n) For example, 13 43 (mod 10), since 13 43 = 30 is a multiple of 10 Group In an group G, and is a binary relation on G, then is a congruence whenever: (i) For any a G, then a a G (reflexivity) (ii) For any a, b G, if a b G then b a G (symmetry) (iii) For any a, b, c G, if a b G and b c G, then a c G (transitivity) Homomrphism If : A B is a homomorphism between two algebraic structures (such as homomorphism of groups, or a linear map between vector spaces), then the relation defined by a 1 a 2 if and only if (a 1 ) = (a 2 ) is a congruence relation Modular Arithmetic In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers wrap around upon reaching a certain valuethe modulus The foundations of modular arithmetic were introduced in the third century BCE, by Euclid, in the 7th book of his Elements The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book Disquisitiones Arithmeticae, published in 1801 Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example Permutation Matrices An n n permutation matrix P is a matrix obtained from the n n identity matrix I n by a permutation of rows Every row and column of a permutation matrix

Massoud Malek Algebra Page 2 contains precisely a single one with zeros everywhere else For example, the matrix 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 P = 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 is obtained by exchanging the columns 2 and 3, and 4 and 5, of I 6 A permutation matrix P is nonsingular, and the determinant is always ±1 In addition, permutation matrices are orthogonal matrices (ie, P P t = I n ); Thus P 1 = P t Since we are using row operations on the identity matrix, we conclude that any permeation matrix is row equivalent to an identity matrix of the same size A cyclic permutation matrix is a specific permutation matrix given by 0 0 0 1 1 0 0 0 P = 0 0 0 0 0 1 0 Circulant Matrices In linear algebra, a circulant matrix is a matrix where, each row vector is rotated one element to the right (or left) relative to the preceding row vector An n n circulant matrix C takes the form c 0 c n 1 c 2 c 1 c 1 c 0 c n 1 c 2 C n = c 1 c 0 c n 2 c n 1 c n 1 c n 2 c 1 c 0 A circulant matrix is fully specified by the vector c, which appears as the first column of the matrix C n We have C n = c 0 I + c 1 P + c 2 P 2 + + c n 1 P n 1, where P is the n n cyclic permutation matrix The set of n n circulant matrices forms an n-dimensional vector space Circulant matrices form a commutative ring, since for any two given circulant matrices A and B, the sum A + B is circulant, the product A B is circulant, and A B = B A

Massoud Malek Algebra Page 3 A special type of circulant matrix is defined as ( 1 n ) ( n ( 1 2) n ) ( n 1 n ) ( n 1 1 n ( n ) 1) n 2 ( n ) n 1 1 ( n C n = 2), ( n ) ( n ( 2 1) n ) ( n ) ( n 1 2 3) 1 where ( n 1) is a binomial coefficient Companion Matrix The companion matrix of a monic polynomial (the leading coefficient equals one) p(x) = a 0 + a 1 x + + a n 1 x n 1 + x n, denoted by C p is an n n matrix defined as follows: 0 1 0 0 0 0 a 0 0 0 1 0 0 1 0 0 a 1 C p = with C t p = 0 0 0 1 0 0 0 an 2 a 0 a 1 a n 2 a n 1 0 0 1 a n 1 It can be shown that p(x) is the characteristic polynomial of both C p and Cp; t that is det(xi n + C p ) = det(xi n + C t p) = p(x) We shall see that the companion matrix of a polynomial will be the shift matrix of the circuit for dividing polynomials while the transpose of a companion matrix will be the shift matrix of a circuit that encodes a cyclic code Finite Field Z n To make error correcting codes easier to use and analyze, it is necessary to impose some algebraic structure on them It is especially useful to have an alphabet in which it is possible to add, subtract, multiply and divide without restriction In other words we wish to construct a finite field Evarist Galois (1811-32), a French mathematician who died in a duel at the age of 20 introduced finite fields and proved that there exists a field of order q if and only if q is a prime power (ie q = p r, where p is prime and r is a positive integer) Furthermore, there is, up to relabeling, only one field of that order Finite fields of order q are also known as Galois field of order q and are denoted by GF (q) Let us now try to give Z m = {0, 1, 2,, m 1} the structure of a field We define addition and multiplication in Z m by a + b c (mod m) and ab d (mod m) For example in Z 12 we have 8+4 0 (mod 12), 5+7 11 (mod 12), 8+9 5 (mod 12), 4 5 8 (mod 12), 3 4 0 (mod 12) Note that 3 4 0 (mod 12), thus Z 12 is not a field The following theorem characterizes Z m

Massoud Malek Algebra Page 4 Theorem 1 Z m is a field if and only if m is a prime number Proof Suppose m is not prime, then m = ab for some integers a and b, both less than m Thus a b 0 (mod m), with a 0 and b 0 So, m must be prime Now suppose that m is prime To prove that Z m is a field we only need to show that every nonzero member of Z m has a multiplicative inverse Let a Z m with a 0, then {1a, 2a,, (m 1)a} must be distinct in Z m If not then for some i, j Z m with i > j and i a = j a (i j) a 0 (mod m) m divides a or (i j) This is a contradiction with the fact that m is greater than both a and i j Thus Z m is a field According to this theorem Z 10 is not a field but Z 11 is a field Although Z 10 is not a field but some of its members have an inverse, for example the inverse of 3 in Z 10 is 7 The Extended Euclidean Algorithm This algorithm finds the inverse of a number x in Z m It also shows if x has no inverse in Z m First we set x 0 = x and x 1 = m The quotient obtained at step k will be denoted by q k As we carry out each step of the Euclidean Algorithm, we will also calculate an auxiliary number, p k For the first two steps, the value of this number is given: p 0 = 0 and p 1 = 1 For the remainder of the steps, we recursively calculate p k p k 2 p k 1 q k 2 (mod n) Continue this calculation for one step beyond the last step of the Euclidean algorithm The algorithm starts by dividing n by x Case 1 The last non-zero remainder occurs at step k, then if this remainder is 1, x has an inverse and it is p k+2 Case 2 The last non-zero remainder is not 1, then x does not have an inverse Example Find the inverse of 15 (mod 26) First we set x 0 = 15 and x 1 = 26 Steps x k+1 = q k (x k ) + r k p k p k 2 p k 1 q k 2 (mod 26) Step 0 26 = 1 15 + 11 p 0 = 0 Step 1 15 = 1 11 + 4 p 1 = 1 Step 2 11 = 2 4 + 3 p 2 0 1 1 (mod 26) = 25 Step 3 4 = 1 3 + 1 p 3 1 25 1 (mod 26) 24 (mod 26) = 2 Step 4 3 = 3 1 + 0 p 4 25 2 2 (mod 26) = 21 Step 5 The inverse is found p 5 2 21 1 (mod 26) 19 (mod 26) = 7

Massoud Malek Algebra Page 5 r 3 = 1, so the inverse of 15 modulo 26 exists Thus 15 1 = p 5 = 7 Exercises Find the inverse (if there exist) of 21 and 26 mod 34 Chinese Remainder Theorem Suppose m 1, m 2,, m r are pairwise relatively prime and let M = m 1 m 2 m r Define M 1 = M/m 1, M 2 = M/m 2,, M r = M/m r For integers a 1, a 2,, a r, the system of congruences, x a k (mod m k ), for k = 1, 2,, r has a unique solution modulo M, given by: x a 1 M 1 b 1 + a 2 M 2 b 2 + + a r M r b r (mod M), where M k = M / m k and b k M 1 k (mod m k ) for k = 1, 2,, r Proof Notice that gcd (M k, m k ) = 1 for k = 1, 2,, r Thus, every b k exists and can be determined easily from the extended Euclidean Algorithm From M k M 1 k = M k b k 1 mod (m k ), we obtain a k M k b k a k (mod m k ) for all k = 1, 2,, r On the other hand, a k M k b k 0 for all k = 1, 2,, r, we have x a k (mod m j ) if j is not k (since m j divides M k in this case) Thus, (mod m k ) for k = 1, 2,, r If there were two solutions, say x 0 and x 1 then we would have x 0 x 1 0 mod (m k ) for k = 1, 2,, r, so x 0 x 1 0 mod (M), ie, they are the same modulo M Example Find the smallest multiple of 10 which has remainder 2 when divided by 3 and remainder 3 when divided by 7 We are looking for a number which satisfies the congruences, x 2 (mod 3), x 3 (mod 7), x 0 (mod 2), and x 0 (mod 5) Since 2, 3, 5, and 7 are all relatively prime in pairs, then according to the Chinese Remainder Theorem, there is a unique solution modulo We calculate the M k s and b k s as follows: M = 2 3 5 7 = 210 We have: M1 = 210/2 = 105; b 1 105 1 (mod 2) = 1 M2 = 210/3 = 70; b 2 70 1 (mod 3) = 1 M3 = 210/5 = 42; b 3 42 1 (mod 5) = 3 M4 = 210/7 = 30; b4 30 1 (mod 7) = 4

Massoud Malek Algebra Page 6 Thus x 0 M 1 b 1 + 2 M 2 b 2 + 0 M 3 b 3 + 3 M 4 b 4 = 0 + 2 70 1 + 0 + 3 30 4 = 0 + 140 + 0 + 360 = 500 (mod 210) 80 Note The Chinese mathematician Sun Tsu was aware of this result in the first century AD