COS 150 Discrete Structures Assoc. Prof. Svetla Boytcheva Fall semester 2014
Lecture № 2 Fundamentals of Logic
Outline Logical Form and Logical Equivalence Logical Equivalence; Tautologies and Contradictions; Summary of Logical Equivalences Conditional Statements Representation of If-Then As Or ; The Negation of a Conditional Statement; The Contrapositive of a Conditional Statement; The Converse and Inverse of a Conditional Statement; Only If and the Biconditional; Necessary and Sufficient Conditions; Valid and Invalid Arguments Modus Ponens and Modus Tollens; Additional Valid Argument Forms: Rules of Inference;
Playing with implication 10/23/2015
Playing with implication 10/23/2015
Truth Table of equivalence 10/23/2015
Logically Equivalent Statements 10/23/2015
Tautologies 10/23/2015
Contradictions 10/23/2015
Logic Equivalences 10/23/2015 or
Why this is important? 10/23/2015
Examples 10/23/2015
Examples 10/23/2015
Equivalence and Tautology 10/23/2015
Example 10/23/2015
Examples 10/23/2015
Truth Tables 10/23/2015 pq pqpqqpqppqpq pp qq pqpq (p q) p q FFFFTTTTTT FTTTTTFTFF TFTTFFTFFF TTTTTFFTFF
Double Negation 10/23/2015
DeMorgan’s Laws 10/23/2015 pq pqpqpqpq pp qq p q (p q) (p q) p q FFFFTTTTTT FTTFTFTFTF TFTFFTTFTF TTTTFFFFFF
Example Write in C++ the condition for floating point variable size, in which the message “Present” will be displayed for the following code fragment if ( size > 25 || size == 19 ) cout<<”Future”; else if ( size 2) cout<<"Past"; else cout <<"Present"; 10/23/2015
“Algebraic” Laws of Logic 10/23/2015
“Logic” Laws of Logic 10/23/2015
Number of Rows in Truth Table 10/23/2015
Expressing Connectives 10/23/2015
Example 10/23/2015
Example 10/23/2015
Example: Decreasing number of comparisons 10/23/2015
Example: Decreasing number of comparisons 10/23/2015
Example 10/23/2015
Example 10/23/2015
Logic Inference
First Law of Substitution 10/23/2015
Second Law of Substitution 10/23/2015
Logic inference 10/23/2015
Inference and Tautology 10/23/2015
General Definition of Inference 10/23/2015
Examples Tautology X X Logical Contradiction X X Negation of Tautology Valid – if all values are true – the logic value is true X Y X Y Logic Equivalence 10/23/2015 and
Inference Rules “Modus ponens" "Modus tollens” 10/23/2015
Modus Ponens 10/23/2015
Rule of Tollens 10/23/2015
Example 10/23/2015
MORE READING: CHAPTER 2 SUSANNA S. EPP, DISCRETE MATHEMATICS WITH APPLICATIONS Questions? 10/23/2015