CSE Discrete Structures

Similar documents
CSE Discrete Structures

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

Predicate Logic. Andreas Klappenecker

Section 1.1 Propositions

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

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

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

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

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

Readings: Conjecture. Theorem. Rosen Section 1.5

DISCRETE MATH: FINAL REVIEW

Chapter 1 Elementary Logic

1 The Foundation: Logic and Proofs

1 The Foundation: Logic and Proofs

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

CITS2211 Discrete Structures Proofs

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

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

software design & management Gachon University Chulyun Kim

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

Supplementary Logic Notes CSE 321 Winter 2009

Proofs. Chapter 2 P P Q Q

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

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

Rules Build Arguments Rules Building Arguments

Math 3336: Discrete Mathematics Practice Problems for Exam I

Chapter 2: The Logic of Quantified Statements

Section 1.2: Propositional Logic

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

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

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).

MAT 243 Test 1 SOLUTIONS, FORM A

STRATEGIES OF PROBLEM SOLVING

CPSC 121: Models of Computation

2-4: The Use of Quantifiers

Chapter 3. The Logic of Quantified Statements

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Proofs. Chapter 2 P P Q Q

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

Predicate Logic - Deductive Systems

Logic, Sets, and Proofs

CSE 20. Final Review. CSE 20: Final Review

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

ECOM Discrete Mathematics

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

A. Propositional Logic

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

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

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Intro to Logic and Proofs

9/5/17. Fermat s last theorem. CS 220: Discrete Structures and their Applications. Proofs sections in zybooks. Proofs.

Notes from How to Prove it: A Structured Approach by Daniel J. Velleman

CS 214 Introduction to Discrete Structures. Chapter 1 Formal Logic. Mikel D. Petty, Ph.D.

Logic for Computer Scientists

Logic for Computer Scientists

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

Discrete Mathematics

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

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

Full file at

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

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

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

Outline. Rules of Inferences Discrete Mathematics I MATH/COSC 1056E. Example: Existence of Superman. Outline

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

CSE 20 DISCRETE MATH. Winter

Name: ID# (last 4 digits): PIN: CSE Discrete Structures

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

Computer Science 280 Spring 2002 Homework 2 Solutions by Omar Nayeem

Solutions to Exercises (Sections )

Chapter 4, Logic using Propositional Calculus Handout

CS0441 Discrete Structures Recitation 3. Xiang Xiao

First order Logic ( Predicate Logic) and Methods of Proof

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

CSE 20 DISCRETE MATH. Fall

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

1 Introduction to Predicate Resolution

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

1.1 Language and Logic

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

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

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

Foundations of Mathematics Worksheet 2

Logic for Computer Scientists

1.1 Statements and Compound Statements

The Foundations: Logic and Proofs. Chapter 1, Part III: Proofs

Logic and Proof. Aiichiro Nakano

CSE 1400 Applied Discrete Mathematics Proofs

Propositional Logic: Syntax

Manual of Logical Style

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

The Logic of Compound Statements cont.

PROBLEM SET 3: PROOF TECHNIQUES

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

CSE 20 DISCRETE MATH WINTER

CSE 20 DISCRETE MATH SPRING

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Transcription:

CSE 2315 - Discrete Structures Homework 2- Fall 2010 Due Date: Oct. 7 2010, 3:30 pm Proofs using Predicate Logic For all your predicate logic proofs you can use only the rules given in the following tables. In addition you are allowed to apply the deduction method and to use the method of temporary hypotheses. All other rules have to be proven first. Equivalence Rules Rule Name Expression Equivalent Expression Commutativity (comm) P Q Q P P Q Q P Associativity (ass) (P Q) R P (Q R) (P Q) R P (Q R) Distributivity (dis) (P Q) R (P R) (Q R) (P Q) R (P R) (Q R) De Morgan s Laws (De Morgan) (P Q) P Q (P Q) P Q Implication (imp) P Q P Q Double negation (dn) (P ) P Self-reference (self) P P P Negation (neg) ( x)p (x) ( x)p (x) 2010 Manfred Huber Page 1

