Discrete Mathematics for CS Spring 2006 Forbes HW 1 Solutions

Similar documents
COMP232 - Mathematics for Computer Science

Announcements CompSci 102 Discrete Math for Computer Science

Review: Potential stumbling blocks

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

PROPOSITIONAL CALCULUS

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

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

Discrete Structures for Computer Science

Predicate Logic & Quantification

Propositional Logic Not Enough

Compound Propositions

The Logic of Compound Statements cont.

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

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

Chapter 1: The Logic of Compound Statements. January 7, 2008

CS0441 Discrete Structures Recitation 3. Xiang Xiao

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

Logic and Proof. Aiichiro Nakano

DISCRETE MATHEMATICS BA202

CSC Discrete Math I, Spring Propositional Logic

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

Discrete Mathematics Recitation Course 張玟翔

Mat 243 Exam 1 Review

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

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

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

THE LOGIC OF COMPOUND STATEMENTS

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Discrete Mathematics and Its Applications

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

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

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

III. Elementary Logic

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

Rules Build Arguments Rules Building Arguments

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

Propositional Logic: Methods of Proof (Part II)

Propositional Logic. Spring Propositional Logic Spring / 32

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Definition 2. Conjunction of p and q

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

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

1.1 Statements and Compound Statements

Section 1.1: Logical Form and Logical Equivalence

CSE 20: Discrete Mathematics

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

CS 2336 Discrete Mathematics

A Little Deductive Logic

Chapter 1 Elementary Logic

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.

ICS141: Discrete Mathematics for Computer Science I

Section 1.2: Propositional Logic

KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) RULES OF INFERENCE. Discrete Math Team

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

Logic and Proofs. Jan COT3100: Applications of Discrete Structures Jan 2007

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

Logic, Sets, and Proofs

Introduction to Sets and Logic (MATH 1190)

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

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

A Little Deductive Logic

CSE Discrete Structures

THE ISLAMIC UNIVERSITY OF GAZA ENGINEERING FACULTY DEPARTMENT OF COMPUTER ENGINEERING DISCRETE MATHMATICS DISCUSSION ECOM Eng. Huda M.

Solutions to Exercises (Sections )

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

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

Chapter 4, Logic using Propositional Calculus Handout

Artificial Intelligence: Knowledge Representation and Reasoning Week 2 Assessment 1 - Answers

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

ECOM Discrete Mathematics

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

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.

A. Propositional Logic

ANS: If you are in Kwangju then you are in South Korea but not in Seoul.

Propositional Logic. Fall () Propositional Logic Fall / 30

Formal (Natural) Deduction for Predicate Calculus

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

AN INTRODUCTION TO MATHEMATICAL PROOFS NOTES FOR MATH Jimmy T. Arnold

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 15 Propositional Calculus (PC)

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

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

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

CS250: Discrete Math for Computer Science. L6: CNF and Natural Deduction for PropCalc

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

3 The Semantics of the Propositional Calculus

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

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

CS Module 1. Ben Harsha Apr 12, 2017

CS 771 Artificial Intelligence. Propositional Logic

EECS 1028 M: Discrete Mathematics for Engineers

Chapter 2: The Logic of Quantified Statements

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Methods of Proof. 1.6 Rules of Inference. Argument and inference 12/8/2015. CSE2023 Discrete Computational Structures

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

Propositional Equivalence

1 The Foundation: Logic and Proofs

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

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

Transcription:

