Algebra for error control codes

Size: px
Start display at page:

Download "Algebra for error control codes"

Transcription

1 Algebra for error control codes EE 387, Notes 5, Handout #7 EE 387 concentrates on block codes that are linear: Codewords components are linear combinations of message symbols. g 11 g 12 g 1n g 21 g 22 g 2n [m 1,m 2,...,m k ] }{{}..... = [c 1,c 2,...,c n ]. }{{} message m codeword c g k1 g k2 g kn }{{} generator matrix G Error detection begins with the syndrome, also a linear combination of codeword symbols. h 11 h 12 h 1n h 21 h 22 h 2n [r 1,r 2,...,r n ] }{{}..... = [s 1,s 2,...,s n k ]. }{{} senseword r syndrome s h k1 h k2 h kn }{{} parity-check matrix G EE 387, September 30, 2015 Notes 5, Page 1

2 Algebra for error control codes (cont.) Nonlinear algebra is also needed. Error correction requires finding the zeroes of polynomials whose coefficients are rational functions of the syndrome components. [s 1,s 2,...,s n k ] }{{} syndrome s PGZ or Berlekamp-Massey or Euclidean } {{ } decoding algorithm [Λ 1,Λ 2,...,Λ ν ] }{{} error locator polynomial s All of these steps require that we can add and multiply channel symbols. Decoding also requires division every nonzero symbol needs a reciprocal. Fields are algebraic structures with invertible addition and multiplication. Unlike floating point arithmetic, finite field computations are exact. Fields inherit properties from groups and rings, and field elements are the scalars for vector spaces. So we also define groups, rings, and vector spaces. EE 387, September 30, 2015 Notes 5, Page 2

3 Number theory and modular arithmetic: motivation Error-control codes use check equations. These equations require that arithmetic operations be defined for codeword symbols. Finite-precision arithmetic is easier to implement than unlimited precision. Finite fields (+,,, ) are defined using modular arithmetic: Integer arithmetic modulo a prime number, (2 31 1): mod = Polynomial arithmetic modulo a prime polynomial (lsb first): (x 3 +x+1) (x 2 +1) mod (x 4 +x+1) = = 1000 Note that the product of two 4-bit vectors is also a 4-tuple. Other applications of modular arithmetic: Pseudo-random number generation Public-key cryptography EE 387, September 30, 2015 Notes 5, Page 3

4 Multiples and divisors Let a, b, m be integers with a b = m. m is product or multiple of a and b a,b are factors or divisors of m Terminology: a divides m. Notation: a m or a\m. Obvious: every nonzero integer m has divisors ±1 and ±m. A proper divisor of m is a divisor a such that 1 < a < m. m proper divisors of m 6 2,3 28 2,4,7, ,4,8,16,32,64, = ,5,17, = , A positive integer p is prime if it has no proper divisors. Note: 6 = and 28 = are perfect numbers. All even perfect numbers are (2 p 1)(2 p 1 ) where p is prime (2 p 1 is a Mersenne prime). Open questions: is there an odd perfect number or are there infinitely many perfect number? EE 387, September 30, 2015 Notes 5, Page 4

5 Distribution of prime numbers The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31. The only even prime 2 is excluded in many theorems about finite fields. But p = 2 is vital to applications of fields to error-correcting codes. Theorem: (Euclid) There are infinitely many prime numbers. Proof: Suppose there are only finitely many primes, {p 1,p 2,...,p t }. Then m = (p 1 p 2 p t )+1 is not divisible by any p i. So either m is prime or has a prime divisor different from all p i. Prime Number Theorem: Let π(x) be the number of primes less than x. lim x π(x) x/lnx = 1 = π(x) x lnx = p n nlnn. Fact: (Bertrand) For every integer n 2 there is a prime between n and 2n. In particular, there is at least one m-bit prime for every m 1. Similarly, there is at least one prime binary polynomial of degree m 1. (In fact, there are 2 m /m prime polynomials). EE 387, September 30, 2015 Notes 5, Page 5

6 Division algorithm The division algorithm expresses the dividend n as the sum of a multiple, qd, of the divisor d and a remainder r: n = (ndivd)d+(n mod d) = qd+r, where 0 r < d. Fact: quotient and remainder produced by the division algorithm are unique. The method of this proof will be used repeatedly in this course. Suppose q 1 d+r 1 = q 2 d+r 2, where 0 r 1 r 2 < d. Combine the above equality and inequalities: 0 r 2 r 1 = (q 1 q 2 )d r 2 < d. Thus r 2 r 1 is a nonnegative multiple of d that is less than d. Therefore r 2 r 1 = 0, hence r 2 = r 1, hence q 2 = q 1. Division algorithm 0: repeatedly subtract d from n while incrementing q. More efficient procedure (nonrestoring division): First find the largest m such that 2 m n. Then fo = m,m 1,...,1,0 if n 2 i, subtract 2 i d from n and add 2 i to q. EE 387, September 30, 2015 Notes 5, Page 6

7 Greatest common divisor The greatest common divisor gcd(m,n) of two integers m and n is the largest integer that divides both m and n. Example: divisors of 12: 1,2,3,4,6,12 divisors of 30: 1,3,5,6,10,15,30 common divisors: 1,3,6 greatest common divisor: gcd(12,30) = 6 Theorem: gcd(m, n) is the smallest positive integer linear combination d = am+bn where a,b are integers. Proof: Obviously every common divisor of m and n is a divisor of d. So we must show that d divides m and n. First m. Use the division algorithm: m = qd+r = q(am+bn)+r, where 0 r < d = am+bn. The remainder s also an integer combination of m and n: r = m q(am+bn) = (1 qa)m+(qb)n < d. Since d is the least positive combination, r must be 0; i.e., That is, d m. In the same way we show that d n. EE 387, September 30, 2015 Notes 5, Page 7

8 GCD examples We can find gcd by inspection (and factoring) for small cases: gcd(4,12) = 4 = gcd(12,28) = 4 = gcd(17,37) = 1 = = = 408 = 1 mod 37 The Euclidean algorithm is an efficient method for computing both the greatest common divisor and the coefficients a and b. Example: To find a and b such that gcd(17,37) = 17a+37b. a i b i = 1 + = 2 1 a i = a i 2 a i 1 b i = b i 2 b i 1 To check this result: 17 ( 13)+37 6 = = 1. EE 387, September 30, 2015 Notes 5, Page 8

9 Relatively prime numbers Two different integers m and n are relatively prime or coprime if they have no common proper divisors, i.e., their greatest common divisos 1. If m and n are relatively prime, then there are integers a and b such that 1 = gcd(m,n) = am+bn (Obviously, if a > 0 then b 0, and vice versa.) Therefore bn = 1 am 1 mod m. In other words, b is the multiplicative inverse (reciprocal) of n modulo m. When m is prime, every n such that 0 < n < m is relatively prime to m. Corollary: Integers mod p form a finite field if (and only if) p is prime. Addition, subtraction, and multiplication mod p have associative and commutative properties. And division works for every nonzero divisor. EE 387, September 30, 2015 Notes 5, Page 9

10 Useful property of coprime numbers Lemma: If d = gcd(r,s) and m 0, then gcd(mr,ms) = md. Proof: Obviously, md is a common divisor of mr and ms. Conversely, d = gcd(r,s) = ar +bs = md = m(ar +bs) = a(mr)+b(ms). This shows that every common divisor of mr and ms is a divisor of md. Theorem: If m rs and gcd(m,r) = 1, then m s. Proof: Trivially true if s = 0. If s > 0 then by the previous lemma gcd(ms,rs) = s gcd(m,r) = s 1 = s = s = a(ms)+b(rs) is the sum of two multiples of m. Thus s is a multiple of m, that is, m s. Important special case of the previous result: Lemma: If p is prime and p ab, then p a or p b (or both). Proof: Since p is prime, p a or gcd(a,p) = 1. If gcd(a,p) = 1 then p b. EE 387, September 30, 2015 Notes 5, Page 10

11 Fundamental Theorem of Arithmetic Fundamental Theorem of Arithmetic: Every integer 2 has a unique factorization into primes, apart from the order of the factors. Proof: First show that every integer m 2 can be factored into primes. We use complete mathematical induction. If m is prime, its factorization is simply m = m. Otherwise let m = ab with a < m and b < m. By induction, a and b have prime factorizations a = p 1 p r and b = q 1 q s. So m = ab = p 1 p r q 1 q s is a prime factorization of m. Uniqueness: suppose there is an integer with two different factorizations. Divide out primes common to the representations to obtain p 1 p 2 p r = q 1 q 2 q s where p j and q j are primes and no p i equals any q j. But p 1 q 1 q 2 q s implies that p 1 must be a divisor of some q j. This is a contradiction. EE 387, September 30, 2015 Notes 5, Page 11

12 Euclidean algorithm We can find gcd(r, s) by reducing to a smaller problem: gcd(s qr, r). Every common divisor of r,s is a common divisor of r,s qr and vice versa. The Euclidean algorithm generates sequence of remainders r 1 > r 2 > > r n > 0 where the final remaindes the greatest common denominator, r n = gcd(r,s). r 1 = s = Q 1 r 0 +r 1 0 < r 1 < r r 0 = r = Q 2 r 1 +r 2 0 < r 2 < r 1 r 1 = Q 3 r 2 +r 3 0 < r 3 < r 2. 2 = 1 +. r n 2 = Q n r n 1 +r n r n 1 = Q n+1 r n 0 < < 1 0 < r n < r n 1 r n r n 1 This procedure halts after a finite number of steps because each remainder is a positive number smaller than the preceding remainder. EE 387, September 30, 2015 Notes 5, Page 12

13 Euclidean algorithm: integer examples The third tableau shows that division can be sloppy; quotients are powers of 2 More steps are needed, but the steps are simpler The fourth example shows that the worst case running time. This occurs when inputs are consecutive Fibonacci numbers, 1,2,3,5,8,13,21,34,... F n = F n 1 +F n 2 ; initial conditions F 0 = 0,F 1 = 1. EE 387, September 30, 2015 Notes 5, Page 13

14 Euclidean algorithm: worst case Fibonacci numbers are the worst case for the Euclidean algorithm Nonconsecutive Fibonacci numbers are easier. See the last two tableaux. Fact: gcd(f i,f j ) = F gcd(i,j). EE 387, September 30, 2015 Notes 5, Page 14

15 Extended Euclidean algorithm Every remainder is an integer combination of r and s: = a i r +b i s This is obvious fo = 1 and r 1 i = 0 r s r 0 = 1 r + 0 s i = 1,0,1,...,n The other coefficients a i and b i can be computed iteratively: = = (a i 1 r +b i 1 s) + (a i 2 r +b i 2 s) = ( a i 1 +a i 2 )r + ( b i 1 +b i 2 )s = a i r + b i s The sequences {a i } and {b i } satisfy same linear recurrence that defines { }: a i = a i 1 + a i 2 and b i = b i 1 + b i 2 ri 2 = is integer part of quotient of two previous remainders. 1 EE 387, September 30, 2015 Notes 5, Page 15

16 Extended Euclidean algorithm: reciprocals Find reciprocal of 17 in GF(37). a i b i Answer: 17 1 = 13 = 24. Check: = 408 = Find reciprocal of x 3 +x 2 mod x 4 +x+1 over GF(2). Answer: x 3 +x. (x) (x) a i (x) x 4 +x+1 0 x 3 +x 2 1 x 2 +x+1 x+1 x+1 x x x 2 +x+1 1 x+1 x 3 +x (x) (x) a i (x) EE 387, September 30, 2015 Notes 5, Page 16

Divisibility in the Fibonacci Numbers. Stefan Erickson Colorado College January 27, 2006

Divisibility in the Fibonacci Numbers. Stefan Erickson Colorado College January 27, 2006 Divisibility in the Fibonacci Numbers Stefan Erickson Colorado College January 27, 2006 Fibonacci Numbers F n+2 = F n+1 + F n n 1 2 3 4 6 7 8 9 10 11 12 F n 1 1 2 3 8 13 21 34 89 144 n 13 14 1 16 17 18

More information

The Fundamental Theorem of Arithmetic

The Fundamental Theorem of Arithmetic Chapter 1 The Fundamental Theorem of Arithmetic 1.1 Primes Definition 1.1. We say that p N is prime if it has just two factors in N, 1 and p itself. Number theory might be described as the study of the

More information

Chapter 5. Modular arithmetic. 5.1 The modular ring

Chapter 5. Modular arithmetic. 5.1 The modular ring Chapter 5 Modular arithmetic 5.1 The modular ring Definition 5.1. Suppose n N and x, y Z. Then we say that x, y are equivalent modulo n, and we write x y mod n if n x y. It is evident that equivalence

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand 1 Divisibility, prime numbers By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a

More information

Cyclic codes: overview

Cyclic codes: overview Cyclic codes: overview EE 387, Notes 14, Handout #22 A linear block code is cyclic if the cyclic shift of a codeword is a codeword. Cyclic codes have many advantages. Elegant algebraic descriptions: c(x)

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a k for some integer k. Notation

More information

NOTES ON SIMPLE NUMBER THEORY

NOTES ON SIMPLE NUMBER THEORY NOTES ON SIMPLE NUMBER THEORY DAMIEN PITMAN 1. Definitions & Theorems Definition: We say d divides m iff d is positive integer and m is an integer and there is an integer q such that m = dq. In this case,

More information

ECEN 5022 Cryptography

ECEN 5022 Cryptography Elementary Algebra and Number Theory University of Colorado Spring 2008 Divisibility, Primes Definition. N denotes the set {1, 2, 3,...} of natural numbers and Z denotes the set of integers {..., 2, 1,

More information

Tomáš Madaras Congruence classes

Tomáš Madaras Congruence classes Congruence classes For given integer m 2, the congruence relation modulo m at the set Z is the equivalence relation, thus, it provides a corresponding partition of Z into mutually disjoint sets. Definition

More information

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

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. 2 Arithmetic This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. (See [Houston, Chapters 27 & 28]) 2.1 Greatest common divisors Definition 2.16. If a, b are integers, we say

More information

4 Powers of an Element; Cyclic Groups

4 Powers of an Element; Cyclic Groups 4 Powers of an Element; Cyclic Groups Notation When considering an abstract group (G, ), we will often simplify notation as follows x y will be expressed as xy (x y) z will be expressed as xyz x (y z)

More information

1. multiplication is commutative and associative;

1. multiplication is commutative and associative; Chapter 4 The Arithmetic of Z In this chapter, we start by introducing the concept of congruences; these are used in our proof (going back to Gauss 1 ) that every integer has a unique prime factorization.

More information

3 The fundamentals: Algorithms, the integers, and matrices

3 The fundamentals: Algorithms, the integers, and matrices 3 The fundamentals: Algorithms, the integers, and matrices 3.4 The integers and division This section introduces the basics of number theory number theory is the part of mathematics involving integers

More information

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory). Wednesday, February 21 Today we will begin Course Notes Chapter 5 (Number Theory). 1 Return to Chapter 5 In discussing Methods of Proof (Chapter 3, Section 2) we introduced the divisibility relation from

More information

x n k m(x) ) Codewords can be characterized by (and errors detected by): c(x) mod g(x) = 0 c(x)h(x) = 0 mod (x n 1)

