Homework 4 Solutions

Similar documents
Homework 3: Solutions

Homework 2: Solutions

Homework 5 Solutions

Homework 5 Solutions

Midterm: Sample 3. ECS20 (Fall 2017) 1) Using truth tables, establish for each of the two propositions below if it is a tautology, a contradiction

Logic. Def. A Proposition is a statement that is either true or false.

CSC Discrete Math I, Spring Propositional Logic

Some Review Problems for Exam 1: Solutions

Compound Propositions

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

a. See the textbook for examples of proving logical equivalence using truth tables. b. There is a real number x for which f (x) < 0. (x 1) 2 > 0.

CSE 20. Final Review. CSE 20: Final Review

2.2: Logical Equivalence: The Laws of Logic

Finals: Solutions. ECS 20 (Fall 2009) Patrice Koehl May 20, 2016

Solutions to Homework I (1.1)

CS 173: Discrete Mathematical Structures, Spring 2008 Homework 1 Solutions

Note: The area of logic that deals with propositions is called the propositional calculus or propositional logic.

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Problem 1: Suppose A, B, C and D are finite sets such that A B = C D and C = D. Prove or disprove: A = B.

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

Problem Set 7 Solutions

Definition 2. Conjunction of p and q

2 Truth Tables, Equivalences and the Contrapositive

ANALYSIS EXERCISE 1 SOLUTIONS

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

COT 2104 Homework Assignment 1 (Answers)

Computer Science 280 Spring 2002 Homework 2 Solutions by Omar Nayeem

A statement is a sentence that is definitely either true or false but not both.

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

1.1 Language and Logic

CISC-102 Winter 2016 Lecture 17

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

Discrete Mathematics. (c) Marcin Sydow. Sets. Set operations. Sets. Set identities Number sets. Pair. Power Set. Venn diagrams

Basic Logic and Proof Techniques

Logic and Proof. Aiichiro Nakano

EECS 1028 M: Discrete Mathematics for Engineers

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Equivalence and Implication

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Mathematics 220 Homework 4 - Solutions. Solution: We must prove the two statements: (1) if A = B, then A B = A B, and (2) if A B = A B, then A = B.

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

CISC-102 Fall 2018 Week 11

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

1. Propositions: Contrapositives and Converses

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

AMTH140 Lecture 8. Symbolic Logic

Computer Science Foundation Exam

Propositional Logic, Predicates, and Equivalence

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

ECOM Discrete Mathematics

Solutions to Homework Problems

Writing proofs for MATH 51H Section 2: Set theory, proofs of existential statements, proofs of uniqueness statements, proof by cases

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

Solutions to Homework Set 1

The proposition p is called the hypothesis or antecedent. The proposition q is called the conclusion or consequence.

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

PRINCIPLE OF MATHEMATICAL INDUCTION

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

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

Statistical Inference

CS1800 Discrete Structures Spring 2018 February CS1800 Discrete Structures Midterm Version A

A set is an unordered collection of objects.

Logic, Sets, and Proofs

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

More examples of mathematical. Lecture 4 ICOM 4075

Equivalence of Propositions

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

Review 1. Andreas Klappenecker

Computer Science Section 1.6

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

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

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.

Sets McGraw-Hill Education

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

We want to show P (n) is true for all integers

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

Cartesian Products and Relations

1.1 Language and Logic

With Question/Answer Animations. Chapter 2

Set Operations. Combining sets into new sets

3.4 Set Operations Given a set A, the complement (in the Universal set U) A c is the set of all elements of U that are not in A. So A c = {x x / A}.

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Propositional natural deduction

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

Introduction to proofs. Niloufar Shafiei

Logic As Algebra COMP1600 / COMP6260. Dirk Pattinson Australian National University. Semester 2, 2017

Section 1.2: Propositional Logic

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Operations on Sets. Gazihan Alankuş (Based on original slides by Brahim Hnich et al.) August 6, 2012

Math 10850, fall 2017, University of Notre Dame

Proofs of Mathema-cal Statements. A proof is a valid argument that establishes the truth of a statement.

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

Introduction to Decision Sciences Lecture 2

Boolean Logic. CS 231 Dianna Xu

Sec$on Summary. Mathematical Proofs Forms of Theorems Trivial & Vacuous Proofs Direct Proofs Indirect Proofs