CompSci 102 Discrete Mathematics for CS Spring 2006 Forbes HW 1 Solutions 1. (2 pts.) Basics Thanks for your responses 2. (13 pts.) Book problems - Warmup for Recitation (a) 1.2 Exercise 36: The statement of the problem is really the solution. Each line of the truth table corresponds to exactly one combination of truth values for the n atomic propositions involved. We can write down a conjunction that is true precisely in this case, namely the conjunction of all the atomic propositions that are true and the negations of all the atomic propositions that are false.if we do this for each line of the truth table for which the value of the compound proposition is to be true, and take the disjunction of the resulting propositions, then we have the desired proposition in its disjunctive normal form. (b) 1.3 Exercise 26: Translate each of these statements into logical expressions using predicates, quantifiers, and logical connectives. Let: R(x) = x is in the correct place. E(x) = x is in excellent condition. T (x) = x is a (your) tool; and let the universe of discourse be all things. a) There exists something not in the correct place: x R(x) b) If something is a tool, then it is in the correct place and in excellent condition: x(t (x) (R(x) E(x))). c) x(r(x) E(x)). d) This is saying that everything fails to satisfy the condition: x (R(x) E(x)). e) There exists a tool with this property: x(t (x) R(x) E(x)). (c) 1.4 Exercise 34: 1

In each case, you need to specify predicates and the universe of discourse (noted in italics). a) Let: L(x, y) = person x has lost y dollars playing the lottery Statement: x y(y > 1000 L(x, y) Negation: x y(y > 1000 L(x, y): someone has lost more than $1000 playing the lottery b) Let: C(x, y) means that student in class x has chatted with student in class y Statement: x, y(y x z(z x (z = y C(x, z)))) Negation: x, y(y x z(z x (z = y C(x, z)))): everybody in this class has either chatted with no one else or has chatted with two or more others. c) Let E(x, y) mean that student in class x has sent email to student in class y. Statement: x y z(y z x y x z w(w x (E(x, w) (w = y w = z)))) Negation: x y z(y z x y x z w(w x (E(x, w) (w = y w = z)))): some student in this class has sent email to exactly two other students in the class. d) Let S(x, y) mean that student in class x has solved exercise y Statement: x ys(x, y) Negation: x y S(x, y): For every student in the class, there is some exercise that he or she has not solved e) Let S(x, y) mean that student in class x has solved exercise y and let B(y, z) mean that exercise y is in section z of the book. Statement: x z y(b(y, z) S(x, y)) Negation: x z y(b(y, z) S(x, y)): some student has solved at least one exercise in every section of the book (d) 1.4 Exercise 50: We just need to translate the words into symbols: means lim a n = L n ɛ N n(n > N a n L < ɛ) where n and N range over positive integers and epsilon ranges over positive real numbers. 3. (20 pts.) Knights and Knaves Monique is either a knight or a knave. Knights always tell the truth, and only the truth; knaves always tell falsehoods, and only falsehoods. Someone asks Monique, Are you a knight? She replies, If I am a knight, then I ll stand on my head. A. yes B. P = (P = Q) P = (P = Q) CompSci 102, Spring 2006, HW 1 Solutions 2

C. Using proof by enumeration, prove that your answer from part (a) follow from the premises you wrote in part (b). (No inference rules allowed) P Q P = Q P = (P = Q) P = (P = Q) T T T T T T F F F T F T T T F F F T T F For both implications to be satisfied,,p and Q must both be true. Therefore, Monique must stand on her head. 4. (5 pts.) Unicorns! Given the following, can you prove that the unicorn is mythical? Horned? How about magical? If the unicorn is mythical, then it is immortal, but if it is not mythical, then it is a mortal mammal. If the unicorn is either immortal or a mammal, then it is horned. The unicorn is magical if it is horned. P1. Mythical Immortal P2. Mythical Immortal Mammal P3. Immortal Mammal Horned P4. Horned Magical 1. Immortal M ythical P1 contrapositive 2. Immortal Immortal M ammal 1, P2, hypothetical syllogism 3. Immortal ( Immortal M ammal) 2, implication defn 4. (Immortal Immortal) (Immortal M ammal) 3, distributive 5. Immortal M ammal 4, tautology, identity 6. Horned 5, P3, modus ponens 7. M ythical 6, P4, modus ponens So the unicorn is horned and mythical. mythical. However, there is no way to show the unicorn is 5. (15 pts.) Inference rules (a) P = Kangaroos live in Australia. Q = Kangaroos are marsupials. Rule: P Q Q, and-elimination. (b) P = It is hotter than 100 degrees today. Q = the pollution is dangerous. Rule:, disjunctive syllogism. P Q, P Q (c) P = Linda is an excellent swimmer. Q = Linda can work as a lifeguard., modus ponens. Rule: P Q,P Q CompSci 102, Spring 2006, HW 1 Solutions 3

