Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)

Slides:



Advertisements
Similar presentations
TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Advertisements

1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: The Moon is made of green cheese. Trenton.
CS128 – Discrete Mathematics for Computer Science
Logic Chapter 2. Proposition "Proposition" can be defined as a declarative statement having a specific truth-value, true or false. Examples: 2 is a odd.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Section 1.1 Logic. 2 Proposition Statement that is either true or false –can’t be both –in English, must contain a form of “to be” Examples: –Cate Sheller.
Introduction to Logic Sections 1.1 and 1.2 of Rosen Fall 2010 CSCE 235 Introduction to Discrete Structures URL: cse.unl.edu/~cse235 Questions:
Proofs Using Logical Equivalences Rosen 1.2 List of Logical Equivalences p  T  p; p  F  pIdentity Laws p  T  T; p  F  FDomination Laws p  p.
Adapted from Discrete Math
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
The Foundations: Logic and Proofs
Propositions and Truth Tables
1.1 Sets and Logic Set – a collection of objects. Set brackets {} are used to enclose the elements of a set. Example: {1, 2, 5, 9} Elements – objects inside.
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
Propositions and Truth Tables. Proposition: Makes a claim that may be either true or false; it must have the structure of a complete sentence.
The Foundations: Logic and Proofs
Discrete Maths 2. Propositional Logic Objective
Discrete Mathematics and Its Applications
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
Chapter 1: The Foundations: Logic and Proofs
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Review I Rosen , 3.1 Know your definitions!
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
The Foundations Logic and Proofs by raedRASHEED 2014.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
Chapter 2: The Logic of Compound Statements 2.2 Conditional Statements
Lecture 4. CONDITIONAL STATEMENTS: Consider the statement: "If you earn an A in Math, then I'll buy you a computer." This statement is made up of two.
Lecture Propositional Equivalences. Compound Propositions Compound propositions are made by combining existing propositions using logical operators.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are.
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Section 1.2: Propositional Equivalences In the process of reasoning, we often replace a known statement with an equivalent statement that more closely.
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Chapter 1: The Foundations: Logic and Proofs
The Foundations: Logic and Proof, Sets, and Foundations PROPOSITIONS A proposition is a declarative sentence that is either True or False, but not the.
Section 1.1. Section Summary Propositions Connectives Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional Truth.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
LECTURE 1. Disrete mathematics and its application by rosen 7 th edition THE FOUNDATIONS: LOGIC AND PROOFS 1.1 PROPOSITIONAL LOGIC.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Section 1.1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: a) The Moon is made of green.
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
3/6/20161 Let’s get started with... Logic !. 3/6/20162 Logic Crucial for mathematical reasoningCrucial for mathematical reasoning Used for designing electronic.
Conditional statement or implication IF p then q is denoted p ⇒ q p is the antecedent or hypothesis q is the consequent or conclusion ⇒ means IF…THEN.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
CS104 The Foundations: Logic and Proof 1. 2 What is Discrete Structure?  Discrete Objects  Separated from each other (Opposite of continuous)  e.g.,
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Chapter 1 Logic and proofs
Propositional Logic. Logic Logic: the science of reasoning, proof, thinking or inference. Logic allows us to analyze a piece of reasoning and determine.
Logical Operators (Connectives) We will examine the following logical operators: Negation (NOT,  ) Negation (NOT,  ) Conjunction (AND,  ) Conjunction.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
2. The Logic of Compound Statements Summary
Propositional Logic.
The Foundations: Logic and Proofs
Principles of Computing – UFCFA3-30-1
Propositional Equivalences
Information Technology Department
CS 220: Discrete Structures and their Applications
Discrete Mathematics and Its Applications Kenneth H
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
The Foundations: Logic and Proofs
Presentation transcript:

Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)

Proposition A proposition is a statement that is either true or false, but not both. Atlanta was the site of the 1996 Summer Olympic games. 1+1 = 2 3+1 = 5 What will my ITCS2175 grade be?

Definition 1. Negation of p Let p be a proposition. The statement “It is not the case that p” is also a proposition, called the “negation of p” or ¬p (read “not p”) Table 1. The Truth Table for the Negation of a Proposition p ¬p T F F T p = The sky is blue. p = It is not the case that the sky is blue. p = The sky is not blue.

Definition 2. Conjunction of p and q 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. This is called the conjunction of p and q. Table 2. The Truth Table for the Conjunction of two propositions p q pq T T T T F F F T F F F F

Definition 3. Disjunction of p and q Let p and q be propositions. The proposition “p or q,” denoted by pq, is the proposition that is false when p and q are both false and true otherwise. Table 3. The Truth Table for the Disjunction of two propositions p q pq T T T T F T F T T F F F

Definition 4. Exclusive or of p and q Let p and q be propositions. The exclusive or of p and q, denoted by pq, is the proposition that is true when exactly one of p and q is true and is false otherwise. Table 4. The Truth Table for the Exclusive OR of two propositions p q pq T T F T F T F T T F F F

Definition 5. Implication pq Let p and q be propositions. The implication pq is the proposition that is false when p is true and q is false, and true otherwise. In this implication p is called the hypothesis (or antecedent or premise) and q is called the conclusion (or consequence). Table 5. The Truth Table for the Implication of pq. p q pq T T T T F F F T T F F T

