Today s Topic: Propositional Logic

Similar documents
Discrete Structures for Computer Science

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

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

CSC Discrete Math I, Spring Propositional Logic

Compound Propositions

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

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

EECS 1028 M: Discrete Mathematics for Engineers

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

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

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

Chapter 1, Section 1.1 Propositional Logic

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

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

Discrete Mathematics

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

Introduction Propositional Logic

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

Lecture 02: Propositional Logic

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

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

Discrete Mathematics and Its Applications

Boolean Logic. CS 231 Dianna Xu

CSE 240 Logic and Discrete Mathematics

DISCRETE STRUCTURES WEEK5 LECTURE1

1.1 Language and Logic

PROPOSITIONAL CALCULUS

Propositional logic ( ): Review from Mat 1348

Definition 2. Conjunction of p and q

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.

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Basic Logic and Proof Techniques

THE LOGIC OF COMPOUND STATEMENTS

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

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

AMTH140 Lecture 8. Symbolic Logic

TRUTH TABLES LOGIC (CONTINUED) Philosophical Methods

Propositional Logic 1

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

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

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

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

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

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

Proofs. Joe Patten August 10, 2018

Overview. 1. Introduction to Propositional Logic. 2. Operations on Propositions. 3. Truth Tables. 4. Translating Sentences into Logical Expressions

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Section 1.1: Logical Form and Logical Equivalence

1.1 Language and Logic

1 The Foundations. 1.1 Logic. A proposition is a declarative sentence that is either true or false, but not both.

Discrete Mathematics and Applications COT3100

Discrete Structures for Computer Science

Propositional Languages

Logic: Propositional Logic (Part I)

Discrete Structures of Computer Science Propositional Logic I

1 Propositional Logic

The statement calculus and logic

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

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

Chapter 5: Section 5-1 Mathematical Logic

CSE 20 DISCRETE MATH. Fall

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

THE LOGIC OF COMPOUND STATEMENTS

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

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

MAT2345 Discrete Math

ICS141: Discrete Mathematics for Computer Science I

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

Propositional Logic. Spring Propositional Logic Spring / 32

software design & management Gachon University Chulyun Kim

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

Introduction Propositional Logic. Discrete Mathematics Andrei Bulatov

Mathematics for linguists

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

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

Manual of Logical Style (fresh version 2018)

Proposition logic and argument. CISC2100, Spring 2017 X.Zhang

Where are my glasses?

A Statement; Logical Operations

MA103 STATEMENTS, PROOF, LOGIC

Introduction. Applications of discrete mathematics:

It is not the case that ϕ. p = It is not the case that it is snowing = It is not. r = It is not the case that Mary will go to the party =

Introduction to Decision Sciences Lecture 2

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

- 1.2 Implication P. Danziger. Implication

FUNDAMENTALS OF MATHEMATICS HANDOUT 1.3 DR. MCLOUGHLIN

The Foundations: Logic and Proofs. Part I

THE LOGIC OF COMPOUND STATEMENTS

CSE 311: Foundations of Computing. Lecture 2: More Logic, Equivalence & Digital Circuits

CSC165 Mathematical Expression and Reasoning for Computer Science

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

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

CSE 20: Discrete Mathematics

We last time we began introducing equivalency laws.

Propositional Logic. Propositional Equivalences. Agenda. Yutaka HATA, IEEE Fellow. Ch1.1 Propositional Logic. Ch1.2 Propositional Equivalences

Propositional Logic, Predicates, and Equivalence

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

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

Section 3.1 Statements, Negations, and Quantified Statements

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Transcription:

Today s Topic: Propositional Logic What is a proposition? Logical connectives and truth tables Translating between English and propositional logic Logic is the basis of all mathematical and analytical reasoning Given a collection of known truths, logic allows us to deduce new truths Example Base facts: If it is raining, I will not go outside If I am inside, Stephanie will come over Stephanie and I always play Scrabble if we are together during the weekend Today is rainy Saturday Conclusion: Stephanie and I will play Scrabble today Logic allows us to advance mathematics through an iterative process of conjecture and proof

Propositional logic is a very simple logic Definition: A proposition is a precise statement that is either true or false, but not both. Examples: 2 + 2 = 4 (true) All dogs have 3 legs (false) x 2 < 0 (false) Washington, D.C. is the capital of the USA (true) Not all statements are propositions Marcia is pretty Pretty is a subjective term. x 3 < 0 True if x < 0, false otherwise. Springfield is the capital True in Illinois, false in Massachusetts.

