Lecture 02: Propositional Logic

Similar documents
Introduction Propositional Logic

CSC Discrete Math I, Spring Propositional Logic

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

AMTH140 Lecture 8. Symbolic Logic

DISCRETE STRUCTURES WEEK5 LECTURE1

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

Compound Propositions

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

PROPOSITIONAL CALCULUS

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

Introduction. Applications of discrete mathematics:

Today s Topic: Propositional Logic

Section 1.1 Propositional Logic. proposition : true = T (or 1) or false = F (or 0) (binary logic) the moon is made of green cheese

Discrete Mathematics and Its Applications

Chapter 1, Section 1.1 Propositional 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.

Discrete Structures for Computer Science

15414/614 Optional Lecture 1: Propositional Logic

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

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

EECS 1028 M: Discrete Mathematics for Engineers

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

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

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

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

TRUTH TABLES LOGIC (CONTINUED) Philosophical Methods

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

Mathematical Logic Part One

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

We last time we began introducing equivalency laws.

Propositional Equivalence

Boolean Logic. CS 231 Dianna Xu

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

3.2: Compound Statements and Connective Notes

Sec$on Summary. Propositions Connectives. Truth Tables. Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional

Mathematical Logic Part One

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

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

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

Equivalence and Implication

Numbers that are divisible by 2 are even. The above statement could also be written in other logically equivalent ways, such as:

Unit 1. Propositional Logic Reading do all quick-checks Propositional Logic: Ch. 2.intro, 2.2, 2.3, 2.4. Review 2.9

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

The statement calculus and logic

Mathematical Logic Part One

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

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

MA103 STATEMENTS, PROOF, LOGIC

1.1 Language and Logic

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Introduction Propositional Logic. Discrete Mathematics Andrei Bulatov

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

Section 1.1: Logical Form and Logical Equivalence

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Introduction to Theoretical Computer Science

More Propositional Logic Algebra: Expressive Completeness and Completeness of Equivalences. Computability and Logic

A Statement; Logical Operations

Discrete Structures of Computer Science Propositional Logic I

Truth-Functional Logic

Propositional Languages

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

Solutions to Homework I (1.1)

1.1 Statements and Compound Statements

Logic and Propositional Calculus

GENERAL MATHEMATICS 11

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

2.2: Logical Equivalence: The Laws of Logic

Propositional Logic. Spring Propositional Logic Spring / 32

- 1.2 Implication P. Danziger. Implication

Propositional natural deduction

Course Staff. Textbook

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

Packet #1: Logic & Proofs. Applied Discrete Mathematics

CS 220: Discrete Structures and their Applications. Propositional Logic Sections in zybooks

PHIL 422 Advanced Logic Inductive Proof

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.

Chapter 1: Formal Logic

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

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

Propositional Logic. Fall () Propositional Logic Fall / 30

Propositional logic ( ): Review from Mat 1348

Discrete Mathematics

CSE 311: Foundations of Computing I. Spring 2015 Lecture 1: Propositional Logic

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

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

2 Conditional and Biconditional Propositions

Logic: Propositional Logic (Part I)

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

Logic and Discrete Mathematics. Section 3.5 Propositional logical equivalence Negation of propositional formulae

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

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

Knowledge Representation. Propositional logic

Propositional Logic: Equivalence

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

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

Topic 1: Propositional logic

Chapter 5: Section 5-1 Mathematical Logic

UNIT-I: Propositional Logic

CSE 311: Foundations of Computing. Lecture 3: Digital Circuits & Equivalence

Transcription:

Lecture 02: Propositional Logic CSCI 358 Discrete Mathematics, Spring 2016 Hua Wang, Ph.D. Department of Electrical Engineering and Computer Science January 19, 2015

Propositional logic Propositional logic The simplest logic Definition: A proposition is a statement that is either true or false. Examples: Mines is located Golden, Colorado. (T) 5 + 2 = 8. (F) It is raining today. (either T or F) 2 of 16 CS 441 Discrete mathematics for CS

