Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.

Slides:



Advertisements
Similar presentations
Propositional Equivalences
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.
The Conditional & Biconditional MATH 102 Contemporary Math S. Rook.
Propositional Equivalences. L32 Agenda Tautologies Logical Equivalences.
Chapter 2. Logic Weiqi Luo ( 骆伟祺 ) School of Software Sun Yat-Sen University : Office : A309
John Rosson Thursday February 15, 2007 Survey of Mathematical Ideas Math 100 Chapter 3, Logic.
Inference Methods Propositional and Predicate Calculus.
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.
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
TRUTH TABLES. Introduction Statements have truth values They are either true or false but not both Statements may be simple or compound Compound statements.
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
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.
The Foundations: Logic and Proofs
Section 1-4 Logic Katelyn Donovan MAT 202 Dr. Marinas January 19, 2006.
Discrete Maths 2. Propositional Logic Objective
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Propositional Equivalences
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.
Fall 2002CMSC Discrete Structures1 Let’s get started with... Logic !
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
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.
Chapter 7 Logic, Sets, and Counting
Conditional Statements
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.
How do I show that two compound propositions are logically equivalent?
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
Section 1.2: Propositional Equivalences In the process of reasoning, we often replace a known statement with an equivalent statement that more closely.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
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 1: The Foundations: Logic and Proofs
Conditional Statements – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Conditional Statements Reading: Kolman, Section 2.2.
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.
Joan Ridgway. If a proposition is not indeterminate then it is either true (T) or false (F). True and False are complementary events. For two propositions,
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
رياضيات متقطعة لعلوم الحاسب 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.
Conditional Statements Lecture 2 Section 1.2 Fri, Jan 20, 2006.
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
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.
Lecture 10 Methods of Proof CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
1 Statements and Operations Statements and operators can be combined in any way to form new statements. PQ PQPQPQPQ  (P  Q) (  P)  (  Q) TTTFF.
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
Logical Operators (Connectives) We will examine the following logical operators: Negation (NOT,  ) Negation (NOT,  ) Conjunction (AND,  ) Conjunction.
2. The Logic of Compound Statements Summary
The Foundations: Logic and Proofs
CSNB 143 Discrete Mathematical Structures
Propositional Equivalences
Information Technology Department
CS 220: Discrete Structures and their Applications
MAT 3100 Introduction to Proof
Presentation transcript:

Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine

CSCI 1900 Lecture Lecture Introduction Reading –Rosen - Sections 1.1, 1.2, 1.4 Additional logical operations –Implication –Equivalence Conditions –Tautology –Contingency –Contradiction / Absurdity

CSCI 1900 Lecture Conditional Statement/Implication "if p then q" Denoted p  q –p is called the antecedent or hypothesis –q is called the consequent or conclusion Example: –p: I am hungry q: I will eat –p: It is snowing q: 3+5 = 8

CSCI 1900 Lecture Conditional Statement (cont) In conversational English, we would assume a cause-and-effect relationship, i.e., the fact that p is true would force q to be true If “it is snowing,” then “3+5=8” is meaningless in this regard since p has no effect at all on q For now, view the operator “  ” as a logic operation similar to conjunction or disjunction (AND or OR)

CSCI 1900 Lecture Truth Table Representing Implication If viewed as a logic operation, p  q can only be evaluated as false if p is true and q is false Again, this does not say that p causes q Truth table pq p  q TTT TFF FTT FFT

CSCI 1900 Lecture Implication Examples If p is false, then any q supports p  q is true –False  True = True –False  False = True If “2+2=5” then “I am the king of England” is true

CSCI 1900 Lecture Truth Table Representing Implication If viewed as a logic operation, p  q is the same as ~p  q, –If p is true and q is false, the implication is false; otherwise the implication is true Truth table pq~p ~p  qp  q TTFTT TFFFF FTTTT FFTTT

CSCI 1900 Lecture Converse and Contrapositive The converse of the implication p  q is the implication q  p The contrapositive of implication p  q is the implication ~q  ~p

CSCI 1900 Lecture Example Example: What is the converse and contrapositive of p: "it is raining" and q: I get wet? –Implication: If it is raining, then I get wet. –Converse: If I get wet, then it is raining. –Contrapositive: If I do not get wet, then it is not raining.

CSCI 1900 Lecture Equivalence or Biconditional

CSCI 1900 Lecture Equivalence Truth Table The only time an equivalence evaluates as true is if both statements, p and q, are true or both are false pq pqpq TTT TFF FTF FFT

CSCI 1900 Lecture Properties Commutative Properties –p  q = q  p –p  q = q  p Associative Properties –(a  b)  c = a  (b  c) –(a  b)  c = a  (b  c)

CSCI 1900 Lecture Properties Distributive Properties (prove by Truth Tables) –a  (b  c) = (a  b)  (a  c) –a  (b  c) = (a  b)  (a  c) Idempotent properties – a  a =a – a  a =a

CSCI 1900 Lecture Negation Properties } De Morgan’s Laws

CSCI 1900 Lecture Proof of the Contrapositive Compute the truth table of the statement (p  q)  (~q  ~p) pq p  q ~q~p ~q  ~p(p  q)  (~q  ~p) TTTFFTT TFFTFFT FTTFTTT FFTTTTT

CSCI 1900 Lecture Tautology and Contradiction A statement that is true for all values of its propositional variables is called a tautology –The previous truth table was a tautology A statement that is false for all values of its propositional variables is called a contradiction or an absurdity

CSCI 1900 Lecture Contingency A statement that can be either true or false depending on the values of its propositional variables is called a contingency Examples –(p  q)  (~q  ~p) is a tautology –p  ~p is an absurdity –(p  q)  ~p is a contingency since some cases evaluate to true and some to false

CSCI 1900 Lecture Contingency Example The statement (p  q)  (p  q) is a contingency pq p  qp  q(p  q)  (p  q) TTTTT TFFTF FTTTT FFTFF

CSCI 1900 Lecture Logically Equivalent Two propositions are logically equivalent or simply equivalent if p  q is a tautology Denoted p  q

CSCI 1900 Lecture Example of Logical Equivalence Columns 5 and 8 are equivalent pqr q  rp  (q  r) p  qp  r(p  q)  ( p  r) p  (q  r)  ( p  q)  ( p  r) TTTTTTTTT TTFFTTTTT TFTFTTTTT TFFFTTTTT FTTTTTTTT FTFFFTFFT FFTFFFTFT FFFFFFFFT

CSCI 1900 Lecture Key Concepts Summary Additional logical operations –Implication –Equivalence Conditions –Tautology –Contingency –Contradiction / Absurdity