MAT 243 Test 2 SOLUTIONS, FORM A

Size: px
Start display at page:

Download "MAT 243 Test 2 SOLUTIONS, FORM A"

Transcription

1 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) S, then there are five neighboring ordered pairs which are also in S: (x + 1, y + 1), (x, y + 1), (x 1, y + 1), (x 1, y), and (x 1, y 1). (If (x, y) = (0, 1), then (x, y 1), (x + 1, y 1) and (x + 1, y) are not in S.) This gives you the recursive part. The next step is to determine which elements of S cannot be obtained from another element in S using the rules above; (0, 1) is one such ordered pair (although there are others). Every ordered pair in S can be reached from (0, 1) by the recursive part, so a description for S is: (1) (0, 1) S. () If (x, y) S, then (x + 1, y + 1), (x, y + 1), (x 1, y + 1), (x 1, y), (x 1, y 1) S. () Finiteness: Every element of S is obtained by applying () a finite number of times. Note that (0, 1) can be replaced with (a, a + 1) for any integer a, and that part () must include (x+1, y+1) and (x 1, y 1) and at least one of the other three points, so other answers were possible. Grading: + points (each) for conditions (1) and (), + points for condition (). Grading for partial credit: + points (total) for not giving a set of ordered pairs.. [10 points] Convert () 10 to base 6. Solution: Repeatedly divide by 6, repeating with the remainder, until the quotient is zero: = = = = Now take the remainders in reverse order, to get (10) 6. Grading: +7 points for the repeated division, + points for putting the remainders together.. [10 points] Convert ( ) to base. Solution: The easiest way to do this is to break up the number into groups of two (since = ), starting from the right, then convert each digit to base : ( so the answer is (00). Grading: +5 points for splitting up the binary number, +5 points for converting each digit. )