Composite statements Composite statements More complex propositional statements can be build from elementary statements using logical connectives. Example: Proposition A: It rains outside Proposition B: We will see a movie A new (combined) proposition: If it rains outside then we will see a movie 3 of 16 CS 441 Discrete mathematics for CS

CS 441 Discrete mathematics for CS Composite statements Composite statements More complex propositional statements can be build from elementary statements using logical connectives. Logical connectives: Negation Conjunction Disjunction Exclusive or Implication Biconditional 3 of 16

Negation Negation Definition: Let p be a proposition. The statement "It is not the case that p." is another proposition, called the negation of p. The negation of p is denoted by p and read as "not p." Example: Golden is located at west of Denver. It is not the case that Golden is located at west of Denver. Other examples: 5 + 2 8. 10 is not a prime number. It is not the case that buses stop running at 9:00pm. 4 of 16 CS 441 Discrete mathematics for CS

Negation Negation A truth table displays the relationships between truth values (T or F) of different propositions. p p T F F T Rows: all possible values of elementary propositions: 4 of 16 CS 441 Discrete mathematics for CS

Conjunction Conjunction Definition: Let p and q be propositions. The proposition "p and q" denoted by p q, is true when both p and q are true and is false otherwise. The proposition p q is called the conjunction of p and q. Examples: Colorado School of Mines is located at west of Denver and 5 + 2 = 8. It is raining today and 2 is a prime number. 2 is a prime number and 5 + 2 8. 13 is a perfect square and 9 is a prime. 5 of 16 CS 441 Discrete mathematics for CS

Disjunction Disjunction Definition: Let p and q be propositions. The proposition "p or q" denoted by p q, is false when both p and q are false and is true otherwise. The proposition p q is called the disjunction of p and q. Examples: Colorado School of Mines is located at west of Denver or 5 + 2 = 8. It is raining today or 2 is a prime number. 2 is a prime number or 5 + 2 8. 13 is a perfect square or 9 is a prime. 6 of 16 CS 441 Discrete mathematics for CS

Truth tables of conjunction Truth tables and disjunction Conjunction and disjunction Four different combinations of values for p and q p q p q p q T T T F F T F F Rows: all possible combinations of values for elementary propositions: 2 n values 7 of 16 CS 441 Discrete mathematics for CS

Truth tables of conjunction Truth tables and disjunction Conjunction and disjunction Four different combinations of values for p and q p q p q p q T T T T F F F T F F F F NB: p q (the or is used inclusively, i.e., p q is true when either p or q or both are true). 7 of 16 CS 441 Discrete mathematics for CS

Truth tables of conjunction Truth tables and disjunction Conjunction and disjunction Four different combinations of values for p and q p q p q p q T T T T T F F T F T F T F F F F NB: p q (the or is used inclusively, i.e., p q is true when either p or q or both are true). 7 of 16 CS 441 Discrete mathematics for CS

Exclusive or Exclusive or Definition: Let p and q be propositions. The proposition "p exclusive or q" denoted by p q, is true when exactly one of p and q is true and it is false otherwise. p q p q T T F T F T F T T F F F 8 of 16 CS 441 Discrete mathematics for CS

CS 441 Discrete mathematics for CS Implication Implication Definition: Let p and q be propositions. The proposition "p implies q" denoted by p q is called implication. It is false when p is true and q is false and is true otherwise. In p q, p is called the hypothesis and q is called the conclusion. 9 of 16 p q p q T T T T F F F T T F F T

Implication Implication p q is read in a variety of equivalent ways: if p then q p only if q p is sufficient for q q whenever p Examples: if Paris is a city of U.S. then 2 is a prime. If F then T? 9 of 16 CS 441 Discrete mathematics for CS

CS 441 Discrete mathematics for CS Implication Implication p q is read in a variety of equivalent ways: if p then q p only if q p is sufficient for q q whenever p Examples: if Paris is a city of U.S. then 2 is a prime. T if today is Tuesday then 2 * 3 = 8. What is the truth value? 9 of 16

Implication Implication p q is read in a variety of equivalent ways: if p then q p only if q p is sufficient for q q whenever p Examples: if Paris is a city of U.S. then 2 is a prime. T if today is Tuesday then 2 * 3 = 8. If T then F 9 of 16 CS 441 Discrete mathematics for CS