(d) P = Steve will work at a computer company this summer. Q = He will be a beach bum. P Rule: P Q, addition. (e) P = I work all night on this homework. Q = I will answer all the exercises. R = I will understand the material. Rule: P Q, Q R, hypothetical syllogism. P R 6. (20 pts.) Setting up a minesweeper problem 7. (25 pts.) Truth Tables Columns i and m are given: i : p q m : p p. The same trick we used for m also holds for k, which is q: k : q q, and combining i and m yields the and of column h: h : (p q) (p q). We now just need to find half of the solutions, and the negations of these can be derived by this same trick. Since the nand of column i has one T and three F in it, it is easy to obtain the other columns with this property by switching rows. For instance, the implication of column e resembles the nand of column i except that its first and second row are switched. If you look at the input columns of the truth table (the first two, with headers p and q), you see that this switch can be achieved by replacing q with q. This also switches the third and fourth row of the truth table, but this does not matter, because these rows in e are equal to each other, and so are the corresponding rows in i. Thus, e can be implemented as p q, that is, e : p (q q). Exchanging the role of p and q yields the converse of e, that is, c: c : (p p) q. Column b is the truth table for the inclusive or, and is the same as the nand of column i read from the bottom up. Therefore, this truth table can be obtained by negating both p and q: b : (p p) (q q). CompSci 102, Spring 2006, HW 1 Solutions 4

Note that this is consistent with De Morgan s rule: to or propositions p and q we negate p (this is p p) and q (this is q q), and the results together, and negate the result of that (the negation of and is nand ). Columns l, n, and o can now be obtained by negating ( nand -ing with themselves) columns e, c, and b, respectively: l : (p (q q)) (p (q q)) n : ((p p) q) ((p p) q) o : ((p p) (q q)) ((p p) (q q)) We are left with six columns: tautology (column a), contradiction (column r), and the four tables that have two Ts and two Fs (columns d, f, g, and j). Tautology can be written as p ( p), so we can resort to column b (for or ) and negation: a : (p p) ((p p) (p p)). Similarly, contradiction can be written as p ( p), which is the and (column h) of p and p p: r : (p (p p)) (p (p p)). Of the remaining columns, d and f are trivially copies of the inputs p and q, respectively: d : p f : q. The remaining two columns are the exclusive or (column g) and the bi-implication (column j). These are negations of each other, so we just need to find one, and derive the other by nand -ing the first by itself. Bi-implication differs by the nand (column i) in its last row, and can therefore be expressed as follows: j : (p q) ( p q) (p q) ( p q) ((p q) ( p q)) ((p q) ((p p) (q q))) ((p q) ((p p) (q q))) ((p q) ((p p) (q q))). Finally, by negating j (that is, nand -ing it with itself) we obtain the exclusive or: g : (((p q) ((p p) (q q))) ((p q) ((p p) (q q)))) (((p q) ((p p) (q q))) ((p q) ((p p) ( A simpler way to obtain the exclusive or of column g is to take the nand of column i (the nand ) and column b (the or ): g : (p q) (p q) (p q) ((p p) (q q)). CompSci 102, Spring 2006, HW 1 Solutions 5

In summary, here is one version of the complete table: a : (p p) ((p p) (p p)) b : (p p) (q q) c : (p p) q d : p e : p (q q) f : q g : (p q) ((p p) (q q)) h : (p q) (p q) i : p q j : ((p q) ((p p) (q q))) ((p q) ((p p) (q q))) k : q q l : (p (q q)) (p (q q)) m : p p n : ((p p) q) ((p p) q) o : ((p p) (q q)) ((p p) (q q)) r : (p (p p)) (p (p p)). Other implementations are possible. CompSci 102, Spring 2006, HW 1 Solutions 6