2 MAT Test SOLUTIONS, FORM A. [10 points] Find a function g(x) such that (n 5 + log(5 n ))( n + n ) is O(g(n)) and g(x) is as simple and small as possible. Solution: In the first factor, n 5 grows faster than log(5 n ) = n log 5, so the first factor is O(n 5 ). In the second factor, n grows faster than n, so the second factor is O( n ). The product will grow as the product of these two functions, or O(n 5 n ). ) (n 5 + log(5 n ))( + n } n 5 {{ n } n 5 n Grading: Done on a point basis. Grading for common mistakes points for forgetting to multiply n 5 by n ; points for leaving a constant in the answer. 5. [15 points] Use mathematical induction to show that for n 0. Solution: Let P (n) be the predicate n k k = + [n ] n n k k = + [n ] n. To prove P (n) for all n 0, you need to prove two things: First, P (0) is true, because the two sides of the equation are Now, assume that P (m) is true; that is, 0 k k = 0 + [ 0 ] 0 = 0 m k k = + [m ] m. The goal is to prove P (m + 1), which is (m+1) k k = + [(m + 1) ] (m+1). This is done by manipulating the sum, and using the assumption that P (m) is true: m+1 k k = m k k + (m + 1) m+1 = + (m ) m + (m + 1) m+1 = + (m 1) m+1 + (m + 1) m+1 = + (m) m+1 = + [(m + 1) ] m+1. Hence, P (m) does imply P (m + 1). By the principle of mathematical induction, P (n) is true for all nonnegative integers n. Grading: +5 points for checking the initial case, +5 points for setting up the inductive argument, +5 points for doing the algebra.

3 6. Let m = 151 and n = 9. MAT Test SOLUTIONS, FORM A a. [10 points] Use the Euclidean Algorithm to find gcd(m, n). Solution: Use repeated division: 9 = = = The GCD is the last nonzero remainder, which is 117. Graded on a point basis. Grading for common mistakes: +5 points (total) for finding the prime factorization. b. [10 points] Find the Bézout coefficients for m and n; that is, find integers a and b such that am + bn = gcd(m, n). Solution: This builds on your answer to part (a), so fortunately most people got that right. Start off by taking the second equation and solving for 117: 117 = Now take the first equation and solve it for 51, and then substitutate that into the equation right above this text. Thus the coefficients are 9 and. = 151 (9 151) = Grading: + points for solving each equation, and + points for substitution.

4 MAT Test SOLUTIONS, FORM A 7. [15 points] Evaluate the following quantities. a. mod 7 Answer:. b. mod 7 Answer: 5. ( = ) c. (0 mod 1) div (11 mod 6) Solution: This is 7 div 5 = 1. Grading for common mistakes: points for bad division (non-integer answers, etc.) 8. [10 points] Let S be the set of strings defined recursively by (1) λ S; () If x S, then 1x S and x0 S; () Only these strings are in S. Use structural induction to prove that S does not contain any string x in which a 0 occurs to the left of a 1 in x. (Hence, for instance, S.) Solution: A full solution looks like something along these lines: Suppose that x S. If x = λ, then x does not contain a 0 to the left of a 1, because x has no characters. If x = 1y, where y S, then we may assume that y does not contain a 0 to the left of a 1. Now x cannot contain a 0 to the left of a 1, because that 0 would have to be part of the string y, as well as the 1 which is to the right of that 0. Hence, in this case, x does not contain a 0 to the left of a 1. If x = y0, where y S, then we may assume that y does not contain a 0 to the left of a 1. The string x cannot contain a 0 to the left of a 1, because the 1 would have to be part of the string y, as well as the 0 to the left of that 1. Hence, in this case, x does not contain bad, either. Hence, by induction, no element of S contains a 0 to the left of a 1. Grading: + points for the base case, + points for each induction case, + points for the final sentence. Grading for common mistakes: +5 points (total) if several examples were done. 5

5 MAT Test SOLUTIONS, FORM B 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) S, then there are five neighboring ordered pairs which are also in S: (x + 1, y + 1), (x + 1, y), (x + 1, y 1), (x, y 1), and (x 1, y 1). (If (x, y) = (0, 0), then (x 1, y), (x 1, y + 1) and (x, y + 1) are not in S.) This gives you the recursive part. The next step is to determine which elements of S cannot be obtained from another element in S using the rules above; (0, 0) is one such ordered pair (although there are others). Every ordered pair in S can be reached from (0, 0) by the recursive part, so a description for S is: (1) (0, 0) S. () If (x, y) S, then (x + 1, y + 1), (x + 1, y), (x + 1, y 1), (x, y 1), (x 1, y 1) S. () Finiteness: Every element of S is obtained by applying () a finite number of times. Note that (0, 0) can be replaced with (a, a) for any integer a, and that part () must include (x+1, y+1) and (x 1, y 1) and at least one of the other three points, so other answers were possible. Grading: + points (each) for conditions (1) and (), + points for condition (). Grading for partial credit: + points (total) for not giving a set of ordered pairs.. [10 points] Convert () 10 to base 7. Solution: Repeatedly divide by 7, repeating with the remainder, until the quotient is zero: = = = Now take the remainders in reverse order, to get (65) 7. Grading: +7 points for the repeated division, + points for putting the remainders together.. [10 points] Convert ( ) to base 8. Solution: The easiest way to do this is to break up the number into groups of three (since = 8), starting from the right, then convert each digit to base 8: ( so the answer is (16061) 8. Grading: +5 points for splitting up the binary number, +5 points for converting each digit. )

