CSE 20: Discrete Mathematics

Size: px
Start display at page:

Download "CSE 20: Discrete Mathematics"

Transcription

1 Spring 2018

2 Summary So far: Today: Logic and proofs Divisibility, modular arithmetics Number Systems More logic definitions and proofs Reading: All of Chap. 1 + Chap 4.1, 4.2.

3 Divisibility P = 5 divides 30 Q = 8 divides 10 R = 4 divides 2 Questions: Propositions P,Q,R are (A) T,T,T; (B) T,F,F; (C) F,T,F; (D) F,F,F

4 Divisibility P = 5 divides 30 Q = 8 divides 10 R = 4 divides 2 Questions: Propositions P,Q,R are (A) T,T,T; (B) T,F,F; (C) F,T,F; (D) F,F,F Definition An integer a divides an integer b (written a b), if there is an integer c such that (A) a = b c; (B) a b = c; (C) b/a = c; (D) b = a c;

5 Divisibility P = 5 divides 30 Q = 8 divides 10 R = 4 divides 2 Questions: Propositions P,Q,R are (A) T,T,T; (B) T,F,F; (C) F,T,F; (D) F,F,F Definition An integer a divides an integer b (written a b), if there is an integer c such that (A) a = b c; (B) a b = c; (C) b/a = c; (D) b = a c; Answer (D): (a b) c.b = a c. We also say that b is a multiple of a.

6 Transitivity Definition A binary relation R(x, y) is transitive if x, y, z.r(x, y) R(y, z) R(x, z). Questions: Is relation D(a, b) = (a b) transitive? (A) Yes; (B) No; (C) I don t know

7 Transitivity Definition A binary relation R(x, y) is transitive if x, y, z.r(x, y) R(y, z) R(x, z). Questions: Is relation D(a, b) = (a b) transitive? (A) Yes; (B) No; (C) I don t know Yes, it is transitive. In English: If x divides y, and y divides z, then x divides z.

8 Proving Transitivity of Theorem The divisibility relation D(a, b) = (a b) is transitive.

9 Proving Transitivity of Theorem The divisibility relation D(a, b) = (a b) is transitive. Proof We want to prove that for all integers a, b, c, if (x y) and (y z), then (x z). Let x, y, z be arbitrary integers Assume that (x y) and (y z). By definition, there exist an integer c such that y = cx an integer d such that z = dy It follows that there exists an integer b = dc such that So, x z. z = dy = d(cx) = (dc)x = bx.

10 Congruence Definition Two integers a, b are congruent modulo an integer m (written a m b) if m divides (a b). (a m b) m (a b) q.q m = a b Question: For what values of m 1 is the relation m transitive? (A) all m > 1; (B) all m 1; (C) all even m; (D) only for m = 2

11 Transitivity of m Theorem: For any integers a, b, c and positive integer m, if a m b and b m c, then a m c. Proof:

12 Transitivity of m Theorem: For any integers a, b, c and positive integer m, if a m b and b m c, then a m c. Proof: 1. Let m, a, b, c be arbitrary integers, with m Assume a m b and b m c 3. By definition, there exist integers x, y such that mx = a b and my = b c 4. Adding up the last two equations gives mx + my = (a b) + (b c) = a c 5. Therefore, mz = a c for z = x + y. 6. This proves that a m c

13 Division Theorem Theorem (Division Theorem) For any integer a and positive integer b > 0 there exists a (unique) pair of integers (q, r) such that a = qb + r and 0 r < b. Vocabulary: a: dividend; b: divisor; q: quotient; r: reminder.

14 Division Theorem Theorem (Division Theorem) For any integer a and positive integer b > 0 there exists a (unique) pair of integers (q, r) such that a = qb + r and 0 r < b. Vocabulary: a: dividend; b: divisor; q: quotient; r: reminder. Question: What is the result (q, r) of division with remainder of a = 24 by b = 7? (A) q = 3, r = 5; (B) q = 4, r = 4; (C) q = 2, r = 3; (D) q = 3, r = 3