Direct Proof and Proof by Contrapositive

Chapter 1 : The language of mathematics.

Proof by Contradiction

Transcription:

Homework 4 Solutions ECS 20 (Fall 14) Patrice Koehl koehl@cs.ucdavis.edu November 1, 2017 Exercise 1 Let n be an integer. Give a direct proof, an indirect proof, and a proof by contradiction of the statement if n is odd, then n + 7 is even. Let n be an integer. Let p be the proposition: n is odd, and q be the proposition n + 7 is even. Direct proof: We show directly p q. Hypothesis: p is true, i.e. n is odd. As n is odd, there exists an integer k such that n = 2k + 1, Then, n + 7 = 2k + 8 = 2(k + 4). As k + 4 is an integer, n + 7 is even, i.e. q is true. We conclude that p q. Indirect proof: We show that q p. Hypothesis: q is true, i.e. n+7 is odd. Then there exists an integer k such that n+7 = 2k+1. Then n = 2k 6 = 2(k 3), i.e. n is even since k 3 is an integer. p is true. We have shown that q p; by contrapositive, we conclude p q. Contradiction: Hypothesis: We suppose that the proposition p q is false, i.e. that p is true and q is false. Since p is true, n is odd, therefore there exists an integer k such that n = 2k + 1, Then, n + 7 = 2k + 8 = 2(k + 4). Since k + 4 is an integer, n + 7 is even; but the hypothesis states n + 7 is odd: we reach a contradiction. The hypothesis is wrong, therefore the statement p q is true. Exercise 2 Let A = {1, 2} and B = {2, 3}. Define P(A B), P(A), and P(A B), where P(C) indicates the power set of the set C. Since A = {1, 2} and B = {2, 3}, we have: a) A B = {2} b) A B = {1, 2, 3} Therefore, 1

a) P(A) = {, {1}, {2}, {1, 2}} b) P(A B) = {, {2}} c) P(A B) = {, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}} Exercise 3 Let A, and B be two sets in a universe U. Using set identities (no truth table or membership table!), show the following implications: There are at least two methods to show set identities. I will use both, namely a direct proof based on set theory identity and a proof based on logic, using a membership table. a) (A B) (A B) = (A B) (B A) Let us define LHS = (A B) (A B) and = (A B) (B A). LHS = (A B) (A B) (A B) ( A B ) ( De Morgan s law ) ( ) ( (A B) A (A B) B) distributivity ) ( ) ( (A A) (B A) (A B) (B B) distributivity ) ( ) ( (B A) (A B) absorption law ) ( ) B A A B absorption law (B A) (A B) Property of minus (A B) (B A) Symmetry Method 2: Membership table A B A B A B A B LHS (A B) (B A) 1 1 1 1 0 0 0 0 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 Since column 6 and 9 are equal, the two sets are equal b) (A B) (C B) = (A C) B Let LHS = (A B) (C B) and = (A C) B. LHS = (A B) (C B) ( A B ) ( C B ) property of minus (A C) B distributivity (A C) B Property of minus 2

Method 2: Membership table A B C A B C B LHS (A C) B 1 1 1 0 0 0 1 1 0 1 1 0 0 0 0 1 1 0 1 0 1 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 0 1 1 0 0 0 1 1 0 0 1 0 0 0 0 0 1 0 0 0 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 Since column 6 and 9 are equal, the two sets are equal c) (A B) (A C) = (A C) B Let LHS = (A B) (A C) and = (A C) B. LHS = (A B) (A C) ( ) ( ) ( A B A C property of minus ) ( A B (A C) demorgan s law ) ( ) A B A A B C distributivity ( A C B ) Absorption law (A C) B property of minus Method 2: Membership table A B C A B A C LHS (A C) B 1 1 1 0 0 0 1 1 0 1 1 0 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Since column 6 and 9 are equal, the two sets are equal 3