6 MAT Test SOLUTIONS, FORM B. [10 points] Find a function g(x) such that (n + log(n + 1))(n! + n ) is O(g(n)) and g(x) is as simple and small as possible. Solution: In the first factor, n grows faster than log(n + 1), so the first factor is O(n ). In the second factor, n! grows faster than n, so the second factor is O(n!). The product will grow as the product of these two functions, or O(n n!). (n + log(n + 1) )(n! + n ) n n! n n! Grading: Done on a point basis. Grading for common mistakes: points for forgetting to multiply n by n!; points for leaving a constant in the answer. 5. [15 points] Use mathematical induction to show that n k k = [ n + ] n for n 0. Solution: Let P (n) be the predicate n k k = + [ n you need to prove two things: First, P (0) is true, because the two sides of the equation are 0 k k = 0 [ 0 + ] 0 = 0 Now, assume that P (m) is true; that is, m k k = [ m + ] m. The goal is to prove P (m + 1), which is (m+1) k k = + [ (m + 1) ] n. To prove P (n) for all n 0, ] (m+1). This is done by manipulating the sum, and using the assumption that P (m) is true: m+1 m k k = k k + (m + 1) m+1 = [ m + ] m + (m + 1) m+1 = [ m + 1 ] m+1 + (m + 1) m+1 = [ m + + ] m+1 = [ m ] m+1 = [ (m + 1) + ] m+1. Hence, P (m) does imply P (m + 1). By the principle of mathematical induction, P (n) is true for all nonnegative integers n. Grading: +5 points for checking the initial case, +5 points for setting up the inductive argument, +5 points for doing the algebra.

7 6. Let m = 1 and n = 105. MAT Test SOLUTIONS, FORM B a. [10 points] Use the Euclidean Algorithm to find gcd(m, n). Solution: Use repeated division: 105 = = = The GCD is the last nonzero remainder, which is 57. Graded on a point basis. Grading for common mistakes: +5 points (total) for finding the prime factorization. b. [10 points] Find the Bézout coefficients for m and n; that is, find integers a and b such that am + bn = gcd(m, n). Solution: This builds on your answer to part (a), so fortunately most people got that right. Start off by taking the second equation and solving for 57: 57 = 1 71 Now take the first equation and solve it for 71, and then substitutate that into the equation right above this text. Thus the coefficients are 1 and. = 1 (105 1) = Grading: + points for solving each equation, and + points for substitution.

8 MAT Test SOLUTIONS, FORM B 7. [15 points] Evaluate the following quantities. a. 5 mod Answer: 1 b. 5 mod Answer:. ( 5 = 7 +.) c. ( mod 1) div (17 mod 6) Solution: This equals 11 div 5 =. Grading for common mistakes: points for bad division (non-integer answers, etc.) 8. [10 points] Let S be the set of strings defined recursively by (1) λ S; () If x S, then 0x S and x1 S; () Only these strings are in S. Use structural induction to prove that S does not contain any string x in which a 0 occurs to the right of a 1 in x. (Hence, for instance, S.) Solution: A full solution looks like something along these lines: Suppose that x S. If x = λ, then x does not contain a 0 to the right of a 1, because x has no characters. If x = 0y, where y S, then we may assume that y does not contain a 0 to the right of a 1. Now x cannot contain a 0 to the right of a 1, because that 1 would have to be part of the string y, as well as the 0 which is to the right of that 1. Hence, in this case, x does not contain a 0 to the right of a 1. If x = y1, where y S, then we may assume that y does not contain a 0 to the right of a 1. The string x cannot contain a 0 to the right of a 1, because the 0 would have to be part of the string y, as well as the 1 to the left of that 0. Hence, in this case, x does not contain bad, either. Hence, by induction, no element of S contains a 0 to the right of a 1. Grading: + points for the base case, + points for each induction case, + points for the final sentence. Grading for common mistakes: +5 points (total) if several examples were done. 5

MAT 243 Test 2 SOLUTIONS, FORM A

MAT 243 Test 2 SOLUTIONS, FORM A MAT 24 Test 2 SOLUTIONS, FORM A 1. [1 points] Prove the following using Mathematical Induction. L 2 i = L n L n+1 + 2 where L is the Lucas sequence: L 0 = 2 L 1 = 1 L n = L n 1 + L n 2, n 2 Solution: Let