x n k m(x) ) Codewords can be characterized by (and errors detected by): c(x) mod g(x) = 0 c(x)h(x) = 0 mod (x n 1) Cyclic codes: review EE 387, Notes 15, Handout #26 A cyclic code is a LBC such that every cyclic shift of a codeword is a codeword. A cyclic code has generator polynomial g(x) that is a divisor of every

More information

Finite Fields. Mike Reiter

Finite Fields. Mike Reiter 1 Finite Fields Mike Reiter reiter@cs.unc.edu Based on Chapter 4 of: W. Stallings. Cryptography and Network Security, Principles and Practices. 3 rd Edition, 2003. Groups 2 A group G, is a set G of elements

More information

Chapter 4 Finite Fields

Chapter 4 Finite Fields Chapter 4 Finite Fields Introduction will now introduce finite fields of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public Key concern operations on numbers what constitutes a number

More information

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

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z: NUMBER SYSTEMS Number theory is the study of the integers. We denote the set of integers by Z: Z = {..., 3, 2, 1, 0, 1, 2, 3,... }. The integers have two operations defined on them, addition and multiplication,

More information

g(x) = 1 1 x = 1 + x + x2 + x 3 + is not a polynomial, since it doesn t have finite degree. g(x) is an example of a power series.

g(x) = 1 1 x = 1 + x + x2 + x 3 + is not a polynomial, since it doesn t have finite degree. g(x) is an example of a power series. 6 Polynomial Rings We introduce a class of rings called the polynomial rings, describing computation, factorization and divisibility in such rings For the case where the coefficients come from an integral