d) (A B) C = (A C) (B C) Let LHS = (A B) C and = (A C) (B C). = (A C) (B C) ( ) ( ) ( A C B C property of minus ) ( A C (B C) demorgan s law ) ( ) ( A C B A C C distributivity ) A B C Absorption law (A B) C property of minus LHS Method 2: Membership table A B C A B LHS A C B C 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 0 0 0 1 0 0 1 1 1 0 1 0 1 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Exercise 4 Since column 5 and 8 are equal, the two sets are equal Let A, and B be two sets in a universe U. Using set identities (no truth table or membership table!), show the following implications: a) if A B = A, then B ( B A ) = A We use a direct proof. Let p be the proposition A B = A and let q be the proposition B ( B A ) = A. Our hypothesis is that p is true. Then: B ( B A ) = B (B A) De Morgan s law (B B) (B A) Distributivity (A B) Absorption law A Absorption law and hypothesis Therefore q is true. According to the method of direct proof, p q is true. 4

b) if A B = B, then A B = A We use a direct proof. Let p be the proposition A B = B and let q be the proposition A B = A. Our hypothesis is that p is true. Then: A B = A (A B) Hypothesis: B = A B (A A) (A B) Distributivity A (A B) Absorption law A A B A Therefore q is true. According to the method of direct proof, p q is true. Exercise 5 Let A, and B be two sets in a universe U. The symmetric difference of A and B, denoted A B, is the set containing those elements in either A or B, but not in both A and B. This definition can be rewritten as: A B = (A B) (A B). Show that: a) (A B) B = A I use a membership table: Since column 1 and column 4 are equal, (A B) B = A. A B A B (A B) B 1 1 0 1 1 0 1 1 0 1 1 0 0 0 0 0 b) A B = (A B) (B A) Again, I use a membership table: A B A B B A (A B) (B A) A B 1 1 0 0 0 0 1 0 1 0 1 1 0 1 0 1 1 1 0 0 0 0 0 0 Since column 5 and 6 are equal, A B = (A B) (B A). 5

Exercise 6 Let A, and B be two sets in a universe U. Show that A B = U A B + A B. Let us define C = A B. A complement law tells us that C C = U where U is the domain. Also, C C =. Using the inclusion-exclusion principle, we find: U = C + C We know that C = A B = A + B A B, and, based on DeMorgan s law, C = A B. Replacing in the equation above, after rearrangement, we obtain: Exercise 7 A B = U A B + A B a) Let A, B, and C be three sets in a universe U. Show that A B C = A + B + C A B A C B C + A B C. From the inclusion-exclusion principle, we know that: A B = A + B A B Let us consider the three sets A, B and C. We observe that: Then: A B C = (A B) C A B C = A B + C (A B) C = A + B + C A B (A B) C = A + B + C A B (A C) (B C) = A + B + C A B ( A C + B C (A C) (B C) ) = A + B + C A B A C B C + (A C) (B C) = A + B + C A B A C B C + A B C b) In a fruit feast among 200 students, 88 chose to eat durians, 73 ate mangoes, and 46 ate litchis. 34 of them had eaten both durians and mangoes, 16 had eaten durians and litchis, and 12 had eaten mangoes and litchis, while 5 had eaten all 3 fruits. How many of the 200 students ate none of the 3 fruits, and how many ate only mangoes? Let U be the domain, namely the set of all students. U = 200. Let D be the set of students that eat durians; D = 88. Let M be the set of students that ate mangoes, M = 73. Let L be the set of students that ate litchis, L = 46. We are also told that D M = 34, D L = 16, M L = 12, and D M L = 5. Let C the set of students that eat at least one (type) of fruits: C = D M L. Based on part b), we find C = 150. Therefore C = 200 150 = 50: there are 50 students that ate none of the 3 fruits. Let DM be the set of students that ate mangoes and durians, LM the set of students that ate mangoes and litchis, and M M those students that only ate mangoes. We note that M = DM LM MM. Also, M = 73, DM = 34, LM = 12, DM LM = 5, and DM MM = LM MM = DM LM MM = 0. Using part a), we get MM = 32. 6

Extra Credit Let A, B, and C be three sets in a universe U. Using set identities (no truth table or membership table!), show the following identity, (A B) (B C) (C A) = (A B) (B C) (C A) Let LHS = (A B) (B C) (C A) and = (A B) (B C) (C A). Then: LHS = (A B) (B C) (C A) (B A) (B C) (C A) symmetry of union (B (A C)) (C A) distributivity (B (C A)) (A C) (C A)) distributivity ((B C) (B A)) ((A C) (A C)) Absorption law (B C) (B A) (A C) Absorption law 7