Implications If p, then q p implies q if p,q p only if q p is sufficient for q q if p q whenever p q is necessary for p Not the same as the if-then construct used in programming languages such as If p then S

Implications How can both p and q be false, and pq be true? Think of p as a “contract” and q as its “obligation” that is only carried out if the contract is valid. Example: “If you make more than $25,000, then you must file a tax return.” This says nothing about someone who makes less than $25,000. So the implication is true no matter what someone making less than $25,000 does. Another example: p: Bill Gates is poor. q: Pigs can fly. pq is always true because Bill Gates is not poor. Another way of saying the implication is “Pigs can fly whenever Bill Gates is poor” which is true since neither p nor q is true.

Related Implications Converse of p  q is q  p Contrapositive of p  q is the proposition q  p

Definition 6. Biconditional Let p and q be propositions. The biconditional pq is the proposition that is true when p and q have the same truth values and is false otherwise. “p if and only if q, p is necessary and sufficient for q” Table 6. The Truth Table for the biconditional pq. p q pq T T T T F F F T F F F T

Practice p: You learn the simple things well. q: The difficult things become easy. The difficult things become easy but you did not learn the simple things well. You learn the simple things well but the difficult things did not become easy. You do not learn the simple things well. If you learn the simple things well then the difficult things become easy. If you do not learn the simple things well, then the difficult things will not become easy.

Practice p: You learn the simple things well. q: The difficult things become easy. The difficult things become easy but you did not learn the simple things well. You learn the simple things well but the difficult things did not become easy. You do not learn the simple things well. If you learn the simple things well then the difficult things become easy. If you do not learn the simple things well, then the difficult things will not become easy. p q  p pq p  q p  q

Truth Table Puzzle Steve would like to determine the relative salaries of three coworkers using two facts (all salaries are distinct): If Fred is not the highest paid of the three, then Janice is. If Janice is not the lowest paid, then Maggie is paid the most. Who is paid the most and who is paid the least?

p : Janice is paid the most. q: Maggie is paid the most. r: Fred is paid the most. s: Janice is paid the least. p q r s rp s q (rp) (sq) T F F F T F F F T F T F T F F F T T T T T F T F F F T F F F T F T F F Fred, Maggie, Janice If Fred is not the highest paid of the three, then Janice is. If Janice is not the lowest paid, then Maggie is paid the most. Only 5 entries because the other combinations are contradictory (i.e., Janice and Fred cannot be paid the most at the same time if salaries are distinct.

p : Janice is paid the most. q: Maggie is paid the most. r: Fred is paid the most. s: Janice is paid the least. p q r s rp s q (rp) (sq) T F F F T T T F T F T F T F F F T T T F F F T F F F T F F F T F T T T Fred, Janice, Maggie or Janice, Maggie, Fred or Janice, Fred, Maggie If Fred is not the highest paid of the three, then Janice is. If Janice is the lowest paid, then Maggie is paid the most.

Bit Operations A computer bit has two possible values: 0 (false) and 1 (true). A variable is called a Boolean variable if its value is either true or false. Bit operations correspond to the logical connectives:  OR  AND  XOR Information can be represented by bit strings, which are sequences of zeros and ones, and manipulated by operations on the bit strings.

Truth tables for the bit operations OR, AND, and XOR  0 1 0 0 1 1 1 0  0 1 0 0 1 1 1 1  0 1 0 0 0 1 0 1

Logical Equivalence An important technique in proofs is to replace a statement with another statement that is “logically equivalent.” Tautology: compound proposition that is always true regardless of the truth values of the propositions in it. Contradiction: Compound proposition that is always false regardless of the truth values of the propositions in it.

Logically Equivalent Compound propositions P and Q are logically equivalent if PQ is a tautology. In other words, P and Q have the same truth values for all combinations of truth values of simple propositions. This is denoted: PQ (or by P Q)

Example: DeMorgans Prove that (pq)  (p  q) p q (pq) (pq) p q (p  q) T T T F F T F F T F F F F T F F T F T F T F F F T T T T

Illustration of De Morgan’s Law (pq) p q

Illustration of De Morgan’s Law p p

Illustration of De Morgan’s Law q q

Illustration of De Morgan’s Law p  q p q

Example: Distribution Prove that: p  (q  r)  (p  q)  (p  r) p q r qr p(qr) pq pr (pq)(pr) T T T T T T T T T T F F T T T T T F T F T T T T T F F F T T T T F T T T T T T T F T F F F T F F F F T F F F T F F F F F F F F F

Prove: pq(pq)  (qp) p q pq pq qp (pq)(qp) T T T T T T T F F F T F F T F T F F F F T T T T We call this biconditional equivalence.

List of Logical Equivalences pT  p; pF  p Identity Laws pT  T; pF  F Domination Laws pp  p; pp  p Idempotent Laws (p)  p Double Negation Law pq  qp; pq  qp Commutative Laws (pq) r  p (qr); (pq)  r  p  (qr) Associative Laws

List of Equivalences p(qr)  (pq)(pr) Distribution Laws (pq)(p  q) De Morgan’s Laws (pq)(p  q) Miscellaneous p  p  T Or Tautology p  p  F And Contradiction (pq)  (p  q) Implication Equivalence pq(pq)  (qp) Biconditional Equivalence