15 Uniqueness A new quantifier: There exists a unique x such that P(x) Think of P as an equation. A solution to P(x) is a value of x such that P(x) is true. What we are saying is that P(x) has precisely one solution Sometimes this is denoted!x.p(x) Can we express!x.p(x) using the standard quantifiers?

16 Uniqueness A new quantifier: There exists a unique x such that P(x) Think of P as an equation. A solution to P(x) is a value of x such that P(x) is true. What we are saying is that P(x) has precisely one solution Sometimes this is denoted!x.p(x) Can we express!x.p(x) using the standard quantifiers? x.(p(x) U(x)) where U(x) = P(x) has no other solution beside x U(x) = y.(p(y) (x = y))!x.p(x) x.(p(x) y.(p(y) (x = y))).

17 Proving Uniqueness Theorem The result (q, r) of division with remainder is unique Proof Let a, b be arbitrary integers, with b > 0, and let (q, r) be a solution of the division with remainder of a, b. Let (q, r ) be another solution. We need to prove that (q, r) = (q, r ). By definition, qb + r = q b + r = a and 0 r, r < b.

18 Proving Uniqueness Theorem The result (q, r) of division with remainder is unique Proof Let a, b be arbitrary integers, with b > 0, and let (q, r) be a solution of the division with remainder of a, b. Let (q, r ) be another solution. We need to prove that (q, r) = (q, r ). By definition, qb + r = q b + r = a and 0 r, r < b. Therefore (q q )b = r r, and r r < b.

19 Proving Uniqueness Theorem The result (q, r) of division with remainder is unique Proof Let a, b be arbitrary integers, with b > 0, and let (q, r) be a solution of the division with remainder of a, b. Let (q, r ) be another solution. We need to prove that (q, r) = (q, r ). By definition, qb + r = q b + r = a and 0 r, r < b. Therefore (q q )b = r r, and r r < b. We first prove that q = q.

20 Proving Uniqueness Theorem The result (q, r) of division with remainder is unique Proof Let a, b be arbitrary integers, with b > 0, and let (q, r) be a solution of the division with remainder of a, b. Let (q, r ) be another solution. We need to prove that (q, r) = (q, r ). By definition, qb + r = q b + r = a and 0 r, r < b. Therefore (q q )b = r r, and r r < b. We first prove that q = q. Assume for contradiction that q q

21 Proving Uniqueness Theorem The result (q, r) of division with remainder is unique Proof Let a, b be arbitrary integers, with b > 0, and let (q, r) be a solution of the division with remainder of a, b. Let (q, r ) be another solution. We need to prove that (q, r) = (q, r ). By definition, qb + r = q b + r = a and 0 r, r < b. Therefore (q q )b = r r, and r r < b. We first prove that q = q. Assume for contradiction that q q Then r r = q q b b, contradicting r r < b.

22 Proving Uniqueness Theorem The result (q, r) of division with remainder is unique Proof Let a, b be arbitrary integers, with b > 0, and let (q, r) be a solution of the division with remainder of a, b. Let (q, r ) be another solution. We need to prove that (q, r) = (q, r ). By definition, qb + r = q b + r = a and 0 r, r < b. Therefore (q q )b = r r, and r r < b. We first prove that q = q. Assume for contradiction that q q Then r r = q q b b, contradicting r r < b. Since q = q, we also have r r = (q q )b = 0.

23 Proving Uniqueness Theorem The result (q, r) of division with remainder is unique Proof Let a, b be arbitrary integers, with b > 0, and let (q, r) be a solution of the division with remainder of a, b. Let (q, r ) be another solution. We need to prove that (q, r) = (q, r ). By definition, qb + r = q b + r = a and 0 r, r < b. Therefore (q q )b = r r, and r r < b. We first prove that q = q. Assume for contradiction that q q Then r r = q q b b, contradicting r r < b. Since q = q, we also have r r = (q q )b = 0. This proves that r = r and (q, r ) = (q, r) is unique.

