University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura. March 1, :00 pm Duration: 1:15 hs

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

MACM 101 Discrete Mathematics I. Exercises on Predicates and Quantifiers. Due: Tuesday, October 13th (at the beginning of the class)

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Discrete Mathematics Logics and Proofs. Liangfeng Zhang School of Information Science and Technology ShanghaiTech University

Discrete Mathematics Recitation Course 張玟翔

Predicate Logic. Andreas Klappenecker

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

2. Use quantifiers to express the associative law for multiplication of real numbers.

CSE Discrete Structures

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Mathematical Reasoning Rules of Inference & Mathematical Induction. 1. Assign propositional variables to the component propositional argument.

Logic Overview, I. and T T T T F F F T F F F F

MAT 243 Test 1 SOLUTIONS, FORM A

Intro to Logic and Proofs

Mat 243 Exam 1 Review

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

Math 3336: Discrete Mathematics Practice Problems for Exam I

University of Illinois at Chicago Department of Computer Science. Final Examination. CS 151 Mathematical Foundations of Computer Science Fall 2012

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

Chapter 3. The Logic of Quantified Statements

CSE Discrete Structures

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

Proofs. Introduction II. Notes. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

1 Predicates and Quantifiers

Section 1.1 Propositions

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

Discrete Mathematics and Probability Theory Summer 2014 James Cook Midterm 1

For all For every For each For any There exists at least one There exists There is Some

Do not start until you are given the green signal

Inference and Proofs (1.6 & 1.7)

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

Discrete Structures for Computer Science

Name: Mathematics 1C03

Propositional Logic Not Enough

Chapter 2: The Logic of Quantified Statements

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

Chapter 1 Elementary Logic

Review: Potential stumbling blocks

Supplementary Logic Notes CSE 321 Winter 2009

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Section Summary. Section 1.5 9/9/2014

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Introduction to Sets and Logic (MATH 1190)

1 The Foundation: Logic and Proofs

CSE 20 DISCRETE MATH. Winter

First order Logic ( Predicate Logic) and Methods of Proof

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

Full file at Chapter 1

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

Rules of Inference. Arguments and Validity

2-4: The Use of Quantifiers

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

Math 55 Homework 2 solutions

Solutions to Exercises (Sections )

1 The Foundation: Logic and Proofs

Proofs. Chapter 2 P P Q Q

Practice Midterm Exam Solutions

CSE 20 DISCRETE MATH. Fall

Readings: Conjecture. Theorem. Rosen Section 1.5

Rules Build Arguments Rules Building Arguments

Formal (Natural) Deduction for Predicate Calculus

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Discrete Mathematics and Probability Theory Summer 2014 James Cook Midterm 1 (Version B)

Rosen, Discrete Mathematics and Its Applications, 6th edition Extra Examples

Midterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

A Guide to Proof-Writing

CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati

Predicate Logic. Example. Statements in Predicate Logic. Some statements cannot be expressed in propositional logic, such as: Predicate Logic

DISCRETE MATH: LECTURE Chapter 3.3 Statements with Multiple Quantifiers If you want to establish the truth of a statement of the form

What is the decimal (base 10) representation of the binary number ? Show your work and place your final answer in the box.

1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n).

Mathacle. PSet ---- Algebra, Logic. Level Number Name: Date: I. BASICS OF PROPOSITIONAL LOGIC

Denote John by j and Smith by s, is a bachelor by predicate letter B. The statements (1) and (2) may be written as B(j) and B(s).

At least one of us is a knave. What are A and B?

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

Proof Terminology. Technique #1: Direct Proof. Learning objectives. Proof Techniques (Rosen, Sections ) Direct Proof:

Contradiction MATH Contradiction. Benjamin V.C. Collins, James A. Swenson MATH 2730

CPSC 121: Models of Computation

Test 1 Solutions(COT3100) (1) Prove that the following Absorption Law is correct. I.e, prove this is a tautology:

Midterm 1. Total. CS70 Discrete Mathematics and Probability Theory, Spring :00-9:00pm, 1 March. Instructions:

Simple Math: Cryptography

Section A (not in the text) Which of the following are statements? Explain. 3. The President of the United States in 2089 will be a woman.

Transparencies to accompany Rosen, Discrete Mathematics and Its Applications Section 1.3. Section 1.3 Predicates and Quantifiers

PREDICATE LOGIC. Schaum's outline chapter 4 Rosen chapter 1. September 11, ioc.pdf

ECOM Discrete Mathematics

Recitation 4: Quantifiers and basic proofs

Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here.

Proofs. Chapter 2 P P Q Q

Argument. whenever all the assumptions are true, then the conclusion is true. If today is Wednesday, then yesterday is Tuesday. Today is Wednesday.

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

1.3 Predicates and Quantifiers

Mathematics 220 Midterm Practice problems from old exams Page 1 of 8

A. Propositional Logic

Transcription:

University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura March 1, 2012 1:00 pm Duration: 1:15 hs Closed book, no calculators THIS MIDTERM AND ITS SOLUTION IS SUBJECT TO COPYRIGHT; NO PARTS OF THIS DOCUMENT CAN BE PUBLISHED OR DISTRIBUTED WITHOUT THE AUTHOR S CONSENT. Last name: First name: Student number: There are 4 questions and 100 marks total. This exam paper should have 9 pages, including this cover page. 1 Predicate logic / 30 2 Inference rules / 20 3 Proof Methods / 20 4 Number Theory / 30 Total / 100

CSI 2101 Midterm Test, March 1, 2012 Page 2 of 9 1 Predicate logic 30 points Part A 12 points Circle true or false n m(n m = 0), where the domain is the set of natural numbers. [true] [false] n m(n m = 0), where the domain is the set of natural numbers. [true] [false] The following are logically equivalent: (p q) and (p q) [true] [false] The following are logically equivalent: x Q(x) and x Q(x) [true] [false] The following are logically equivalent: x yp (x, y) and x y P (x, y) [true] [false] Consider the universe of discourse to be the set {1, 2, 3}, and Q(x, y) = y x. Then y xq(x, y) is true. [true] [false] Part B 18 points Assume the universe of discourse to be all people, and the following statements: D(x) : x is a duck. O(x) : x is an officer. W (x) : x is willing to waltz. Translate each of the following phrases using quantifiers, logical connectives and D(x), O(x) and W (x). phrase in English logical statement 1. No ducks are willing to waltz. (D(x) W (x)) x(d(x) W (x)) 2. No officers ever decline to waltz. (O(x) W (x)) x(o(x) W (x)) 3. Ducks are not officers. x(d(x) O(x)) For each of the English phrases above, write its negation in English. Then, translate each of the negated English phrases into predicate logic; make sure the logical statement you write has the connectives applied to individual propositional functions only (D(x), O(x) or W (x)), that is, no connective is outside quantifiers or outside expressions involving other connectives. negated English prases logical statement 1. Some ducks are willing to waltz. x(d(x) W (x)) 2. Some officers decline to waltz. x(o(x) W (x)) 3. Some ducks are officers. x(d(x) O(x))