More information

With Question/Answer Animations. Chapter 4

With Question/Answer Animations. Chapter 4 With Question/Answer Animations Chapter 4 Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their properties. Key ideas in number theory include divisibility

More information

Commutative Rings and Fields

Commutative Rings and Fields Commutative Rings and Fields 1-22-2017 Different algebraic systems are used in linear algebra. The most important are commutative rings with identity and fields. Definition. A ring is a set R with two

More information

Applied Cryptography and Computer Security CSE 664 Spring 2017

Applied Cryptography and Computer Security CSE 664 Spring 2017 Applied Cryptography and Computer Security Lecture 11: Introduction to Number Theory Department of Computer Science and Engineering University at Buffalo 1 Lecture Outline What we ve covered so far: symmetric

More information

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. Chapter 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. If n > 1

More information

2. THE EUCLIDEAN ALGORITHM More ring essentials

2. THE EUCLIDEAN ALGORITHM More ring essentials 2. THE EUCLIDEAN ALGORITHM More ring essentials In this chapter: rings R commutative with 1. An element b R divides a R, or b is a divisor of a, or a is divisible by b, or a is a multiple of b, if there

More information

1 Overview and revision

1 Overview and revision MTH6128 Number Theory Notes 1 Spring 2018 1 Overview and revision In this section we will meet some of the concerns of Number Theory, and have a brief revision of some of the relevant material from Introduction

