Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Similar documents
Thinking of Nested Quantification

Section Summary. Section 1.5 9/9/2014

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

Mat 243 Exam 1 Review

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Propositional Logic Not Enough

Section Summary. Predicates Variables Quantifiers. Negating Quantifiers. Translating English to Logic Logic Programming (optional)

Introduction to Sets and Logic (MATH 1190)

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

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Exercise Set 1 Solutions Math 2020 Due: January 30, Find the truth tables of each of the following compound statements.

Proposi'onal Logic Not Enough

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

CSC Discrete Math I, Spring Propositional Logic

Discrete Mathematics and Its Applications

ICS141: Discrete Mathematics for Computer Science I

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

1.1 Language and Logic

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.

1.1 Language and Logic

Chapter 1, Part II: Predicate Logic

Introduction to Decision Sciences Lecture 2

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Predicates and Quantifiers. Nested Quantifiers Discrete Mathematic. Chapter 1: Logic and Proof

DISCRETE MATHEMATICS BA202

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.

EECS 1028 M: Discrete Mathematics for Engineers

Compound Propositions

1 The Foundation: Logic and Proofs

Recall that the expression x > 3 is not a proposition. Why?

CS 220: Discrete Structures and their Applications. Predicate Logic Section in zybooks

Predicate Logic Thursday, January 17, 2013 Chittu Tripathy Lecture 04

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

Mathematical Reasoning (Part I) 1

Logical equivalences 12/8/2015. S T: Two statements S and T involving predicates and quantifiers are logically equivalent

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

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

1 The Foundation: Logic and Proofs

Foundation of proofs. Jim Hefferon.

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

First order Logic ( Predicate Logic) and Methods of Proof

CSI30. Chapter 1. The Foundations: Logic and Proofs Nested Quantifiers

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

STRATEGIES OF PROBLEM SOLVING

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Computer Science 280 Spring 2002 Homework 2 Solutions by Omar Nayeem

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

Discrete Structures Lecture 5

MAT2345 Discrete Math

ECOM Discrete Mathematics

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

software design & management Gachon University Chulyun Kim

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

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

Section 1.3. Let I be a set. When I is used in the following context,

CS Module 1. Ben Harsha Apr 12, 2017

MAT 101 Exam 2 Logic (Part I) Fall Circle the correct answer on the following multiple-choice questions.

Topic #3 Predicate Logic. Predicate Logic

Announcements CompSci 102 Discrete Math for Computer Science

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

Propositional Functions. Quantifiers. Assignment of values. Existential Quantification of P(x) Universal Quantification of P(x)

Predicate Calculus lecture 1

Part I: Propositional Calculus

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

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.

III. Elementary Logic

Predicate Logic & Quantification

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

LOGIC CONNECTIVES. Students who have an ACT score of at least 30 OR a GPA of at least 3.5 can receive a college scholarship.

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

Logic and Proof. Aiichiro Nakano

Lecture 4. Predicate logic

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

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

Lecture Predicates and Quantifiers 1.5 Nested Quantifiers

Logic and Proofs. (A brief summary)

Connectives Name Symbol OR Disjunction And Conjunction If then Implication/ conditional If and only if Bi-implication / biconditional

Solutions to Exercises (Sections )

Learning Goals of CS245 Logic and Computation

A. Propositional Logic

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

1 Predicates and Quantifiers

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

ICS141: Discrete Mathematics for Computer Science I

Basic Logic and Proof Techniques

Nested Quantifiers. Predicates and. Quantifiers. Agenda. Limitation of Propositional Logic. Try to represent them using propositional.

Logic and Propositional Calculus

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

Department of Computer Science & Software Engineering Comp232 Mathematics for Computer Science

Chapter 1, Section 1.1 Propositional Logic

PROPOSITIONAL CALCULUS

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

Predicate in English. Predicates and Quantifiers. Predicate in Logic. Propositional Functions: Prelude. Propositional Function

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

Logic and Propositional Calculus

Chapter 2: The Logic of Quantified Statements. January 22, 2010

Today s Lecture. ICS 6B Boolean Algebra & Logic. Predicates. Chapter 1: Section 1.3. Propositions. For Example. Socrates is Mortal

HANDOUT AND SET THEORY. Ariyadi Wijaya

Math 10850, fall 2017, University of Notre Dame