Inference Rules Rule Name From Can Derive Conjunction (con) P, Q P Q Simplification (sim) P Q P, Q Modus ponens (mp) P, P Q Q Modus tollens (mt) P Q, Q P Addition (add) P P Q Universal instantiation (ui) ( x)p (x) P (y) (Be careful with the rule s restrictions) ( x)p (x) P (a) Existential Instantiation (ei) ( x)p (x) P (y) (Be careful with the rule s restrictions) ( x)p (x) P (a) Universal generalization (ug) P (x) ( x)p (x) (Be careful with the rule s restrictions) Existential generalization (eg) P (x) ( x)p (x) (Be careful with the rule s restrictions) P (a) ( x)p (x) For all proofs the steps have to be annotated such as to indicate the rule and which elements of the proof sequence it was applied to. 1. For each instantiation and generalization step in the following proof sequences indicate if it is legal. You have to justify your decision (a short justification is sufficient). a) 1. ( x)r(x) hyp 2. ( x)( y)(r(y) P (x, y, z)) hyp 3. ( y)(r(y) P (z, y, z)) 2 ui 4. R(z) P (z, a, z) 3 ui 5. R(z) 1 ui b) 1. ( z)q(x, z) hyp 2. ( x)( y)(q(x, y) P (x)) hyp 3. ( y)(q(x, y) P (x)) 2 ui 4. Q(x, z) 1 ei 5. Q(x, z) P (x) 3 ui 2010 Manfred Huber Page 2

c) 1. ( x)( y)p (x, y) hyp 2. ( x)(p (x, a) S(a)) hyp 3. ( y)p (x, y) 1 ui 4. P (x, a) 3 ei 5. P (x, a) S(a)) 2 ui 6. S(a) 4, 5 mp d) 1. ( x)p (x) hyp 2. ( y)(p (y) Q(y, z)) hyp 3. P (z) 1 ei 4. P (z) Q(z, z) 2 ui 5. Q(z, z) 4, 3 mp 6. ( z)q(z, z) 5 eg e) 1. ( x)(r(x) ( y)q(x, y)) hyp 2. ( z)( y)q(z, y) hyp 3. R(z) ( y)q(z, y) 1 ui 4. ( y)q(z, y) 2 ui 5. R(z) 4, 3 mt 6. ( x)r(x) 4 eg f) 1. ( x)p (x) hyp 2. ( x)(( y)p (y) Q(x, y)) hyp 3. P (y) 1 ei 4. ( y)p (y) Q(x, y) 2 ui 5. ( y)p (y) 3 eg 6. Q(x, y) 5, 4 mp 7. ( x)q(x, y) 6 ug 8. ( y)( x)q(x, y) 7 ug g) 1. ( x)r(x) hyp 2. ( y)(r(y) Q(y)) hyp 3. R(z) Q(z) 2 ei 4. R(z) 1 ui 5. Q(z) 3, 4 mp 6. ( z)q(z) 5 ug 2010 Manfred Huber Page 3