CSI 2101 Midterm Test, March 1, 2012 Page 3 of 9 2 Inference rules 20 points Part A 10 points Use a formal proof and rules of inference to show that if the premises x(p (x) (Q(x) S(x))) and x(p (x) R(x)) are true, then the conclusion x(r(x) S(x)) is true. Formal Proof: Step Reason 1. x(p (x) R(x) hypothesis 2. P (a) R(a) for arbitrary a universal instantiation of 2 3. P (a) simplification of 2 4. R(a) simplification of 2 5. x(p (x) (Q(x) S(x)) hypothesis 6. P (a) (Q(a) S(a)) universal instantionation of 5 7.Q(a) S(a) modus ponens of 3 and 6 8. S(a) simplification of 7 9. R(a) S(a) conjunction of 4 and 8 10. x(r(x) S(x)) universal generalization of 9

CSI 2101 Midterm Test, March 1, 2012 Page 4 of 9 Part B 10 points Determine if the argument is correct or not using the steps below. The premises: Every person attends a school that is not expensive or lives in a basement. Every person is smart or attends an expensive school. yield the conclusion that Each person is smart or lives in a basement. (4 points) Define the required predicates needed in the next part to express the premises and conclusions in predicate logic. E(x): x attends an expensive school. B(x): x lives in a basement. S(x): x is smart. (4 points) Write the rule that expresses that the premises lead to the conclusion. That is, express the premises and conclusions in predicate logic in the format of a rule of inference. x( E(x) B(x)) x(s(x) E(x)) x(s(x) B(x)) (2 points) Is the argument above correct? Yes. It can be derived from the application of universal instantiation, rule of resolution, followed by universal generalization.

CSI 2101 Midterm Test, March 1, 2012 Page 5 of 9 3 Proof Methods 20 points Part A 10 points Use a proof by contraposition to prove the following theorem. Let a, b, c be positive integers. If n = abc then a 3 n or b 3 n or c 3 n. Proof by contraposition: Assume a > 3 n, b > 3 n and c > 3 n. (this is the negation of a 3 n or b 3 n or c 3 n). So abc > 3 n 3 n 3 n = n. Thus abc n. (this is the negation of n = abc).

CSI 2101 Midterm Test, March 1, 2012 Page 6 of 9 Part B 10 points Prove the following: For any integer number n, if 3n 3 + 5 is odd then n is even. using B1 (5 points) a proof by contraposition. Assume n is odd, i.e. there exists an integer k such that n = 2k + 1. So, 3n 3 + 5 = 3(2k + 1) 3 + 5 = 3 [ (2k) 3 + 3(2k) 2 + 3(2k) + 1 3] + 5 = 2(3(2 2 k 3 ) + 3 2 2k 2 + 3 2 k + 4). So, there exists k = 3(2 2 k 3 ) + 3 2 2k 2 + 3 2 k + 4, such that 3n 3 + 5 = 2k. Therefore, 3n 3 + 5 is even. B2 (5 points) a proof by contradiction. Assume 3n 3 + 5 is odd and n is odd. (note that the negation of n(p (n) Q(n) is equivalent to n(p (n) Q(n))) So n = 2k + 1 for some integer k. Similarly to part a, we derive: 3n 3 + 5 = 3(2k + 1) 3 + 5 = 3 [ (2k) 3 + 3(2k) 2 + 3(2k) + 1 3] + 5 = 2(3(2 2 k 3 ) + 3 2 2k 2 + 3 2 k + 4). So, there exists k = 3(2 2 k 3 ) + 3 2 2k 2 + 3 2 k + 4, such that 3n 3 + 5 = 2k. The hypothesis that 3n 3 + 5 is odd also gives us 3n 3 + 5 = 2k + 1, for some integer k. So, 3n 3 + 5 = 2k = 2k + 1, which implies 1 = 2(k k ), where k, k are integers. Thus, 2 divides 1 (or equivalently 1 is even), which is a contradiction.

CSI 2101 Midterm Test, March 1, 2012 Page 7 of 9 4 Number Theory 30 points Part A 10 points system of congruences: Use the Chinese Remainder Theorem to find all solutions to he x 2 (mod 3) x 1 (mod 4) x 3 (mod 5) M 1 = m 2 m 3 = 20, y 1 is the inverse of 20 mod 3, which is the same as the inverse of 2 mod 3, so y 1 = 2. M 2 = m 1 m 3 = 15, y 2 is the inverse of 15 mod 4, which is the same as the inverse of 3 mod 4, so y 2 = 3. M 3 = m 1 m 2 = 12, y 3 is the inverse of 12 mod 5, which is the same as the inverse of 2 mod 5, so y 3 = 3. x a 1 M 1 y 1 + a 2 M 2 y 2 + a 3 M 3 y 3 (mod 60) 2 20 2 + 1 15 3 + 3 12 3 (mod 60) 233 53 (mod 60) So the solutions to the system of congruences are: x = 53 + 60k, for all integers k.

CSI 2101 Midterm Test, March 1, 2012 Page 8 of 9 Part B 10 points Prove the following result. Let m 1, m 2,..., m n be pairwise relatively prime integers greater than equal to 2, and let m = m 1 m 2 m n. Show that if a b (mod m i ) for all 1 i n then a b (mod m). Note: do not use the Chinese Remainder Theorem because its proof makes use of this result. Proof 1: We will use the following claim: If x c and y c and gcd(x, y) = 1 then xy c. Proof the the claim: y c implies there exists an integer k such that c = ky. So, x ky. By Lemma A seen in class, since gcd(x, y) = 1 we conclude x k, or in other words k = dx for some integer d. So, c = ky = dxy. Therefore xy c. So the claim is proven. Now, since a b (mod m i ), for all 1 i n, we know that m i (a b), for all 1 i n. Applying the claim above iteratively for c = (a b), we conclude successively that m 1 m 2 (a b), (m 1 m 2 )m 3 (a b),...,(m 1 m 2 m n 1 )m n (a b). Thus m (a b), which implies a b (mod m). Proof 2 (alternative): Consider the unique prime factorization of each of m 1, m 2,..., m n, say m i = p e i,1 i,1 pe i,2 i,2 pe i,s i i,s i Since m i (a b) then each p e i,1 i,1, pe i,2 i,2,..., pe i,s i i,s i for all 1 i n. appears in the prime factorization of (a b), Since gcd(m j, m k ) = 1, for all 1 j, k n, j k, we know that all the p i,l are distinct of each other. So p e 1,1 1,1, p e 1,2 1,2,..., p e 1,s 1 1,s 1, p e 2,1 2,1, p e 2,2 2,2,..., p e 2,s 2 2,s 2,..., p e n,1 n,1, p e n,2 n,2,..., p en,sn n,s n are all distinct prime powers that appear in the prime factorization of (a b). Thus, (a b) = (p e 1,1 1,1 p e 1,2 1,2... p e 1,s 1 1,s 1 p e 2,1 2,1 p e 2,2 2,2..., p e 2,s 2 2,s 2..., p e n,1 n,1 p e n,2 n,2..., p en,sn n,s n )x for some integer x, or equivalently (a b) = (m 1 m 2 m n )x = mx. Therefore, m (a b), which implies a b(modm).

CSI 2101 Midterm Test, March 1, 2012 Page 9 of 9 Part C 10 points RSA Consider the RSA cryptosystem with p = 17, q = 19 and e = 7. Bob calculates n = p q = 17 19 = 323, and publishes his public key (n = 323, e = 7). (a) (3 marks) How does Bob calculate his private key? Please, simply state what needs to be calculated. Answer: Bob s private key consists of a pair (n = 323, d) where d is the inverse of e (mod (p 1)(q 1)), i.e. the inverse of 7 (mod 288). (b) (3 marks) Perform the necessary calculations and compute the private key. Answer: Using the extended Euclidean algorithm, we get 288 = 41 7 + 1 and then gcd(288, 7) = 1 = 288 41 7. So d 41 247 (mod 288). Bob s private key is (n = 323, d = 247) (c) (4 marks) State encoding and decoding equations. Explain how to encode the plaintext given as the number 99 and how to decode the ciphertext given as the number 101. You do not need to do any calculations; just state the equations for these particular plaintext and ciphertext. Answer: E(99) = 99 7 (mod 323) D(101) = 101 247 (mod 323)... End Of Midterm Test