Transcription:

Logical Operators Conjunction Disjunction Negation Exclusive Or Implication Biconditional 1

Statement meaning p q p implies q if p, then q if p, q when p, q whenever p, q q if p q when p q whenever p p only if q p is sufficient for q q is necessary for p q follows from p q is implied by p 2

Translate English into logical Expressions You access the ACM library only if you are a CS major and you do not have account holds. a: you access the ACM library c: you are a CS major f: you have account holds a (c f ) 3

Converse, Inverse, Contrapositive For the implication p q The converse is q p The inverse is p q The contrapositive is q p 4

Examples p: you get an A q: you get an xbox q q If you get an A, you will get an xbox The converse q p If you get an xbox, you will get an A The inverse p q If you do not get an A, you do not get an xbox The contrapositive q p If you do not get an xbox, you do not get an A 5

Boolean Operations Summary 6

Logical Equivalence (Textbook 1.3) A tautology is a compound proposition that is true regardless of the truth values of its constituent propositions p V p (what is the truth table?) A contradiction is a compound proposition that is false regardless of the truth values of its constituent propositions p p (what is the truth table?) A contingency is a compound proposition that is neither a tautology nor a contradiction. (p q) r 7

Logical Equivalence When two different compound propositions have the same truth value no matter what truth values their constituent propositions have, they are logically equivalent. p q When the truth table for p and q is the same Or, when p q is a tautology 8

Logical Equivalence Example: Show that the negation of p q is logically equivalent to p q i.e., (p q) (p q ) pt q p q (p q) p q ( (p q)) (p q) T T T F F T T F F T T T F T T F F T F F T F F T 9

Examples De Morgan s Law for Logic 1. (p q) is logically equivalent to p q Proof: p q p q (p q) p q T T T F F T F T F F F T T F F F F F T T 10

Examples De Morgan s Law for Logic 2. (p q) is logically equivalent to p q Proof: p q p q (p q) p q T T T F F T F F T T F T F T T F F F T T 11

More Examples Show that following compound propositions are logically equivalent Check the answer from the textbook 12

Logical equivalence by symbolic derivations Given the known logical equivalences, can we prove new logical equivalences? Without using truth tables Expand implication De Morgan s law Double negation 14

Satisfiability A compound proposition is satisfiable if there exists an assignment of truth values to its variables that makes it true. When no such assignment exists, the proposition in unsatisfiable. The satisfying set of values is called a solution. 15

Example Determine if the following compound proposition is satisfiable or not: You can show this using a truth table Or using logical arguments This proposition is true when at least one is true and at leas one is false This proposition is satisfiable 16

Predicates and Quantifiers Is the following statement a proposition? p: n is an odd integer Predicate p is not a proposition as the truth value of p depends on the value of variable n Statements involving variables are common in computer programs and mathematical proofs. We need to extend the logic to include such statements. 17

Propositional function Let p(x) be a statement involving the variable x. We call p a propositional function; once x is assigned a value, p(x) becomes a proposition. Example assume p(x) denotes the statement x is an odd integer p(3) is a proposition 18

Examples: Propositional functions P:= x is divisible by 8 P(2016) is true P(1876) is false 19

Generalization: functions with more than one variable Q(x,y):= x is divisible by y Q(21,7) is True Why? (because 21 is divisible by 7) Q(49,8) is False Why? (because 49 is not divisible by 8) 20

The Universe of Discourse The collection of values that a variable x can take is called x s universe of discourse or the domain of discourse (often just referred to as the domain) Example P(x) = 10. x > x We need to specify what is the domain of x 21

Quantifiers Many statements in mathematics and computer science use terms like for every and for some. For every triangle T, the sum of the angles of T is equal to 180 o. For some student P, the GPA of P is 4.0 We need to extend the logic system to include such statements. 22

Universal Quantifier The statement for every x, p(x) is said to be a universally quantified statement. Let P(x) := x 2 +2 3x x P(x) Ex: P(x):= x 2 +2 3x x P(x)is true in the universe of integers. x P(x)is false in the universe of rational numbers. 23

Existential Quantifier The statement for some x, p(x) is said to be a existentially quantified statement. The statement is symbolically written as x p(x). The symbol means for some., or there exists a value 24