24 Division Theorem (Application 1) Let (q, r) the result of the division with remainder of a by m. The uniqueness part of the theorem tell us that (q, r) are well defined We may think of divrem(a,b) = (q,r) as an algorithm In may applications we are interested only in r = a mod m. (a%m in some programming languages.) Theorem: For any integers a, b and positive integer m (modulus), a m b if and only if (a mod m) = (b mod m). Applications: Hashing, modular arithmetics, cryptography. 64-bit computer: Each 64-bit register stores a value between 0 and m = All arithmetic operations are defined modulo m = 2 64

25 Division Theorem (Application 2) Every integer is either even or odd, but not both. Theorem: n.e(n) O(n). Proof: 1. Let n be an arbitrary integer 2. Divide n by 2. By the division theorem, there are integers (q, r) such that n = 2q + r and 0 r < 2 3. So, it must be r = 0 or r = If r = 0, then n = 2q, and n is even. 5. If r = 1, then n = 2q + 1, and n is odd. 6. n cannot be simultaneously even and odd because (q, r) is unique.

26 Modular Addition Theorem: If a 1 m b 1 and a 2 m b 2, then (a 1 + a 2 ) m (b 1 + b 2 ). Corollary: (a 1 + a 2 ) mod m = ((a 1 mod m) + (a 2 mod m)) mod m We can define a modular addition operation a + m b = (a + b) mod m, which operates on numbers a, b in Z m = {0,..., m 1}.

27 Modular Addition Theorem: If a 1 m b 1 and a 2 m b 2, then (a 1 + a 2 ) m (b 1 + b 2 ). Corollary: (a 1 + a 2 ) mod m = ((a 1 mod m) + (a 2 mod m)) mod m We can define a modular addition operation a + m b = (a + b) mod m, which operates on numbers a, b in Z m = {0,..., m 1}. Special case for m = 2: Z 2 = {0, 1} a mod 2 = 0 Even(a) a mod 2 = 1 Odd(a) Addition Table: a + 2 b b=0 b=1 a=0 0 1 a=1 1 0 Familiar rules: even +even = even even + odd = odd odd+odd = even

28 Modular Multiplication Theorem: If a 1 m b 1 and a 2 m b 2, then (a 1 a 2 ) m (b 1 b 2 ). Corollary: (a 1 a 2 ) mod m = ((a 1 mod m) (a 2 mod m)) mod m We can define a modular multiplication operation a m b = (a b) mod m, which operates on numbers a, b in Z m = {0,..., m 1}.

29 Modular Multiplication Theorem: If a 1 m b 1 and a 2 m b 2, then (a 1 a 2 ) m (b 1 b 2 ). Corollary: (a 1 a 2 ) mod m = ((a 1 mod m) (a 2 mod m)) mod m We can define a modular multiplication operation a m b = (a b) mod m, which operates on numbers a, b in Z m = {0,..., m 1}. Special case for m = 2: Z 2 = {0, 1} a mod 2 = 0 Even(a) a mod 2 = 1 Odd(a) Addition Table: a 2 b b=0 b=1 a=0 0 0 a=1 0 1 Familiar rules: even times even = even even times odd = even odd times odd = odd

30 Decimal notation Standard decimal notation: 1832 = Every positive integer can be written (uniquely) as a sequence of digits n = c k c k 1... c 1 c 0 where each c i is one of 0, 1,..., 9. n = k i=0 10 i c i = c c c c k c k where 0 c i < 10.

31 Decimal notation Standard decimal notation: 1832 = Every positive integer can be written (uniquely) as a sequence of digits n = c k c k 1... c 1 c 0 where each c i is one of 0, 1,..., 9. n = k i=0 10 i c i = c c c c k c k where 0 c i < 10. What is the last digit c 0 of n? (A) n mod 10 ; (B) n/10; (C) n 10; (D) I don t know.

32 Decimal notation Standard decimal notation: 1832 = Every positive integer can be written (uniquely) as a sequence of digits n = c k c k 1... c 1 c 0 where each c i is one of 0, 1,..., 9. n = k i=0 10 i c i = c c c c k c k where 0 c i < 10. What is the last digit c 0 of n? (A) n mod 10 ; (B) n/10; (C) n 10; (D) I don t know. For any integer n, the integer n (n mod 10) is always (A) positive; (B) a multiple of 10; (C) less than 10 (D) none.