More information

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Copyright Cengage Learning. All rights reserved. SECTION 5.4 Strong Mathematical Induction and the Well-Ordering Principle for the Integers Copyright

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

Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z:

Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z: Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some z Z Notation: b Fact: for all, b, c Z:, 1, and 0 0 = 0 b and b c = c b and c = (b + c) b and b = ±b 1

More information

Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018

Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018 The principle of mathematical induction is a useful tool for proving that a certain predicate is true for all natural numbers. It cannot be used to discover theorems, but only to prove them. If we have

More information

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points Introduction to Discrete Mathematics 3450:208 Test 1 1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : The inverse of E : The

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

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4 Do the following exercises from the text: Chapter (Section 3):, 1, 17(a)-(b), 3 Prove that 1 3 + 3 + + n 3 n (n + 1) for all n N Proof The proof is by induction on n For n N, let S(n) be the statement

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

MTH 310, Section 001 Abstract Algebra I and Number Theory. Sample Midterm 1

MTH 310, Section 001 Abstract Algebra I and Number Theory. Sample Midterm 1 MTH 310, Section 001 Abstract Algebra I and Number Theory Sample Midterm 1 Instructions: You have 50 minutes to complete the exam. There are five problems, worth a total of fifty points. You may not use

More information

then the hard copy will not be correct whenever your instructor modifies the assignments.

then the hard copy will not be correct whenever your instructor modifies the assignments. Assignments for Math 2030 then the hard copy will not be correct whenever your instructor modifies the assignments. exams, but working through the problems is a good way to prepare for the exams. It is

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

CS1800: Mathematical Induction. Professor Kevin Gold

CS1800: Mathematical Induction. Professor Kevin Gold CS1800: Mathematical Induction Professor Kevin Gold Induction: Used to Prove Patterns Just Keep Going For an algorithm, we may want to prove that it just keeps working, no matter how big the input size

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

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

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

Definition For a set F, a polynomial over F with variable x is of the form *6. Polynomials Definition For a set F, a polynomial over F with variable x is of the form a n x n + a n 1 x n 1 + a n 2 x n 2 +... + a 1 x + a 0, where a n, a n 1,..., a 1, a 0 F. The a i, 0 i n are the

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

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

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

Try the assignment f(1) = 2; f(2) = 1; f(3) = 4; f(4) = 3;.

Try the assignment f(1) = 2; f(2) = 1; f(3) = 4; f(4) = 3;. I. Precisely complete the following definitions: 1. A natural number n is composite whenever... See class notes for the precise definitions 2. Fix n in N. The number s(n) represents... 3. For A and B sets,

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

Chapter 1. Greatest common divisor. 1.1 The division theorem. In the beginning, there are the natural numbers 0, 1, 2, 3, 4,...,

Chapter 1. Greatest common divisor. 1.1 The division theorem. In the beginning, there are the natural numbers 0, 1, 2, 3, 4,..., Chapter 1 Greatest common divisor 1.1 The division theorem In the beginning, there are the natural numbers 0, 1, 2, 3, 4,..., which constitute the set N. Addition and multiplication are binary operations

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

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

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

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points. Math 152, Problem Set 2 solutions (2018-01-24) All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points. 1. Let us look at the following equation: x 5 1

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

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

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

Number Theory Proof Portfolio

Number Theory Proof Portfolio Number Theory Proof Portfolio Jordan Rock May 12, 2015 This portfolio is a collection of Number Theory proofs and problems done by Jordan Rock in the Spring of 2014. The problems are organized first by

More information

Algebra for error control codes

Algebra for error control codes 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

More information

Input Decidable Language -- Program Halts on all Input Encoding of Input -- Natural Numbers Encoded in Binary or Decimal, Not Unary

Input Decidable Language -- Program Halts on all Input Encoding of Input -- Natural Numbers Encoded in Binary or Decimal, Not Unary Complexity Analysis Complexity Theory Input Decidable Language -- Program Halts on all Input Encoding of Input -- Natural Numbers Encoded in Binary or Decimal, Not Unary Output TRUE or FALSE Time and Space