More information

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya BBM 205 Discrete Mathematics Hacettepe University http://web.cs.hacettepe.edu.tr/ bbm205 Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya Resources: Kenneth Rosen,

More information

Summary Slides for MATH 342 June 25, 2018

Summary Slides for MATH 342 June 25, 2018 Summary Slides for MATH 342 June 25, 2018 Summary slides based on Elementary Number Theory and its applications by Kenneth Rosen and The Theory of Numbers by Ivan Niven, Herbert Zuckerman, and Hugh Montgomery.

More information

4 Number Theory and Cryptography

4 Number Theory and Cryptography 4 Number Theory and Cryptography 4.1 Divisibility and Modular Arithmetic This section introduces the basics of number theory number theory is the part of mathematics involving integers and their properties.

More information

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

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes. INTEGERS PETER MAYR (MATH 2001, CU BOULDER) In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes. 1. Divisibility Definition. Let a, b

More information

A Guide to Arithmetic

A Guide to Arithmetic A Guide to Arithmetic Robin Chapman August 5, 1994 These notes give a very brief resumé of my number theory course. Proofs and examples are omitted. Any suggestions for improvements will be gratefully

More information

Rings and modular arithmetic

Rings and modular arithmetic Chapter 8 Rings and modular arithmetic So far, we have been working with just one operation at a time. But standard number systems, such as Z, have two operations + and which interact. It is useful to