CS 441 Discrete mathematics for CS Implication Implication p q is read in a variety of equivalent ways: if p then q p only if q p is sufficient for q q whenever p Examples: if Paris is a city of U.S. in 2013 then 2 is a prime. T if today is Thursday then 2 * 3 = 8. F 9 of 16

Implication Implication The converse of p q is q p. The contrapositive of p q is q p The inverse of p q is p q 9 of 16 CS 441 Discrete mathematics for CS

Implication Implication The converse of p q is q p. The contrapositive of p q is q p The inverse of p q is p q Examples: If it snows, the traffic moves slowly. p: it snows q: traffic moves slowly. p q The converse: q p 9 of 16 CS 441 Discrete mathematics for CS

Implication Implication The converse of p q is q p. The contrapositive of p q is q p The inverse of p q is p q Examples: If it snows, the traffic moves slowly. p: it snows q: traffic moves slowly. p q The converse: If the traffic moves slowly then it snows. q p 9 of 16 CS 441 Discrete mathematics for CS

CS 441 Discrete mathematics for CS Implication Implication The contrapositive of p q is q p The inverse of p q is p q Examples: If it snows, the traffic moves slowly. The contrapositive: q p The inverse: p q 9 of 16

CS 441 Discrete mathematics for CS Implication Implication The contrapositive of p q is q p The inverse of p q is p q Examples: If it snows, the traffic moves slowly. The contrapositive: If the traffic does not move slowly then it does not snow. q p The inverse: p q 9 of 16

CS 441 Discrete mathematics for CS Implication Implication The contrapositive of p q is q p The inverse of p q is p q Examples: If it snows, the traffic moves slowly. The contrapositive: If the traffic does not move slowly then it does not snow. q p The inverse: If it does not snow the traffic moves quickly. p q 9 of 16

Biconditional Biconditional Definition: Let p and q be propositions. The biconditional p q (read p if and only if q), is true when p and q have the same truth values and is false otherwise. p q p q T T T T F F F T F F F T Note: two truth values always agree. 10 of 16 CS 441 Discrete mathematics for CS

Propositional logic: review Propositional logic: 11 of 16

Propositional logic: review Propositional logic: a formal language for representing knowledge and for making logical inferences. 11 of 16

Propositional logic: review Propositional logic: a formal language for representing knowledge and for making logical inferences. A proposition 11 of 16

Propositional logic: review Propositional logic: a formal language for representing knowledge and for making logical inferences. A proposition is a statement that is either True or False. 11 of 16

Propositional logic: review Propositional logic: a formal language for representing knowledge and for making logical inferences. A proposition is a statement that is either True or False. A compound proposition can be created from other propositions using logical connectives. The truth of a compound proposition is defined by truth values of elementary propositions and the meaning of connectives. The truth table for a compound proposition: table with entries (rows) for all possible combinations of truth values of elementary propositions. 11 of 16

Propositional logic: review compound propositions Given the following two propositions: p: 2 is a prime. True q: 6 is a prime. False Determine the truth value of the following statements: p: p q: p q: p q: p q: p q: q p: 12 of 16

Propositional logic: review compound propositions Given the following two propositions: p: 2 is a prime. True q: 6 is a prime. False Determine the truth value of the following statements: p: False p q: p q: p q: p q: p q: q p: 12 of 16

Propositional logic: review compound propositions Given the following two propositions: p: 2 is a prime. True q: 6 is a prime. False Determine the truth value of the following statements: p: False p q: False p q: p q: p q: p q: q p: 12 of 16

Propositional logic: review compound propositions Given the following two propositions: p: 2 is a prime. True q: 6 is a prime. False Determine the truth value of the following statements: p: False p q: False p q: True p q: p q: p q: q p: 12 of 16

Propositional logic: review compound propositions Given the following two propositions: p: 2 is a prime. True q: 6 is a prime. False Determine the truth value of the following statements: p: False p q: False p q: True p q: True p q: p q: q p: 12 of 16