33 Decimal notation If c k c k 1..., c 1, c 0 is the decimal representation of n. Then, the number represented by the digits c k c k 1..., c 2, c 1 equals (A) n (n mod 10); (B) n 10; (C) (n (n mod 10))/10; (D) n mod 10

34 Decimal notation If c k c k 1..., c 1, c 0 is the decimal representation of n. Then, the number represented by the digits c k c k 1..., c 2, c 1 equals (A) n (n mod 10); (B) n 10; (C) (n (n mod 10))/10; (D) n mod 10 So, the digits of a number n can be recovered as follows: 1. c 0 = (n mod 10) 2. c 1 = ((n c 0 )/10) mod c 2 = ((n c 0 10c 1 )/100) mod 10

35 Number systems Everything applies to numbers written in other bases b > 1: n = i bi c i Binary numbers: b = 2. n = i 2i c i Convert the number 134 to binary notation: (A) ; (B) ; (C) ; (D) none

36 Other common bases Hexadecimal numbers: b = 16. Digits: 0,1,2,3,4,5,6,7,8,9,A= 10,B= 11,C= 12,D= 13,E= 14,F= 15 Octal: b = 8. Digits: 0,1,2,3,4,5,6,7 Convert between binary and hexadecimal. (Octal is similar.) Binary Hexadecimal Binary Hexadecimal A B C D E F

37 Addition with binary numbers Can you add 53 and 73? (A) 134; (B) 126; (C) Please, we are not in elementary school...

38 Addition with binary numbers Can you add 53 and 73? (A) 134; (B) 126; (C) Please, we are not in elementary school in binary? (53) 10 = (110101) 2 (73) 10 = ( ) =???

39 Addition with binary numbers Can you add 53 and 73? (A) 134; (B) 126; (C) Please, we are not in elementary school in binary? (53) 10 = (110101) 2 (73) 10 = ( ) =??? ( ) 2 = (???) 10 (A) 135; (B) 126; (C) 118; (D) 134

40 Multiplication with binary numbers Can you multiply - (53) 10 = (110101) 2 - (73) 10 = ( ) 2

41 Multiplication with binary numbers Can you multiply - (53) 10 = (110101) 2 - (73) 10 = ( ) =??? = = = =

42 Multiplication with binary numbers Can you multiply - (53) 10 = (110101) 2 - (73) 10 = ( ) =??? = = = = = ( ) = =??? (A) ; (B) ; (C) ; (D)

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

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri MATH 1101 haalshehri@ksu.edu.sa 1 Introduction To Number Systems First Section: Binary System Second Section: Octal Number System Third Section: Hexadecimal System 2 Binary System 3 Binary System The binary

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

Conversions between Decimal and Binary

Conversions between Decimal and Binary Conversions between Decimal and Binary Binary to Decimal Technique - use the definition of a number in a positional number system with base 2 - evaluate the definition formula ( the formula ) using decimal

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Today's learning goals Determine whether a relation is an equivalence relation by determining whether it is Reflexive Symmetric

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

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

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

CHAPTER 3. Congruences. Congruence: definitions and properties

CHAPTER 3. Congruences. Congruence: definitions and properties CHAPTER 3 Congruences Part V of PJE Congruence: definitions and properties Definition. (PJE definition 19.1.1) Let m > 0 be an integer. Integers a and b are congruent modulo m if m divides a b. We write

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

Mathematical Foundations of Cryptography

Mathematical Foundations of Cryptography Mathematical Foundations of Cryptography Cryptography is based on mathematics In this chapter we study finite fields, the basis of the Advanced Encryption Standard (AES) and elliptical curve cryptography

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Determine whether a relation is an equivalence relation by determining whether it is Reflexive Symmetric

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH There are 10 types of people in the world: those who understand binary and those who don't. Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Define the

More information

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank University of Florida Dept. of Computer & Information Science & Engineering COT 3100 Applications of Discrete Structures Dr. Michael P. Frank Slides for a Course Based on the Text Discrete Mathematics

More information

NUMBERS AND CODES CHAPTER Numbers