More information

Name CMSC203 Fall2008 Exam 2 Solution Key Show All Work!!! Page (16 points) Circle T if the corresponding statement is True or F if it is False.

Name CMSC203 Fall2008 Exam 2 Solution Key Show All Work!!! Page (16 points) Circle T if the corresponding statement is True or F if it is False. Name CMSC203 Fall2008 Exam 2 Solution Key Show All Work!!! Page ( points) Circle T if the corresponding statement is True or F if it is False T F GCD(,0) = 0 T F For every recursive algorithm, there is

More information

Number theory (Chapter 4)

Number theory (Chapter 4) EECS 203 Spring 2016 Lecture 10 Page 1 of 8 Number theory (Chapter 4) Review Questions: 1. Does 5 1? Does 1 5? 2. Does (129+63) mod 10 = (129 mod 10)+(63 mod 10)? 3. Does (129+63) mod 10 = ((129 mod 10)+(63

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

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

Discrete Math in Computer Science Solutions to Practice Problems for Midterm 2

Discrete Math in Computer Science Solutions to Practice Problems for Midterm 2 Discrete Math in Computer Science Solutions to Practice Problems for Midterm 2 CS 30, Fall 2018 by Professor Prasad Jayanti Problems 1. Let g(0) = 2, g(1) = 1, and g(n) = 2g(n 1) + g(n 2) whenever n 2.

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 8 February 1, 2012 CPSC 467b, Lecture 8 1/42 Number Theory Needed for RSA Z n : The integers mod n Modular arithmetic GCD Relatively

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

Proof Techniques (Review of Math 271)

Proof Techniques (Review of Math 271) Chapter 2 Proof Techniques (Review of Math 271) 2.1 Overview This chapter reviews proof techniques that were probably introduced in Math 271 and that may also have been used in a different way in Phil

More information

A Few Examples of Limit Proofs

A Few Examples of Limit Proofs A Few Examples of Limit Proofs x (7x 4) = 10 SCRATCH WORK First, we need to find a way of relating x < δ and (7x 4) 10 < ɛ. We will use algebraic manipulation to get this relationship. Remember that the

More information

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction. Statements Compounds and Truth Tables. Statements, Negations, Compounds, Conjunctions, Disjunctions, Truth Tables, Logical Equivalence, De Morgan s Law, Tautology, Contradictions, Proofs with Logical Equivalent

More information

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

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635 COMP239: Mathematics for Computer Science II Prof. Chadi Assi assi@ciise.concordia.ca EV7.635 The Euclidean Algorithm The Euclidean Algorithm Finding the GCD of two numbers using prime factorization is

More information

4. Number Theory (Part 2)

4. Number Theory (Part 2) 4. Number Theory (Part 2) Terence Sim Mathematics is the queen of the sciences and number theory is the queen of mathematics. Reading Sections 4.8, 5.2 5.4 of Epp. Carl Friedrich Gauss, 1777 1855 4.3.

More information

STEP Support Programme. Hints and Partial Solutions for Assignment 17

STEP Support Programme. Hints and Partial Solutions for Assignment 17 STEP Support Programme Hints and Partial Solutions for Assignment 7 Warm-up You need to be quite careful with these proofs to ensure that you are not assuming something that should not be assumed. For

More information

1. Introduction to commutative rings and fields

1. Introduction to commutative rings and fields 1. Introduction to commutative rings and fields Very informally speaking, a commutative ring is a set in which we can add, subtract and multiply elements so that the usual laws hold. A field is a commutative

More information

Solutions to Assignment 1

Solutions to Assignment 1 Solutions to Assignment 1 Question 1. [Exercises 1.1, # 6] Use the division algorithm to prove that every odd integer is either of the form 4k + 1 or of the form 4k + 3 for some integer k. For each positive

More information

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24 Direct Proof MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Direct Proof Fall 2014 1 / 24 Outline 1 Overview of Proof 2 Theorems 3 Definitions 4 Direct Proof 5 Using

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

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

CPSC 518 Introduction to Computer Algebra Asymptotically Fast Integer Multiplication

CPSC 518 Introduction to Computer Algebra Asymptotically Fast Integer Multiplication CPSC 518 Introduction to Computer Algebra Asymptotically Fast Integer Multiplication 1 Introduction We have now seen that the Fast Fourier Transform can be applied to perform polynomial multiplication

More information

. As the binomial coefficients are integers we have that. 2 n(n 1).

. As the binomial coefficients are integers we have that. 2 n(n 1). Math 580 Homework. 1. Divisibility. Definition 1. Let a, b be integers with a 0. Then b divides b iff there is an integer k such that b = ka. In the case we write a b. In this case we also say a is a factor

More information

Divisibility. Chapter Divisors and Residues

Divisibility. Chapter Divisors and Residues Chapter 1 Divisibility Number theory is concerned with the properties of the integers. By the word integers we mean the counting numbers 1, 2, 3,..., together with their negatives and zero. Accordingly

More information

Standard forms for writing numbers

Standard forms for writing numbers Standard forms for writing numbers In order to relate the abstract mathematical descriptions of familiar number systems to the everyday descriptions of numbers by decimal expansions and similar means,

More information

Divisibility = 16, = 9, = 2, = 5. (Negative!)

Divisibility = 16, = 9, = 2, = 5. (Negative!) Divisibility 1-17-2018 You probably know that division can be defined in terms of multiplication. If m and n are integers, m divides n if n = mk for some integer k. In this section, I ll look at properties

More information

Number Theory and the abc Conjecture

Number Theory and the abc Conjecture Number Theory is the study of integers. Common topics include prime numbers, divisors and multiples, modular arithmetic, and Diophantine equations (equations in which we re looking for integer solutions).

More information

#26: Number Theory, Part I: Divisibility

#26: Number Theory, Part I: Divisibility #26: Number Theory, Part I: Divisibility and Primality April 25, 2009 This week, we will spend some time studying the basics of number theory, which is essentially the study of the natural numbers (0,

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

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

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications n-bit unsigned integer representation Represent integer x as sum of powers of 2: If x = n 1 i=0 b i 2 i where each b i

More information

THE DIVISION THEOREM IN Z AND F [T ]

THE DIVISION THEOREM IN Z AND F [T ] THE DIVISION THEOREM IN Z AND F [T ] KEITH CONRAD 1. Introduction In the integers we can carry out a process of division with remainder, as follows. Theorem 1.1. For any integers a and b, with b 0 there

More information

CSE 311: Foundations of Computing. Lecture 12: Two s Complement, Primes, GCD

CSE 311: Foundations of Computing. Lecture 12: Two s Complement, Primes, GCD CSE 311: Foundations of Computing Lecture 12: Two s Complement, Primes, GCD n-bit Unsigned Integer Representation Represent integer as sum of powers of 2: If 2 where each {0,1} then representation is b

More information

NAME (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt):

NAME (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt): Math 55 Final Exam May 2004 NAME ( pt): TA ( pt): Name of Neighbor to your left ( pt): Name of Neighbor to your right ( pt): Instructions: This is a closed book, closed notes, closed calculator, closed

More information

*EXAM 1 Answer key* EECS 203 Spring 2016

*EXAM 1 Answer key* EECS 203 Spring 2016 *EXAM 1 Answer key* EECS 203 Spring 2016 Name (Print): Key uniqname (Print): Key Instructions. You have 110 minutes to complete this exam. You may have one page of notes (8.5x11.5 two-sided) but may not

More information

Solutions to Problem Set 4 - Fall 2008 Due Tuesday, Oct. 7 at 1:00

Solutions to Problem Set 4 - Fall 2008 Due Tuesday, Oct. 7 at 1:00 Solutions to 8.78 Problem Set 4 - Fall 008 Due Tuesday, Oct. 7 at :00. (a Prove that for any arithmetic functions f, f(d = f ( n d. To show the relation, we only have to show this equality of sets: {d

More information

Four Basic Sets. Divisors

Four Basic Sets. Divisors Four Basic Sets Z = the integers Q = the rationals R = the real numbers C = the complex numbers Divisors Definition. Suppose a 0 and b = ax, where a, b, and x are integers. Then we say a divides b (or

More information

CPSC 518 Introduction to Computer Algebra Schönhage and Strassen s Algorithm for Integer Multiplication

CPSC 518 Introduction to Computer Algebra Schönhage and Strassen s Algorithm for Integer Multiplication CPSC 518 Introduction to Computer Algebra Schönhage and Strassen s Algorithm for Integer Multiplication March, 2006 1 Introduction We have now seen that the Fast Fourier Transform can be applied to perform

More information

Number theory (Chapter 4)

Number theory (Chapter 4) EECS 203 Spring 2016 Lecture 12 Page 1 of 8 Number theory (Chapter 4) Review Compute 6 11 mod 13 in an efficient way What is the prime factorization of 100? 138? What is gcd(100, 138)? What is lcm(100,138)?

More information

2 Elementary number theory

2 Elementary number theory 2 Elementary number theory 2.1 Introduction Elementary number theory is concerned with properties of the integers. Hence we shall be interested in the following sets: The set if integers {... 2, 1,0,1,2,3,...},

More information

CS2800 Questions selected for fall 2017

CS2800 Questions selected for fall 2017 Discrete Structures Final exam sample questions Solutions CS2800 Questions selected for fall 2017 1. Determine the prime factorizations, greatest common divisor, and least common multiple of the following

More information

22. The Quadratic Sieve and Elliptic Curves. 22.a The Quadratic Sieve

22. The Quadratic Sieve and Elliptic Curves. 22.a The Quadratic Sieve 22. The Quadratic Sieve and Elliptic Curves 22.a The Quadratic Sieve Sieve methods for finding primes or for finding factors of numbers are methods by which you take a set P of prime numbers one by one,

More information

a = qb + r where 0 r < b. Proof. We first prove this result under the additional assumption that b > 0 is a natural number. Let

a = qb + r where 0 r < b. Proof. We first prove this result under the additional assumption that b > 0 is a natural number. Let 2. Induction and the division algorithm The main method to prove results about the natural numbers is to use induction. We recall some of the details and at the same time present the material in a different

More information

Introduction to Number Theory. The study of the integers

Introduction to Number Theory. The study of the integers Introduction to Number Theory The study of the integers of Integers, The set of integers = {... 3, 2, 1, 0, 1, 2, 3,...}. In this lecture, if nothing is said about a variable, it is an integer. Def. We

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

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

Solving recurrences. Frequently showing up when analysing divide&conquer algorithms or, more generally, recursive algorithms.

Solving recurrences. Frequently showing up when analysing divide&conquer algorithms or, more generally, recursive algorithms. Solving recurrences Frequently showing up when analysing divide&conquer algorithms or, more generally, recursive algorithms Example: Merge-Sort(A, p, r) 1: if p < r then 2: q (p + r)/2 3: Merge-Sort(A,

More information

1. Introduction to commutative rings and fields

1. Introduction to commutative rings and fields 1. Introduction to commutative rings and fields Very informally speaking, a commutative ring is a set in which we can add, subtract and multiply elements so that the usual laws hold. A field is a commutative

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

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

Solutions to MAT 117 Test #3

Solutions to MAT 117 Test #3 Solutions to MAT 7 Test #3 Because there are two versions of the test, solutions will only be given for Form C. Differences from the Form D version will be given. (The values for Form C appear above those

More information

Fall 2015 Lecture 14: Modular congruences. cse 311: foundations of computing

Fall 2015 Lecture 14: Modular congruences. cse 311: foundations of computing Fall 2015 Lecture 14: Modular congruences cse 311: foundations of computing If a and b are positive integers, then gcd a, b = gcd (b, a mod b) Useful GCD Fact Proof: By definition a = a div b b + (a mod

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

The Chinese Remainder Theorem

The Chinese Remainder Theorem The Chinese Remainder Theorem Kyle Miller Feb 13, 2017 The Chinese Remainder Theorem says that systems of congruences always have a solution (assuming pairwise coprime moduli): Theorem 1 Let n, m N with

More information

Solutions to Practice Final

Solutions to Practice Final s to Practice Final 1. (a) What is φ(0 100 ) where φ is Euler s φ-function? (b) Find an integer x such that 140x 1 (mod 01). Hint: gcd(140, 01) = 7. (a) φ(0 100 ) = φ(4 100 5 100 ) = φ( 00 5 100 ) = (

More information

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2 Contents 1 Recommended Reading 1 2 Public Key/Private Key Cryptography 1 2.1 Overview............................................. 1 2.2 RSA Algorithm.......................................... 2 3 A Number

More information

DIVISIBILITY AND GREATEST COMMON DIVISORS

DIVISIBILITY AND GREATEST COMMON DIVISORS DIVISIBILITY AND GREATEST COMMON DIVISORS KEITH CONRAD 1 Introduction We will begin with a review of divisibility among integers, mostly to set some notation and to indicate its properties Then we will

More information

Continuing discussion of CRC s, especially looking at two-bit errors

Continuing discussion of CRC s, especially looking at two-bit errors Continuing discussion of CRC s, especially looking at two-bit errors The definition of primitive binary polynomials Brute force checking for primitivity A theorem giving a better test for primitivity Fast

More information

CS280, Spring 2004: Prelim Solutions

CS280, Spring 2004: Prelim Solutions CS280, Spring 2004: Prelim Solutions 1. [3 points] What is the transitive closure of the relation {(1, 2), (2, 3), (3, 1), (3, 4)}? Solution: It is {(1, 2), (2, 3), (3, 1), (3, 4), (1, 1), (2, 2), (3,

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

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

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 #2-b - Euclidean Algorithm. September 2 nd 2015 SEAMS School 2015 Number Theory and

More information

Math 412, Introduction to abstract algebra. Overview of algebra.

Math 412, Introduction to abstract algebra. Overview of algebra. Math 412, Introduction to abstract algebra. Overview of algebra. A study of algebraic objects and functions between them; an algebraic object is typically a set with one or more operations which satisfies

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

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

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

Homework 7 solutions M328K by Mark Lindberg/Marie-Amelie Lawn

Homework 7 solutions M328K by Mark Lindberg/Marie-Amelie Lawn Homework 7 solutions M328K by Mark Lindberg/Marie-Amelie Lawn Problem 1: 4.4 # 2:x 3 + 8x 2 x 1 0 (mod 1331). a) x 3 + 8x 2 x 1 0 (mod 11). This does not break down, so trial and error gives: x = 0 : f(0)

More information

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5 CS 70 Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5 Modular Arithmetic In several settings, such as error-correcting codes and cryptography, we sometimes wish to work over a

More information

Number Theory Solutions Packet

Number Theory Solutions Packet Number Theory Solutions Pacet 1 There exist two distinct positive integers, both of which are divisors of 10 10, with sum equal to 157 What are they? Solution Suppose 157 = x + y for x and y divisors of

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

Big , and Definition Definition

Big , and Definition Definition Big O, Ω, and Θ Big-O gives us only a one-way comparison; if f is O(g) then g eventually is bigger than f from that point on, but in fact f could be very small in comparison. Example; 3n is O(2 2n ). We

More information