More information

Elementary Properties of the Integers

Elementary Properties of the Integers Elementary Properties of the Integers 1 1. Basis Representation Theorem (Thm 1-3) 2. Euclid s Division Lemma (Thm 2-1) 3. Greatest Common Divisor 4. Properties of Prime Numbers 5. Fundamental Theorem of

More information

Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006 Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 2.4 2.6 of Rosen Introduction I When talking

More information

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?

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? Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative

More information

Chinese Remainder Theorem

Chinese Remainder Theorem Chinese Remainder Theorem Theorem Let R be a Euclidean domain with m 1, m 2,..., m k R. If gcd(m i, m j ) = 1 for 1 i < j k then m = m 1 m 2 m k = lcm(m 1, m 2,..., m k ) and R/m = R/m 1 R/m 2 R/m k ;

More information

Rings. EE 387, Notes 7, Handout #10

Rings. EE 387, Notes 7, Handout #10 Rings EE 387, Notes 7, Handout #10 Definition: A ring is a set R with binary operations, + and, that satisfy the following axioms: 1. (R, +) is a commutative group (five axioms) 2. Associative law for

More information

4 PRIMITIVE ROOTS Order and Primitive Roots The Index Existence of primitive roots for prime modulus...

4 PRIMITIVE ROOTS Order and Primitive Roots The Index Existence of primitive roots for prime modulus... PREFACE These notes have been prepared by Dr Mike Canfell (with minor changes and extensions by Dr Gerd Schmalz) for use by the external students in the unit PMTH 338 Number Theory. This booklet covers

More information

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2 8. p-adic numbers 8.1. Motivation: Solving x 2 a (mod p n ). Take an odd prime p, and ( an) integer a coprime to p. Then, as we know, x 2 a (mod p) has a solution x Z iff = 1. In this case we can suppose

More information

Diophantine triples in a Lucas-Lehmer sequence

Diophantine triples in a Lucas-Lehmer sequence Annales Mathematicae et Informaticae 49 (01) pp. 5 100 doi: 10.33039/ami.01.0.001 http://ami.uni-eszterhazy.hu Diophantine triples in a Lucas-Lehmer sequence Krisztián Gueth Lorand Eötvös University Savaria

More information

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93. Exercises Exercises 1. Determine whether each of these integers is prime. a) 21 b) 29 c) 71 d) 97 e) 111 f) 143 2. Determine whether each of these integers is prime. a) 19 b) 27 c) 93 d) 101 e) 107 f)

More information

1. Revision Description Reflect and Review Teasers Answers Recall of Rational Numbers:

1. Revision Description Reflect and Review Teasers Answers Recall of Rational Numbers: 1. Revision Description Reflect Review Teasers Answers Recall of Rational Numbers: A rational number is of the form, where p q are integers q 0. Addition or subtraction of rational numbers is possible

More information

MATH 361: NUMBER THEORY FOURTH LECTURE

MATH 361: NUMBER THEORY FOURTH LECTURE MATH 361: NUMBER THEORY FOURTH LECTURE 1. Introduction Everybody knows that three hours after 10:00, the time is 1:00. That is, everybody is familiar with modular arithmetic, the usual arithmetic of the

More information

Fundamental Theorem of Algebra

Fundamental Theorem of Algebra EE 387, Notes 13, Handout #20 Fundamental Theorem of Algebra Lemma: If f(x) is a polynomial over GF(q) GF(Q), then β is a zero of f(x) if and only if x β is a divisor of f(x). Proof: By the division algorithm,

More information

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

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations Page 1 Definitions Tuesday, May 8, 2018 12:23 AM Notations " " means "equals, by definition" the set of all real numbers the set of integers Denote a function from a set to a set by Denote the image of

More information

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

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime. PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice

More information

Ma/CS 6a Class 2: Congruences