NUMBERS AND CODES CHAPTER Numbers CHAPTER 2 NUMBERS AND CODES 2.1 Numbers When a number such as 101 is given, it is impossible to determine its numerical value. Some may say it is five. Others may say it is one hundred and one. Could it

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

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

Integers and Division

Integers and Division Integers and Division Notations Z: set of integers N : set of natural numbers R: set of real numbers Z + : set of positive integers Some elements of number theory are needed in: Data structures, Random

More information

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 9.1 Chapter 9 Objectives

More information

Part V. Chapter 19. Congruence of integers

Part V. Chapter 19. Congruence of integers Part V. Chapter 19. Congruence of integers Congruence modulo m Let m be a positive integer. Definition. Integers a and b are congruent modulo m if and only if a b is divisible by m. For example, 1. 277

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

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

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

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory. CSS322: Security and Cryptography Sirindhorn International Institute of Technology Thammasat University Prepared by Steven Gordon on 29 December 2011 CSS322Y11S2L06, Steve/Courses/2011/S2/CSS322/Lectures/number.tex,

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

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

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases Lecture 2. The Euclidean Algorithm and Numbers in Other Bases At the end of Lecture 1, we gave formulas for the greatest common divisor GCD (a, b), and the least common multiple LCM (a, b) of two integers

More information

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5) CSE 54 Discrete Mathematics & Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices Integers & Algorithms (Section 2.5) by Kenneth H. Rosen, Discrete Mathematics & its Applications,

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

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques Colin Stirling Informatics Some slides based on ones by Myrto Arapinis Colin Stirling (Informatics) Discrete Mathematics

More information

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

COMPUTER ARITHMETIC. 13/05/2010 cryptography - math background pp. 1 / 162 COMPUTER ARITHMETIC 13/05/2010 cryptography - math background pp. 1 / 162 RECALL OF COMPUTER ARITHMETIC computers implement some types of arithmetic for instance, addition, subtratction, multiplication

More information

Today. Polynomials. Secret Sharing.

Today. Polynomials. Secret Sharing. Today. Polynomials. Secret Sharing. A secret! I have a secret! A number from 0 to 10. What is it? Any one of you knows nothing! Any two of you can figure it out! Example Applications: Nuclear launch: need

More information

4. Congruence Classes

4. Congruence Classes 4 Congruence Classes Definition (p21) The congruence class mod m of a Z is Example With m = 3 we have Theorem For a b Z Proof p22 = {b Z : b a mod m} [0] 3 = { 6 3 0 3 6 } [1] 3 = { 2 1 4 7 } [2] 3 = {

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

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

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

Polynomials. Chapter 4

Polynomials. Chapter 4 Chapter 4 Polynomials In this Chapter we shall see that everything we did with integers in the last Chapter we can also do with polynomials. Fix a field F (e.g. F = Q, R, C or Z/(p) for a prime p). Notation

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

7.2 Applications of Euler s and Fermat s Theorem.

7.2 Applications of Euler s and Fermat s Theorem. 7.2 Applications of Euler s and Fermat s Theorem. i) Finding and using inverses. From Fermat s Little Theorem we see that if p is prime and p a then a p 1 1 mod p, or equivalently a p 2 a 1 mod p. This

More information

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic CSE 20 Discrete Math Algebraic Rules for Propositional Formulas Equivalences between propositional formulas (similar to algebraic equivalences): Associative Summer, 2006 July 11 (Day 2) Number Systems/Computer

More information

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

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, } Integers and Division 1 The Integers and Division This area of discrete mathematics belongs to the area of Number Theory. Some applications of the concepts in this section include generating pseudorandom

More information

Chapter 5. Number Theory. 5.1 Base b representations

Chapter 5. Number Theory. 5.1 Base b representations Chapter 5 Number Theory The material in this chapter offers a small glimpse of why a lot of facts that you ve probably nown and used for a long time are true. It also offers some exposure to generalization,

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

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

7. Prime Numbers Part VI of PJE

7. Prime Numbers Part VI of PJE 7. Prime Numbers Part VI of PJE 7.1 Definition (p.277) A positive integer n is prime when n > 1 and the only divisors are ±1 and +n. That is D (n) = { n 1 1 n}. Otherwise n > 1 is said to be composite.

