Presentation on theme: "Chapter 1: The Foundations: Logic and Proofs"— Presentation transcript:
1 Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic1.2 Propositional Equivalences1.3 Predicates and Quantifiers1.4 Nested Quantifiers1.5 Rules of Inference1.6 Introduction to Proofs1.7 Proof Methods and Strategy
2 1.1: Propositional LogicPropositions: A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either true or false, but not both.
3 Example 1:All the following declarative sentences are propositions:Washington D.C., is the capital of the USA.2. Toronto is the capital of Canada3. 1+1=2.=3.
4 Example 2:Consider the following sentences. Are they propositions?1. What time is it?2. Read this carefully.3. x+1=2.4. x+y=z
5 We use letters to denote propositional variables (or statement variables). T: the value of a proposition is true.F: the value of a proposition is false.The area of logic that deals with propositions is called the propositional calculus or propositional logic.
6 Let p and q are propositions: Definition 1: Negation (Not) Symbol: ¬ Statement: “it is not the case that p”.Example:P: I am going to town¬P:It is not the case that I am going to town;I am not going to town;I ain’t goin’.
7 p:\msoffice\My Projects\Rosen 6e 2007\Imagebank\JPEGs07-24-06\ch01\jpeg\t01_1_001.jpg
8 Definition 2: Conjunction (And) Symbol:The conjunction pq is true when both p and q are true and is false otherwise.Example:P - ‘I am going to town’Q - ‘It is going to rain’PQ: ‘I am going to town and it is going to rain.’
9 t01_1_002.jpgp:\msoffice\My Projects\Rosen 6e 2007\Imagebank\JPEGs \ch01\jpeg\t01_1_002.jpg
10 Definition 3: Disjunction (Or) Symbol:The disjunction pq is false when both p and q are false and is true otherwise.Example:P - ‘I am going to town’Q - ‘It is going to rain’P Q: ‘I am going to town or it is going to rain.’
11 p:\msoffice\My Projects\Rosen 6e 2007\Imagebank\JPEGs07-24-06\ch01\jpeg\t01_1_003.jpg
12 Definition 4: Exclusive OR Symbol:The exclusive or of p and q, denote pq, is true when exactly one of p and q is true and is false otherwise.Example:P - ‘I am going to town’Q - ‘It is going to rain’P Q: ‘Either I am going to town or it is going to rain.’
13 p:\msoffice\My Projects\Rosen 6e 2007\Imagebank\JPEGs07-24-06\ch01\jpeg\t01_1_004.jpg
14 Definition 5: Implication If…. Then….Symbol:The conditional statement pq is false when p is true and q is false, and trueP is called the hypothesis and q is called the conclusion.Example:P - ‘I am going to town’Q - ‘It is going to rain’P Q: ‘If I am going to town then it is going to rain.’
15 p:\msoffice\My Projects\Rosen 6e 2007\Imagebank\JPEGs07-24-06\ch01\jpeg\t01_1_005.jpg
16 Equivalent Forms If P, then Q P implies Q If P, Q P only if Q P is a sufficient condition for QQ if PQ whenever PQ is a necessary condition for P
17 Note: The implication is false only when P is true and Q is false! ‘If the moon is made of green cheese then I have more money than Bill Gates’ (?)‘If the moon is made of green cheese then I’m on welfare’ (?)‘If 1+1=3 then your grandma wears combat boots’ (?)‘If I’m wealthy then the moon is not made of greencheese.’ (?)‘If I’m not wealthy then the moon is not made of green cheese.’ (?)
18 More terminology QP is the CONVERSE of P Q ¬ Q ¬ P is the CONTRAPOSITIVE of P Q¬ P ¬ Q is the inverse of P QExample:Find the converse of the following statement:R: ‘Raining tomorrow is a sufficient condition for my not going to town.’
19 ProcedureStep 1: Assign propositional variables to component propositionsP: It will rain tomorrowQ: I will not go to townStep 2: Symbolize the assertionR: P QStep 3: Symbolize the converseQ PStep 4: Convert the symbols back into words‘If I don’t go to town then it will rain tomorrow’Homework: Find inverse and contrapositive of statements above.
20 Definition 6: Biconditional ‘if and only if’, ‘iff’Symbol:The biconditional statement pq is true when p and q have the same truth value, and is false otherwise.Biconditional statements are also called bi-implications.Example:P - ‘I am going to town’Q - ‘It is going to rain’P Q: ‘I am going to town if and only if it is going to rain.’
21 p:\msoffice\My Projects\Rosen 6e 2007\Imagebank\JPEGs07-24-06\ch01\jpeg\t01_1_006.jpg
22 Translating EnglishBreaking assertions into component propositions - look for the logical operators!Example:‘If I go to Harry’s or go to the country I will not goshopping.’P: I go to Harry’sQ: I go to the countryR: I will go shoppingIf......P......or.....Q.....then....not.....R(P Q) ¬ R
23 Constructing a truth table one column for each propositional variableone for the compound propositioncount in binaryn propositional variables = 2n rowsConstruct the truth table for(P ¬ Q) (PQ)HW: Construct the truth table for (P Q) ¬ R
24 p:\msoffice\My Projects\Rosen 6e 2007\Imagebank\JPEGs07-24-06\ch01\jpeg\t01_1_007.jpg
25 t01_1_008.jpgp:\msoffice\My Projects\Rosen 6e 2007\Imagebank\JPEGs \ch01\jpeg\t01_1_008.jpg
26 What is the real meaning of ¬ PQ ? a) (¬ P) Qb) ¬ (PQ)What is the real meaning of PQR ?a) (PQ)Rb) P(QR)What is the real meaning of P QR ?a) (P Q)Rb) P (QR)
27 p:\msoffice\My Projects\Rosen 6e 2007\Imagebank\JPEGs07-24-06\ch01\jpeg\t01_1_009.jpg
28 Logic and Bit Operations Example 20Find the bitwise OR, bitwise AND, and bitwise XOR of the bit stringsand
29 Logic Puzzles Example 18: There are two kind of inhabitants, knights, who always tell the truth, and their opposites, knaves, who always lie. You encounter two people A and B. What are A and B if A says “B is a knight” and B says “The two of us are opposite type”?
30 Proposition Negation Conjection Disjunction Exclusive OR Implication TermsPropositionNegationConjectionDisjunctionExclusive ORImplicationInverseConverseContrapositive