Propositional logic: review compound propositions Given the following two propositions: p: 2 is a prime. True q: 6 is a prime. False Determine the truth value of the following statements: p: False p q: False p q: True p q: True p q: True p q: q p: 12 of 16

Propositional logic: review compound propositions Given the following two propositions: p: 2 is a prime. True q: 6 is a prime. False Determine the truth value of the following statements: p: False p q: False p q: True p q: True p q: True p q: False q p: 12 of 16

Propositional logic: review compound propositions Given the following two propositions: p: 2 is a prime. True q: 6 is a prime. False Determine the truth value of the following statements: p: False p q: False p q: True p q: True p q: True p q: False q p: True 12 of 16

Propositional logic: review binary logic connectives We have defined five binary logical connectives between two propositions p and q, including,,,,. Are there any others that might be useful? How many binary connectives can there be? Why are some of them not very useful? 13 of 16

Propositional logic: review binary logic connectives We have defined five binary logical connectives between two propositions p and q, including,,,,. Are there any others that might be useful? Yes. How many binary connectives can there be? Why are some of them not very useful? 13 of 16

Propositional logic: review binary logic connectives We have defined five binary logical connectives between two propositions p and q, including,,,,. Are there any others that might be useful? Yes. How many binary connectives can there be? A binary logical connective is defined by a truth table with 4 rows. Each of the four rows may be True or False, so there are 2 4 = 16 possible truth tables, and thus 16 possible connectives. Why are some of them not very useful? 13 of 16

Propositional logic: review binary logic connectives We have defined five binary logical connectives between two propositions p and q, including,,,,. Are there any others that might be useful? Yes. How many binary connectives can there be? A binary logical connective is defined by a truth table with 4 rows. Each of the four rows may be True or False, so there are 2 4 = 16 possible truth tables, and thus 16 possible connectives. Why are some of them not very useful? Six of these are trivial ones that ignore one or both inputs; they correspond to True, False, p, q, p and q. Five of them we have already studied:,,,,. The remaining five are potentially useful: One of them is reverse implication ( instead of ). And the other four are the negations of,,,, the first two of which are sometimes called nand and nor. 13 of 16

Propositional logic: review constructing truth table Constructing the truth table Example: Construct the truth table for Example: constructing the truth table for (p q) ( p q) (p q) ( p q) Rows: all possible combinations of values p q p for p elementary q p q (pq) propositions: ( pq) T T 2 n values T F F T F F 14 of 16 CS 441 Discrete mathematics for CS

Propositional logic: review constructing truth table Constructing the truth table Example: constructing the truth table for (p q) ( p q) p q p p q p q (pq) ( pq) T T F F T F T F Typically the target (unknown) compound proposition and its values Auxiliary compound propositions and their values 14 of 16 CS 441 Discrete mathematics for CS

Propositional logic: review constructing truth table Constructing the truth table Examples: Construct a truth table for Example: constructing the truth table for (p q) ( p q) (p q) ( p q) p q p p q p q (pq) ( pq) T T F T F F T F F F T F F T T T T T F F T T F F 14 of 16 CS 441 Discrete mathematics for CS

Precedence of logic connectives Precedence of Logical Operators Precedence of Logical Operators. Operator 15 of 16 Precedence 1 2 3 4 5 We can construct compound propositions using the negation defined so far. We will generally use parentheses to specify t in a compound proposition are to be applied. For instance, of p q and r. However, to reduce the number of parent operator is applied before all other logical operators. This m of p and q, namely, ( p) q, not the negation of the conjun Another general rule of precedence is that the conjunct the disjunction operator, so that p q r means (p q) this rule may be difficult to remember, we will continue to u the disjunction and conjunction operators is clear. Finally, it is an accepted rule that the conditional and have lower precedence than the conjunction and disjunction p q r is the same as (p q) r. We will use paren ditional operator and biconditional operator is at issue, alth precedence over the biconditional operator. Table 8 displays operators,,,,, and.