More information

For your quiz in recitation this week, refer to these exercise generators:

For your quiz in recitation this week, refer to these exercise generators: Monday, Oct 29 Today we will talk about inverses in modular arithmetic, and the use of inverses to solve linear congruences. For your quiz in recitation this week, refer to these exercise generators: GCD

More information

SEVENTH EDITION and EXPANDED SEVENTH EDITION

SEVENTH EDITION and EXPANDED SEVENTH EDITION SEVENTH EDITION and EXPANDED SEVENTH EDITION Slide 10-1 Chapter 10 Mathematical Systems 10.1 Groups Definitions A mathematical system consists of a set of elements and at least one binary operation. A

More information

MAT246H1S - Concepts In Abstract Mathematics. Solutions to Term Test 1 - February 1, 2018

MAT246H1S - Concepts In Abstract Mathematics. Solutions to Term Test 1 - February 1, 2018 MAT246H1S - Concepts In Abstract Mathematics Solutions to Term Test 1 - February 1, 2018 Time allotted: 110 minutes. Aids permitted: None. Comments: Statements of Definitions, Principles or Theorems should

More information

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

Linear Cyclic Codes. Polynomial Word 1 + x + x x 4 + x 5 + x x + x f(x) = q(x)h(x) + r(x), Coding Theory Massoud Malek Linear Cyclic Codes Polynomial and Words A polynomial of degree n over IK is a polynomial p(x) = a 0 + a 1 + + a n 1 x n 1 + a n x n, where the coefficients a 1, a 2,, a n are

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

Mathematical Induction

Mathematical Induction Mathematical Induction Representation of integers Mathematical Induction Reading (Epp s textbook) 5.1 5.3 1 Representations of Integers Let b be a positive integer greater than 1. Then if n is a positive

More information

hexadecimal-to-decimal conversion

hexadecimal-to-decimal conversion OTHER NUMBER SYSTEMS: octal (digits 0 to 7) group three binary numbers together and represent as base 8 3564 10 = 110 111 101 100 2 = (6X8 3 ) + (7X8 2 ) + (5X8 1 ) + (4X8 0 ) = 6754 8 hexadecimal (digits

More information

Algorithms: Review from last time

Algorithms: Review from last time EECS 203 Spring 2016 Lecture 9 Page 1 of 9 Algorithms: Review from last time 1. For what values of C and k (if any) is it the case that x 2 =O(100x 2 +4)? 2. For what values of C and k (if any) is it the

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

MATH Fundamental Concepts of Algebra

MATH Fundamental Concepts of Algebra MATH 4001 Fundamental Concepts of Algebra Instructor: Darci L. Kracht Kent State University April, 015 0 Introduction We will begin our study of mathematics this semester with the familiar notion of even

More information

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors Math.3336: Discrete Mathematics Primes and Greatest Common Divisors Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu

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

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

We say that the base of the decimal number system is ten, represented by the symbol

We say that the base of the decimal number system is ten, represented by the symbol Introduction to counting and positional notation. In the decimal number system, a typical number, N, looks like... d 3 d 2 d 1 d 0.d -1 d -2 d -3... [N1] where the ellipsis at each end indicates that there

More information

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 8

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 8 CS 70 Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 8 Polynomials Polynomials constitute a rich class of functions which are both easy to describe and widely applicable in

More information

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

Linear Cyclic Codes. Polynomial Word 1 + x + x x 4 + x 5 + x x + x Coding Theory Massoud Malek Linear Cyclic Codes Polynomial and Words A polynomial of degree n over IK is a polynomial p(x) = a 0 + a 1 x + + a n 1 x n 1 + a n x n, where the coefficients a 0, a 1, a 2,,

More information

The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.

The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem. CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 10 The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.

More information

Ch 7 Summary - POLYNOMIAL FUNCTIONS

Ch 7 Summary - POLYNOMIAL FUNCTIONS Ch 7 Summary - POLYNOMIAL FUNCTIONS 1. An open-top box is to be made by cutting congruent squares of side length x from the corners of a 8.5- by 11-inch sheet of cardboard and bending up the sides. a)