Ma/CS 6a Class 2: Congruences Ma/CS 6a Class 2: Congruences 1 + 1 5 (mod 3) By Adam Sheffer Reminder: Public Key Cryptography Idea. Use a public key which is used for encryption and a private key used for decryption. Alice encrypts

More information

2301 Assignment 1 Due Friday 19th March, 2 pm

2301 Assignment 1 Due Friday 19th March, 2 pm Show all your work. Justify your solutions. Answers without justification will not receive full marks. Only hand in the problems on page 2. Practice Problems Question 1. Prove that if a b and a 3c then

More information

8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

More information

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

CIS 6930/4930 Computer and Network Security. Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography CIS 6930/4930 Computer and Network Security Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography 1 Review of Modular Arithmetic 2 Remainders and Congruency For any integer a and any positive

More information

Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS

Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS CS131 Part I, Number Systems CS131 Mathematics for Computer Scientists II Note 1 INTEGERS The set of all integers will be denoted by Z. So Z = {..., 2, 1, 0, 1, 2,...}. The decimal number system uses the

More information

The Euclidean Algorithm

The Euclidean Algorithm MATH 324 Summer 2006 Elementary Number Theory Notes on the Euclidean Algorithm Department of Mathematical and Statistical Sciences University of Alberta The Euclidean Algorithm Given two positive integers

More information

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

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element. The first exam will be on Monday, June 8, 202. The syllabus will be sections. and.2 in Lax, and the number theory handout found on the class web site, plus the handout on the method of successive squaring

More information

Fall 2017 Test II review problems

Fall 2017 Test II review problems Fall 2017 Test II review problems Dr. Holmes October 18, 2017 This is a quite miscellaneous grab bag of relevant problems from old tests. Some are certainly repeated. 1. Give the complete addition and

More information

Mathematics for Cryptography

Mathematics for Cryptography Mathematics for Cryptography Douglas R. Stinson David R. Cheriton School of Computer Science University of Waterloo Waterloo, Ontario, N2L 3G1, Canada March 15, 2016 1 Groups and Modular Arithmetic 1.1

More information

Chapter 3 Basic Number Theory

Chapter 3 Basic Number Theory Chapter 3 Basic Number Theory What is Number Theory? Well... What is Number Theory? Well... Number Theory The study of the natural numbers (Z + ), especially the relationship between different sorts of

More information

Introduction to Number Theory

Introduction to Number Theory INTRODUCTION Definition: Natural Numbers, Integers Natural numbers: N={0,1,, }. Integers: Z={0,±1,±, }. Definition: Divisor If a Z can be writeen as a=bc where b, c Z, then we say a is divisible by b or,

More information

Remainders. We learned how to multiply and divide in elementary

Remainders. We learned how to multiply and divide in elementary Remainders We learned how to multiply and divide in elementary school. As adults we perform division mostly by pressing the key on a calculator. This key supplies the quotient. In numerical analysis and

More information

6.1. Rational Expressions and Functions; Multiplying and Dividing. Copyright 2016, 2012, 2008 Pearson Education, Inc. 1

6.1. Rational Expressions and Functions; Multiplying and Dividing. Copyright 2016, 2012, 2008 Pearson Education, Inc. 1 6.1 Rational Expressions and Functions; Multiplying and Dividing 1. Define rational expressions.. Define rational functions and give their domains. 3. Write rational expressions in lowest terms. 4. Multiply

More information

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

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer. CHAPTER 2 INTRODUCTION TO NUMBER THEORY ANSWERS TO QUESTIONS 2.1 A nonzero b is a divisor of a if a = mb for some m, where a, b, and m are integers. That is, b is a divisor of a if there is no remainder

More information

Numbers, Groups and Cryptography. Gordan Savin

Numbers, Groups and Cryptography. Gordan Savin Numbers, Groups and Cryptography Gordan Savin Contents Chapter 1. Euclidean Algorithm 5 1. Euclidean Algorithm 5 2. Fundamental Theorem of Arithmetic 9 3. Uniqueness of Factorization 14 4. Efficiency

More information

Outline. Some Review: Divisors. Common Divisors. Primes and Factors. b divides a (or b is a divisor of a) if a = mb for some m

Outline. Some Review: Divisors. Common Divisors. Primes and Factors. b divides a (or b is a divisor of a) if a = mb for some m Outline GCD and Euclid s Algorithm AIT 682: Network and Systems Security Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography Modulo Arithmetic Modular Exponentiation Discrete Logarithms

More information

Outline. AIT 682: Network and Systems Security. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

Outline. AIT 682: Network and Systems Security. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms AIT 682: Network and Systems Security Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography Instructor: Dr. Kun Sun Outline GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation

More information

Rings If R is a commutative ring, a zero divisor is a nonzero element x such that xy = 0 for some nonzero element y R.