We can use logical connectives to build complex propositions We will discuss the following logical connectives: (not) (conjunction / and) (disjunction / or) (exclusive or) (implication) (biconditional) Negation The negation of a proposition is true iff the proposition is false What we know What we want to know One row for each possible value of what we know p p T F F T The truth table for negation

Negation Examples Negate the following propositions Today is Monday Today is not Monday 21 * 2 = 42 21 * 2 42 What is the truth value of the following propositions (9 is a prime number) true (Pittsburgh is in Pennsylvania) false Conjunction The conjunction of two propositions is true iff both propositions are true p q p q T T T T F F F T F F F F The truth table for conjunction 2 2 = 4 rows since we know both p and q!

Disjunction The disjunction of two propositions is true if at least one proposition is true p q p q T T T T F T F T T F F F The truth table for disjunction Conjunction and disjunction examples Let: p x 2 > 0 q A lion weighs less than a mouse r 10 < 7 s Pittsburgh is located in Pennsylvania This symbol means is defined as or is equivalent to What are the truth values of these expressions: p q p s p q q r false true true false

Exclusive or (XOR) The exclusive or of two propositions is true if exactly one proposition is true p q p q T T F T F T F T T F F F The truth table for exclusive or Note: Exclusive or is typically used to natural language to identify choices. For example You may have a soup or salad with your entree. Implication The implication p q is false if p is true and q is false, and true otherwise Terminology p is called the hypothesis q is called the conclusion p q p q T T T T F F F T T F F T The truth table for implication

Implication (cont.) The implication p q can be read in a number of (equivalent) ways: If p then q p only if q p is sufficient for q q whenever p Implication examples Let: p Jane gets a 100% on her final q Jane gets an A What are the truth values of these implications: p q q p true false

Other conditional statements Given an implication p q: q p is its converse q p is its contrapositive p q is its inverse Why might this be useful? Note: An implication and its contrapositive always have the same truth value Biconditional The biconditional p q is true if and only if p and q assume the same truth value p q p q T T T T F F F T F F F T The truth table for the biconditional Note: The biconditional statement p q is often read as p if and only if q or p is a necessary and sufficient condition for q.

Truth tables can also be made for more complex expressions Example: What is the truth table for (p q) r? Subexpressions of what we want to know What we want to know 2 3 = 8 rows p q r p q r (p q) r T T T T F F T T F T T T T F T F F T T F F F T T F T T F F T F T F F T T F F T F F T F F F F T T Like mathematical operators, logical operators are assigned precedence levels 1. Negation q r means ( q) r, not (q r) 2. Conjunction 3. Disjunction q r s means (q r) s, not q (r s) 4. Implication q r s means (q r) s, not q (r s) 5. Biconditional In general, we will try to use parenthesis to disambiguate these types of expressions.

Group Exercises Problem 1: Show that an implication p q and its contrapositive q p always have the same value Hint: Construct two truth tables Problem 2: Construct the truth table for the compound proposition p ( q r) s English sentences can often be translated into propositional sentences But why would we do that?!? Philosophy and epistemology Reasoning about law Verifying complex system specifications

Example #1 Example: You can see an R-rated movie only if you are over 17 or you are accompanied by your legal guardian. Let: r You can see an R-rated movie o You are over 17 a You are accompanied by your legal guardian Translation: r (o a) Find logical connectives Translate fragments Create logical expression Example #2 Example: You can have free coffee if you are senior citizen and it is a Tuesday Let: c You can have free coffee s You are a senior citizen t It is a Tuesday Translation: (s t) c

Example #3 Example: If you are under 17 and are not accompanied by your legal guardian, then you cannot see the R-rated movie. Let: r You can see the R-rated movie u You are under 17 a You are accompanied by your legal guardian Translation: (u a) r Note: The above translation is the contrapositive of the translation from example 1! Logic also helps us understand bitwise operations Computers represent data as sequences of bits E.g., 0101 1101 1010 1111 Bitwise logical operations are often used to manipulate these data If we treat 1 as true and 0 as false, our logic truth tables tell us how to carry out bitwise logical operations

Bitwise logic examples 1010 1110 1110 1010 1010 1110 1110 1010 1010 1010 1110 1110 1010 1110 1110 1010 0100 0100 Group Exercises Problem 1: Translate the following sentences If it is raining then I will either play video games or watch a movie You get a free salad only if you order off of the extended menu and it is a Wednesday Problem 2: Solve the following bitwise problems 1011 1000 1010 0110 1011 1000 1010 0110

Final Thoughts Propositional logic is a simple logic that allows us to reason about a variety of concepts