More information

Chapter 1 : The language of mathematics.

Chapter 1 : The language of mathematics. MAT 200, Logic, Language and Proof, Fall 2015 Summary Chapter 1 : The language of mathematics. Definition. A proposition is a sentence which is either true or false. Truth table for the connective or :

More information

Lecture 6: Introducing Complexity

Lecture 6: Introducing Complexity COMP26120: Algorithms and Imperative Programming Lecture 6: Introducing Complexity Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2015 16 You need this book: Make sure you use the up-to-date

More information

Chapter 3: Polynomial and Rational Functions

Chapter 3: Polynomial and Rational Functions Chapter 3: Polynomial and Rational Functions 3.1 Polynomial Functions and Their Graphs A polynomial function of degree n is a function of the form P (x) = a n x n + a n 1 x n 1 + + a 1 x + a 0 The numbers

More information

Encryption: The RSA Public Key Cipher

Encryption: The RSA Public Key Cipher Encryption: The RSA Public Key Cipher Michael Brockway March 5, 2018 Overview Transport-layer security employs an asymmetric public cryptosystem to allow two parties (usually a client application and a

More information

CHAPTER 2 NUMBER SYSTEMS

CHAPTER 2 NUMBER SYSTEMS CHAPTER 2 NUMBER SYSTEMS The Decimal Number System : We begin our study of the number systems with the familiar decimal number system. The decimal system contains ten unique symbol 0, 1, 2, 3, 4, 5, 6,

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

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST JAMES MCIVOR Today we enter Chapter 2, which is the heart of this subject. Before starting, recall that last time we saw the integers have unique factorization

More information

Discrete Mathematics GCD, LCM, RSA Algorithm

Discrete Mathematics GCD, LCM, RSA Algorithm Discrete Mathematics GCD, LCM, RSA Algorithm Abdul Hameed http://informationtechnology.pk/pucit abdul.hameed@pucit.edu.pk Lecture 16 Greatest Common Divisor 2 Greatest common divisor The greatest common

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

ENGIN 112 Intro to Electrical and Computer Engineering

ENGIN 112 Intro to Electrical and Computer Engineering ENGIN 112 Intro to Electrical and Computer Engineering Lecture 2 Number Systems Russell Tessier KEB 309 G tessier@ecs.umass.edu Overview The design of computers It all starts with numbers Building circuits

More information

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 7

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 7 EECS 70 Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 7 Polynomials Polynomials constitute a rich class of functions which are both easy to describe and widely applicable in topics

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

University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura. February 9, :30 pm Duration: 1:50 hs. Closed book, no calculators

University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura. February 9, :30 pm Duration: 1:50 hs. Closed book, no calculators University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura February 9, 2010 11:30 pm Duration: 1:50 hs Closed book, no calculators Last name: First name: Student number: There are 5 questions and

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

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

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6 Math 131 notes Jason Riedy 6 October, 2008 Contents 1 Modular arithmetic 2 2 Divisibility rules 3 3 Greatest common divisor 4 4 Least common multiple 4 5 Euclidean GCD algorithm 5 6 Linear Diophantine

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

a the relation arb is defined if and only if = 2 k, k

a the relation arb is defined if and only if = 2 k, k DISCRETE MATHEMATICS Past Paper Questions in Number Theory 1. Prove that 3k + 2 and 5k + 3, k are relatively prime. (Total 6 marks) 2. (a) Given that the integers m and n are such that 3 (m 2 + n 2 ),

More information

Notes on arithmetic. 1. Representation in base B

Notes on arithmetic. 1. Representation in base B Notes on arithmetic The Babylonians that is to say, the people that inhabited what is now southern Iraq for reasons not entirely clear to us, ued base 60 in scientific calculation. This offers us an excuse

More information

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Numbering Systems Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Addition & Subtraction using Octal & Hexadecimal 2 s Complement, Subtraction Using 2 s Complement.

More information

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen In this section you will apply the method of long division to divide a polynomial by a binomial. You will also learn to

More information

Solving the general quadratic congruence. y 2 Δ (mod p),

Solving the general quadratic congruence. y 2 Δ (mod p), Quadratic Congruences Solving the general quadratic congruence ax 2 +bx + c 0 (mod p) for an odd prime p (with (a, p) = 1) is equivalent to solving the simpler congruence y 2 Δ (mod p), where Δ = b 2 4ac

More information

Computer Architecture 10. Residue Number Systems

Computer Architecture 10. Residue Number Systems Computer Architecture 10 Residue Number Systems Ma d e wi t h Op e n Of f i c e. o r g 1 A Puzzle What number has the reminders 2, 3 and 2 when divided by the numbers 7, 5 and 3? x mod 7 = 2 x mod 5 =

More information

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013 Fall 2013 Student Responsibilities Reading: Textbook, Section 3.7, 4.1, & 5.2 Assignments: Sections 3.6, 3.7, 4.1 Proof Worksheets Attendance: Strongly Encouraged Overview 3.6 Integers and Algorithms 3.7

More information

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by

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

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH There are 10 types of people in the world: those who understand binary and those who don't. Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Today's learning goals Define

More information

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively 6 Prime Numbers Part VI of PJE 6.1 Fundamental Results Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively D (p) = { p 1 1 p}. Otherwise

More information

Fault Tolerance & Reliability CDA Chapter 2 Cyclic Polynomial Codes

Fault Tolerance & Reliability CDA Chapter 2 Cyclic Polynomial Codes Fault Tolerance & Reliability CDA 5140 Chapter 2 Cyclic Polynomial Codes - cylic code: special type of parity check code such that every cyclic shift of codeword is a codeword - for example, if (c n-1,

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

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd() Student Responsibilities Week 8 Mat 2345 Week 8 Reading: Textbook, Section 3.7, 4.1, & 5.2 Assignments: Sections 3.6, 3.7, 4.1 Induction Proof Worksheets Attendance: Strongly Encouraged Fall 2013 Week

More information

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers:

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers: WORKSHEET MATH 215, FALL 15, WHYTE We begin our course with the natural numbers: N = {1, 2, 3,...} which are a subset of the integers: Z = {..., 2, 1, 0, 1, 2, 3,... } We will assume familiarity with their

More information

Math 13, Spring 2013, Lecture B: Midterm

Math 13, Spring 2013, Lecture B: Midterm Math 13, Spring 2013, Lecture B: Midterm Name Signature UCI ID # E-mail address Each numbered problem is worth 12 points, for a total of 84 points. Present your work, especially proofs, as clearly as possible.

More information

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

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers Number Theory: Applications Number Theory Applications Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Results from Number Theory have many applications

More information

cse 311: foundations of computing Fall 2015 Lecture 11: Modular arithmetic and applications

cse 311: foundations of computing Fall 2015 Lecture 11: Modular arithmetic and applications cse 311: foundations of computing Fall 2015 Lecture 11: Modular arithmetic and applications arithmetic mod 7 a + 7 b = (a + b) mod 7 a 7 b = (a b) mod 7 5 6 0 1 2 4 3 + 0 1 2 3 4 5 6 0 0 1 2 3 4 5 6 1

More information

M381 Number Theory 2004 Page 1

M381 Number Theory 2004 Page 1 M81 Number Theory 2004 Page 1 [[ Comments are written like this. Please send me (dave@wildd.freeserve.co.uk) details of any errors you find or suggestions for improvements. ]] Question 1 20 = 2 * 10 +

More information

Long division for integers

Long division for integers Feasting on Leftovers January 2011 Summary notes on decimal representation of rational numbers Long division for integers Contents 1. Terminology 2. Description of division algorithm for integers (optional

More information

10 Problem 1. The following assertions may be true or false, depending on the choice of the integers a, b 0. a "

10 Problem 1. The following assertions may be true or false, depending on the choice of the integers a, b 0. a Math 4161 Dr. Franz Rothe December 9, 2013 13FALL\4161_fall13f.tex Name: Use the back pages for extra space Final 70 70 Problem 1. The following assertions may be true or false, depending on the choice

More information