LECTURE 7 RMIT University; Taylor's College T o c o m b i n e propositions using connectives T o c o n s t r u c t t h e truth table of a given compound proposition T o d e f i n e d e M o r g a n Law for logic T o d e f i n e t h e difference between a predicate and a proposition T o u s e a q u a n t i f i e r in a predicate 1 NEGATION: A REVISION Let P be a proposition. It has a truth value of T (for true) or F (for false). Its negation is “not P”, denoted by ~P. P ~P T F F T When P is true, ~P is false. When P is false, ~P is true. Truth table for Negation RMIT University; Taylor's College 2 COMBINING PROPOSITIONS Let P and Q be propositions. They can be combined in various ways. Conjunction (AND) PQ Disjunction (OR) PQ Implication (if P then Q) PQ Equivalence (P if and only if Q) PQ RMIT University; Taylor's College 3 COMPOUND PROPOSITIONS Expressions created using the five connectives ~,,, , are called compound propositions. We combine elementary (or constituent) propositions to create compound propositions. The truth values of the constituent propositions determine the truth values of a compound proposition. RMIT University; Taylor's College 4 TRUTH TABLES P Q P Q P Q T T F F T F T F T F F F T T F F T F T F P Q P Q P Q T T F F T F T F T T F F T F T F RMIT University; Taylor's College P Q P Q 5 EXAMPLE 1 a) Construct the truth table for the compound proposition ~ P Q P Q ~ P Q b) Construct the truth table for the compound proposition ( P Q) (Q P) P Q ( P Q) (Q P) RMIT University; Taylor's College 6 EXAMPLE 2 a) Construct the truth table for the compound propositions ( P Q ) and P Q. b) What is the relationship between these two compound propositions? ( P Q) P Q RMIT University; Taylor's College 7 DE MORGAN LAWS FOR LOGIC ( P Q) P Q ( P Q) P Q Consequence: Any expression using “or” can be replaced by an expression using “and” and “not” “I’ll watch G. I. Joe or Final Destination 4 this weekend” is logically equivalent to “It’s not true that I won’t watch G.I. Joe and that I won’t watch Final Destination 4 this weekend” RMIT University; Taylor's College 8 HIERARCHY OF CONNECTIVES ~,,, , Example 3: Construct the truth table for the following compound proposition. PQ PQ RMIT University; Taylor's College 9 TAUTOLOGY, CONTRADICTION, CONTINGENCY If the last column in a truth table has only T (for true), then the compound proposition is called a tautology If the last column in a truth table has only F (for false), then the compound proposition is called a contradiction If a compound proposition is neither a tautology nor a contradiction then the last column of the truth table will have both T and F appearing. Such a compound proposition is called a contingency RMIT University; Taylor's College 10 EXAMPLE 4 Show that the following is a contradiction. ( P Q) ~ P RMIT University; Taylor's College 11 LOGICAL EQUIVALENCES Several logical equivalences have been established P Q ~ P Q P Q ( P Q) (Q P) ( P Q) P Q ( P Q) P Q RMIT University; Taylor's College 12 LOGICAL EQUIVALENCES Consequence: All compound propositions can be expressed using only two connectives: negation and conjunction, or negation and disjunction, or negation and implication Example: “If dogs have humps then the moon is green” is equivalent to “Dogs don’t have humps or the moon is green”. RMIT University; Taylor's College 13 PROPOSITIONS VS. PREDICATES A proposition has to be unambiguously true or false. In contrast, a predicate is a statement involving at least one variable, for example, the variable x. The truth value may depend on the value of x. Example: Let P(x) mean “x is an integer”. Then P(2) is true, but P(π) is false. Example: Let Y(t) mean “my friend t wears glasses”. Then Y(Albert) may be true, while Y(Aaron) may be false. RMIT University; Taylor's College 14 PREDICATE LOGIC What values is the variable allowed to take? There may be several variables. Example, let T( x, y) mean x and y are relatively prime. The variables have to range over some set D, called the domain of interpretation or the universe of discourse. RMIT University; Taylor's College 15 EXAMPLE 5 Let the domain of interpretation for a predicate T( x, y) be D = Z = the set of all integers. Let T(x, y) mean that x and y are relatively prime. Then T(10, 21) is true while T(12, 15) is false. Why? RMIT University; Taylor's College 16 QUANTIFIERS It’s natural to introduce the idea of a quantifier when we’re considering predicates. These tell us how often the predicate is true “for all” “there exists” Predicate logic involves statements like this: xP( x ) [ for all x, P(x) is true ] xyP (x ) [ for all x there exists y such that P(x, y) is true ] RMIT University; Taylor's College 17