2. Use predicate logic to prove the following arguments: a) ( x)(p (x) ( y)q(x, y)) ( x)q(x, a) (P (b) R(a)) R(a) b) Q(x) ( x)(p (x) (( y)(q(y) R(x, y)))) ( y)r(y, x) P (b) c) ( x)(p (x) Q(x, a)) Q(b, a) Q(a, a) ( x)( y)(q(x, y) P (x) Q(y, a)) P (b) d) P (a) ( x)(( y)q(y, a) R(x, a)) ( x)( y)(p (x) Q(y, x)) ( z)r(z, a) e) ( x)( y)(p (x, y) R(y, x) ( x)( y)(p (x, y) Q(y) ( x)( y)(r(x, y) Q(y)) f) P (a) ( x)(p (x) Q(x, x)) ( y)(p (y) Q(y, y)) ( x)p (x) ( y)p (y) Proof Techniques 3. For each of the following informal proofs indicate which proof technique was used (exhaustive proof, direct proof, proof by contraposition, or proof by contradiction). a) Conjecture: All odd numbers between 3 and 25 are either prime numbers or the product of exactly 2 prime numbers. Proof: 3, 5, 7, 11, 13, 17, 19, and 23 are all prime numbers and 9 = 3 3, 15 = 3 5, 21 = 3 7, and 25 = 5 5 are the product of exactly two prime numbers, therefore all odd numbers between 3 and 25 are either prime or the product of exactly 2 prime numbers. b) Conjecture: If the product of two non-zero integers is an even number then at least one of them has to be an even number. Proof: Suppose that none of the numbers is even, i.e. x = 2 k + 1 and y = 2 l + 1 but their product is even, i.e. x y = 2 m. Then, x y = (2 k + 1)(2 l + 1) = 4 k l + 2 k + 2 l + 1 = 2 (2 k l + k + l) + 1 would have to be equal to 2 m and therefore 2 m = 2 (n) + 1. Since this is not possible for integers, at least one of the two non-zero integers has to be even. c) Conjecture: The sum of two non-zero integers is even if and only if either both integers are even or if both are odd. Proof:Assume both integers are even, i.e. x = 2 k and y = 2 l. Then x + y = 2 k + 2 l = 2 (k + l) which is even. Assuming both integers are odd, i.e. x = 2 k + 1 and y = 2 l + 1. Then x + y = 2 k + 1 + 2 l + 1 = 2 (k + l) + 2 which is even. Assuming that one is even and one is odd, i.e. x = 2 k + 1 and y = 2 l. Then x + y = 2 k + 1 + 2 l = 2 (k + l) + 1 which is odd. Since there is no other possibility for two non-zero integers, the sum of two non-zero integers is even if and only if either both integers are even or if both are odd. d) Conjecture: if an integer is even then its square is even. Proof: Assume the integer is even with x = 2 k. Then its square is x 2 = x x = 2 k 2 k = 2 (2 k k) which is even. Therefore the square of an even integer is even. 2010 Manfred Huber Page 4

e) Conjecture: If the product of two integers is odd, then both of them are odd. Proof: Assume that one of the integers is even, i.e. x = 2 k. Then the product is x y = 2 k y = 2 (k y) which is even. Therefore, if the product of two integers is odd, then both of them are odd. 4. Prove or disprove the following conjectures. You can use an informal proof (the proof has to have enough detail for everyone to understand it). a) The sum of four consecutive integers is even. b) If the sum of two integers is 0 then either both of them are 0 or one is negative and one is positive. c) The square of a natural number is always larger than the sum of all the numbers between 1 and the number. d) If the afternoon trains from Fort Worth to San Antonio and from San Antonio to Fort Worth run on the same track at the same time, they will collide. But since both trains arrived, they did not run on the same track. e) The result of dividing a rational number by a rational number is a rational number. f) Any odd integer greater than 2 can be written as the sum of an odd and an even number. Induction 5. Use mathematical induction to prove the following statements for positive integers. Also state if you are using the first or the second principle of induction. a) No palindrome of even length contains any symbol an odd number of times. b) For any positive integer, n, greater than 2 the product of all even, positive integers smaller than it is less than n n/2. c) n + m n (m + 1) for all n, m 1 d) Any even positive integer that is a square number can be written as the product of 4 and a set of odd prime numbers. e) The sum of all integers between 1 and n is equal to n 1+n 2. f) Any string constructed by concatenating an arbitrary number of strings of even length has to be of even length. Recursion 6. Give a recursive definition of the following sequences. a) P (n) = {x x is a power of 3} b) P (n) is the number of all possible ways to select 2 cards from a set of n distinct cards. 2010 Manfred Huber Page 5

c) P (n) = 2 n + 7 n + 1 for all positive integers n. d) P (n) is an alternating bit sequence of length n. e) P (n) is the number of possible ways to obtain the positive integer n by summing exactly two positive integers smaller than n. 7. Prove that the correctness of the following properties of the given recursive sequences. a) Given the sequence P (1) = 1, P (n + 1) = P (n) + 2 (n + 1) 1 for all positive integers, prove that P (n) = n 2 b) Given the sequence P (1) = 1, P (2) = 1, P (3) = 1, P (n) = P (n 3) + 2 P (n 2) for all n 3, prove that for all positive integers n P (n) + P (n + 1) = 0. 2010 Manfred Huber Page 6