Rings If R is a commutative ring, a zero divisor is a nonzero element x such that xy = 0 for some nonzero element y R. Rings 10-26-2008 A ring is an abelian group R with binary operation + ( addition ), together with a second binary operation ( multiplication ). Multiplication must be associative, and must distribute over

More information

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald) Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald) 1 Euclid s Algorithm Euclid s Algorithm for computing the greatest common divisor belongs to the oldest known computing procedures

More information

COMS W4995 Introduction to Cryptography September 29, Lecture 8: Number Theory

COMS W4995 Introduction to Cryptography September 29, Lecture 8: Number Theory COMS W4995 Introduction to Cryptography September 29, 2005 Lecture 8: Number Theory Lecturer: Tal Malkin Scribes: Elli Androulaki, Mohit Vazirani Summary This lecture focuses on some basic Number Theory.

More information

EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972)

EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972) Intro to Math Reasoning Grinshpan EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972) We all know that every composite natural number is a product

More information

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

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2006 Contents 9 Introduction to Number Theory and Cryptography 1 9.1 Subgroups

More information

Numbers and their divisors

Numbers and their divisors Chapter 1 Numbers and their divisors 1.1 Some number theoretic functions Theorem 1.1 (Fundamental Theorem of Arithmetic). Every positive integer > 1 is uniquely the product of distinct prime powers: n

More information

CS483 Design and Analysis of Algorithms

CS483 Design and Analysis of Algorithms CS483 Design and Analysis of Algorithms Lectures 2-3 Algorithms with Numbers Instructor: Fei Li lifei@cs.gmu.edu with subject: CS483 Office hours: STII, Room 443, Friday 4:00pm - 6:00pm or by appointments

More information

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?

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? Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative

More information

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology. MATH 501 Discrete Mathematics Lecture 6: Number theory Prof. Dr. Slim Abdennadher, slim.abdennadher@guc.edu.eg German University Cairo, Department of Media Engineering and Technology 1 Number theory Number

More information

IEEE P1363 / D9 (Draft Version 9). Standard Specifications for Public Key Cryptography

IEEE P1363 / D9 (Draft Version 9). Standard Specifications for Public Key Cryptography IEEE P1363 / D9 (Draft Version 9) Standard Specifications for Public Key Cryptography Annex A (informative) Number-Theoretic Background Copyright 1997,1998,1999 by the Institute of Electrical and Electronics

More information

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

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2000 2013 Contents 9 Introduction to Number Theory 63 9.1 Subgroups

More information

CSC 474 Network Security. Outline. GCD and Euclid s Algorithm. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

CSC 474 Network Security. Outline. GCD and Euclid s Algorithm. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms Computer Science CSC 474 Network Security Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography CSC 474 Dr. Peng Ning 1 Outline GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation

More information

Associative property

Associative property Addition Associative property Closure property Commutative property Composite number Natural numbers (counting numbers) Distributive property for multiplication over addition Divisibility Divisor Factor

More information

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

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. Congruences Let n be a postive integer. The integers a and b are called congruent modulo n if they have the same

More information

A number that can be written as, where p and q are integers and q Number.

A number that can be written as, where p and q are integers and q Number. RATIONAL NUMBERS 1.1 Definition of Rational Numbers: What are rational numbers? A number that can be written as, where p and q are integers and q Number. 0, is known as Rational Example:, 12, -18 etc.

More information

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

CHAPTER 6. Prime Numbers. Definition and Fundamental Results CHAPTER 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results 6.1. Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and the only positive divisors of p are 1 and p. If n

More information

Basic Algorithms in Number Theory

Basic Algorithms in Number Theory Basic Algorithms in Number Theory Algorithmic Complexity... 1 Basic Algorithms in Number Theory Francesco Pappalardi Discrete Logs, Modular Square Roots & Euclidean Algorithm. July 20 th 2010 Basic Algorithms

More information

THESIS. Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University

THESIS. Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University The Hasse-Minkowski Theorem in Two and Three Variables THESIS Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University By

More information

Math 109 HW 9 Solutions