Precedence of logic connectives Precedence of Logical Operators. Operator 15 of 16 Precedence 1 2 3 4 5 Precedence of Logical Operators Examples We can construct compound propositions using the negation defined so far. iswe applied will generally before use other parentheses connectives: to specify t in a compound proposition are to be applied. For instance, of p q and r. However, to reduce the number of parent operator is applied before all other logical operators. This m of p and q, namely, is applied ( p) before q, : not the negation of the conjun Another general rule of precedence is that the conjunct the disjunction operator, so that p q r means (p q) this rule may be difficult to remember, we will continue to u and have lower precedence than the disjunction and conjunction operators is clear. and : Finally, it is an accepted rule that the conditional and have lower precedence than the conjunction and disjunction p q r is the same as (p q) r. We will use paren ditional operator and biconditional operator is at issue, alth precedence over the biconditional operator. Table 8 displays operators,,,,, and.

Precedence of logic connectives Precedence of Logical Operators. Operator 15 of 16 Precedence 1 2 3 4 5 Precedence of Logical Operators Examples We can construct compound propositions using the negation defined so far. iswe applied will generally before use other parentheses connectives: to specify t in a compound proposition are to be applied. For instance, p q is same as p ( q). of p q and r. However, to reduce the number of parent operator is applied before all other logical operators. This m of p and q, namely, is applied ( p) before q, : not the negation of the conjun Another general rule of precedence is that the conjunct the disjunction operator, so that p q r means (p q) this rule may be difficult to remember, we will continue to u and have lower precedence than the disjunction and conjunction operators is clear. and : Finally, it is an accepted rule that the conditional and have lower precedence than the conjunction and disjunction p q r is the same as (p q) r. We will use paren ditional operator and biconditional operator is at issue, alth precedence over the biconditional operator. Table 8 displays operators,,,,, and.

Precedence of logic connectives Precedence of Logical Operators. Operator 15 of 16 Precedence 1 2 3 4 5 Precedence of Logical Operators Examples We can construct compound propositions using the negation defined so far. iswe applied will generally before use other parentheses connectives: to specify t in a compound proposition are to be applied. For instance, p q is same as p ( q). of p q and r. However, to reduce the number of parent operator is applied before all other logical operators. This m of p and q, namely, is applied ( p) before q, : not the negation of the conjun Another general p q rule r isofsame precedence as (p isq) that r. the conjunct the disjunction operator, so that p q r means (p q) this rule may be difficult to remember, we will continue to u and have lower precedence than the disjunction and conjunction operators is clear. and : Finally, it is an accepted rule that the conditional and have lower precedence than the conjunction and disjunction p q r is the same as (p q) r. We will use paren ditional operator and biconditional operator is at issue, alth precedence over the biconditional operator. Table 8 displays operators,,,,, and.

Precedence of logic connectives Precedence of Logical Operators. Operator 15 of 16 Precedence 1 2 3 4 5 Precedence of Logical Operators Examples We can construct compound propositions using the negation defined so far. iswe applied will generally before use other parentheses connectives: to specify t in a compound proposition are to be applied. For instance, p q is same as p ( q). of p q and r. However, to reduce the number of parent operator is applied before all other logical operators. This m of p and q, namely, is applied ( p) before q, : not the negation of the conjun Another general p q rule r isofsame precedence as (p isq) that r. the conjunct the disjunction operator, so that p q r means (p q) this rule may be difficult to remember, we will continue to u and have lower precedence than the disjunction and conjunction operators is clear. and : Finally, it is an accepted rule that the conditional and have lower precedence p q than r is the same conjunction as (p q) and disjunction r. p q r is the same as (p q) r. We will use paren ditional operator and biconditional operator is at issue, alth precedence over the biconditional operator. Table 8 displays operators,,,,, and.

Copyright statement This slide set is designed only for academic use for the course of CSCI-358 Discrete Mathematics at the Department of Electrical Engineering and Computer Science of Colorado School of Mines. Some contents in this slide set are obtained from Internet and maybe copyright sensitive. Copyright and all rights therein are retained by the respective authors or by other copyright holders. Distributing or reposting the whole or part of this slide set not for academic purpose is HIGHLY prohibited without the explicit permissions of all copyright holders. 16 of 16