Example Verify that the universally quantified statement for every real x, x 2 1 > 0 is false. We need to show that for some value of x x 2 1 0 Choose x=1; we get x 2 1 = 0. The statement is false. 25

Existential Quantifier The statement x p(x) is true if the statement p(x) is true for at least one x (in domain D). The statement x p(x) is false if the statement p(x) is false for every x (in D). Example: for some positive integer n, if n is prime, then n+1, n+2, n+3, n+4 are not prime. is an existentially quantified statement (domain is the set of positive integers). The statement is true since there exists an n (e.g., n=23), for which the statement is true. 26

Free and Bound Variables An expression like P(x) is said to have a free variable x (meaning, x is undefined) A quantifier (either or ) operates on an expression having one or more free variables, and binds one or more of those variables, to produce an expression having one or more bound variables 27

Example P(x,y) has 2 free variables, x and y xp(x,y) has 1 free variable Which one is bound and which is free xp(x,y) is not a proposition 28

Example Let P(x):= x is a perfect square a perfect square is a number that can be expressed as the product of two numbers x P(x) is true for the natural numbers x P(x) is false for the negative numbers x P(x) is false for the natural numbers 29

Translating English sentences (1) Some student in this class visited Mexico in the summer. (2) Every student in this class visited either Canada or Mexico in the summer. M(x) x visited Mexico in the summer C(x) x visited Canada in the summer (1) x M(x) (2) x (C(x) M(x)) 30

Translating statements into English C(x) x has a computer F(x,y) x and y are friends universe for x and y are all students in a school x (C(x) y (C(y) F(x,y)) For every student x in the school x has a computer or there is a student y such that y has a computer and x and y are friends. More natural: Every student has a computer or has a friend who has a computer. 31

Negating Quantified Expressions Generalized De Morgan s Laws x P(x) x P(x) x P(x) x P(x) Let P(x):= x puts Baby in a corner x P(x) means somebody puts baby in a corner x P(x) means x P(x) 32 everyone does not put baby in a corner nobody puts baby in a corner. Remember: (p q) is equiv. to p q and (p q) is equiv. to p q

Negating Quantified Expressions Generalized De Morgan s Laws Remember that Using De Morgan s Laws 33

Example 34

Nested Quantifiers Textbook 1.5 Nested quantifiers are quantifiers that occur within the scope of other quantifiers The order of the quantifiers is important, Except for the following all the quantifiers are universal or the quantifiers are existential 35

Nested Quantifiers 36

Example Expressing Uniqueness Each person s program is unique. Let the universe of discourse be people Let E(x,y) := the program of person x is the same as that of person y x y (x y) E(x,y) x y E(x,y) (x=y) 37

Order of Quantifiers Let C(x,y):= program x crashes on input y Let L(x,y):= program x loops forever on input y Universe for x is programs Universe for y is inputs There is an input that causes every program to crash or loop forever Every program has some input on which it either crashes or loops forever Some programs loop forever or crash on every input 38

Order of Quantifiers There is an input that causes every program to crash or loop forever Since it s not possible to both crash and loop forever, the OR is really XOR y x C(x,y) L(x,y) Every program has some input on which it either crashes or loops forever x y C(x,y) L(x,y) 39

Order of Quantifiers Some programs loop forever or crash on every input This is not the same as the previous example. x y C(x,y) L(x,y) 40

Negating Nested Quantifiers Successively apply the rules for negating statements involving a single quantifier Example someone has taken a flight on every airline in the world Represent it Negate it Back to English 41

Negating Nested Quantifiers someone has taken a flight on every airline in the world Represent it P(x,f):= person x has taken flight f Q(f,a):= f is a flight on airline a p a f P(p,f) Q(f,a)

Negating Nested Quantifiers someone has taken a flight on every airline in the world negate it p a f P(p,f) Q(f,a) p a f P(p,f) Q(f,a) p a f P(p,f) Q(f,a) p a f (P(p,f) Q(f,a)) p a f P(p,f) Q(f,a) p a f P(p,f) Q(f,a)

Negating Nested Quantifiers someone has taken a flight on every airline in the world Back to English For every person, there exists an airline such that for every flight either that person has not taken the flight or the flight is not on the airline. For every person, there exists an airline such that for every flight, if the person has taken the flight, then the flight is not on that airline For every person there exists an airline on which they ve never taken any flight