Math 109 HW 9 Solutions Math 109 HW 9 Solutions Problems IV 18. Solve the linear diophantine equation 6m + 10n + 15p = 1 Solution: Let y = 10n + 15p. Since (10, 15) is 5, we must have that y = 5x for some integer x, and (as we

More information

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

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties: Byte multiplication 1 Field arithmetic A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties: F is an abelian group under addition, meaning - F is closed under

More information

LECTURE NOTES IN CRYPTOGRAPHY

LECTURE NOTES IN CRYPTOGRAPHY 1 LECTURE NOTES IN CRYPTOGRAPHY Thomas Johansson 2005/2006 c Thomas Johansson 2006 2 Chapter 1 Abstract algebra and Number theory Before we start the treatment of cryptography we need to review some basic

More information

An Algorithm for Prime Factorization

An Algorithm for Prime Factorization An Algorithm for Prime Factorization Fact: If a is the smallest number > 1 that divides n, then a is prime. Proof: By contradiction. (Left to the reader.) A multiset is like a set, except repetitions are

More information

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

Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example. 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

More information

Math Review. for the Quantitative Reasoning measure of the GRE General Test

Math Review. for the Quantitative Reasoning measure of the GRE General Test Math Review for the Quantitative Reasoning measure of the GRE General Test www.ets.org Overview This Math Review will familiarize you with the mathematical skills and concepts that are important for solving

More information

Algorithmic number theory. Questions/Complaints About Homework? The division algorithm. Division

Algorithmic number theory. Questions/Complaints About Homework? The division algorithm. Division Questions/Complaints About Homework? Here s the procedure for homework questions/complaints: 1. Read the solutions first. 2. Talk to the person who graded it (check initials) 3. If (1) and (2) don t work,

More information

IEEE P1363 / D13 (Draft Version 13). Standard Specifications for Public Key Cryptography

IEEE P1363 / D13 (Draft Version 13). Standard Specifications for Public Key Cryptography IEEE P1363 / D13 (Draft Version 13). Standard Specifications for Public Key Cryptography Annex A (Informative). Number-Theoretic Background. Copyright 1999 by the Institute of Electrical and Electronics

More information

Notes on Systems of Linear Congruences

Notes on Systems of Linear Congruences MATH 324 Summer 2012 Elementary Number Theory Notes on Systems of Linear Congruences In this note we will discuss systems of linear congruences where the moduli are all different. Definition. Given the

More information

REVIEW Chapter 1 The Real Number System

REVIEW Chapter 1 The Real Number System REVIEW Chapter The Real Number System In class work: Complete all statements. Solve all exercises. (Section.4) A set is a collection of objects (elements). The Set of Natural Numbers N N = {,,, 4, 5, }

More information

MAT 243 Test 2 SOLUTIONS, FORM A

MAT 243 Test 2 SOLUTIONS, FORM A MAT Test SOLUTIONS, FORM A 1. [10 points] Give a recursive definition for the set of all ordered pairs of integers (x, y) such that x < y. Solution: Let S be the set described above. Note that if (x, y)

More information

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics:

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics: Executive Assessment Math Review Although the following provides a review of some of the mathematical concepts of arithmetic and algebra, it is not intended to be a textbook. You should use this chapter

More information

Numbers. Çetin Kaya Koç Winter / 18

Numbers. Çetin Kaya Koç   Winter / 18 Çetin Kaya Koç http://koclab.cs.ucsb.edu Winter 2016 1 / 18 Number Systems and Sets We represent the set of integers as Z = {..., 3, 2, 1,0,1,2,3,...} We denote the set of positive integers modulo n as

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 9 September 30, 2015 CPSC 467, Lecture 9 1/47 Fast Exponentiation Algorithms Number Theory Needed for RSA Elementary Number Theory

More information

Homework #2 solutions Due: June 15, 2012

Homework #2 solutions Due: June 15, 2012 All of the following exercises are based on the material in the handout on integers found on the class website. 1. Find d = gcd(475, 385) and express it as a linear combination of 475 and 385. That is

More information

1. Factorization Divisibility in Z.

1. Factorization Divisibility in Z. 8 J. E. CREMONA 1.1. Divisibility in Z. 1. Factorization Definition 1.1.1. Let a, b Z. Then we say that a divides b and write a b if b = ac for some c Z: a b c Z : b = ac. Alternatively, we may say that

More information

Ch 4.2 Divisibility Properties

Ch 4.2 Divisibility Properties Ch 4.2 Divisibility Properties - Prime numbers and composite numbers - Procedure for determining whether or not a positive integer is a prime - GCF: procedure for finding gcf (Euclidean Algorithm) - Definition:

More information

SEVENTH EDITION and EXPANDED SEVENTH EDITION

SEVENTH EDITION and EXPANDED SEVENTH EDITION SEVENTH EDITION and EXPANDED SEVENTH EDITION Slide 5-1 Chapter 5 Number Theory and the Real Number System 5.1 Number Theory Number Theory The study of numbers and their properties. The numbers we use to

More information

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

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time. 8 Modular Arithmetic We introduce an operator mod. Let d be a positive integer. For c a nonnegative integer, the value c mod d is the remainder when c is divided by d. For example, c mod d = 0 if and only

More information

Foundations of Computer Science Lecture 10 Number Theory

Foundations of Computer Science Lecture 10 Number Theory Foundations of Computer Science Lecture 10 Number Theory Division and the Greatest Common Divisor Fundamental Theorem of Arithmetic Cryptography and Modular Arithmetic RSA: Public Key Cryptography Last

More information