Logic Truth Tables Propositions Implications Statements Logic is
Logic Truth Tables, Propositions, Implications
Statements • Logic is the tool for reasoning about the truth or falsity of statements. – Propositional logic is the study of Boolean functions – Predicate logic is the study of quantified Boolean functions (first order predicate logic)
Arithmetic vs. Logic Arithmetic 0 1 Boolean variable form of function value of function equality of function Logic false true statement variable statement form truth value of statement equivalence of statements
Notation Word and or implies equivalent not parentheses Symbol v w 6 ] ~ 5 ( ) used for grouping terms
Notation Examples English A and B A or B A implies B A is equivalent to B not A Symbolic Av. B Aw. B A 6 B A]B ~A 5 A
Statement Forms • (p v q) and (q v p) are different as statement forms. They look different. • (p v q) and (q v p) are logically equivalent. They have the same truth table. • A statement form that represents the constant 1 function is called a tautology. It is true for all truth values of the statement variables. • A statement form that represents the constant 0 function is called a contradiction. It is false for all truth values of the statement variables.
Truth Tables - NOT P T F 5 P F T
Truth Tables - AND P T T F F Q T F Pv. Q T F F F
Truth Tables - OR P T T F F Q T F Pw. Q T T T F
Truth Tables - EQUIVALENT P T T F F Q T F P]Q T F F T
Truth Tables - IMPLICATION P T T F F Q T F P 6 Q T F T T
Truth Tables - Example P P Q Q true false means rain means no rain means clouds means no clouds
Truth Tables - Example P rain no rain Q clouds no clouds P 6 Q rain clouds rain no clouds no rain no clouds P 6 Q T F T T
Algebraic rules for statement forms • Associative rules: (p v q) v r ] p v (q v r) (p w q) w r ] p w (q w r) • Distributive rules: p v (q w r) ] (p v q) w (p v r) p w (q v r) ] (p w q) v (p w r) • Idempotent rules: pvp]p pwp]p
Rules (continued) • Double Negation: 55 p ] p • De. Morgan’s Rules: 5(p v q) ] 5 p w 5 q 5(p w q) ] 5 p v 5 q • Commutative Rules: pvq]qvp pwq]qwp
Rules (continued) • Absorption Rules: p w (p v q) ] p p v (p w q) ] p • Bound Rules: pv 0]0 pv 1]p pw 0]p pw 1]1 • Negation Rules: p v 5 p ] 0 p w 5 p ] 1
A Simple Tautology P Q is the same as 5 Q 5 P This is the same as asking: P Q ] 5 Q 5 P How can we prove this true? By creating a truth table! PQ TT TF FT FF
A Simple Tautology (continued) Add appropriate columns P Q 5 P 5 Q TT F F T FT T F FF T T
A Simple Tautology (continued) Remember your implication table! P Q 5 P 5 Q P Q TT F F T TF F T F FT T FF T T T
A Simple Tautology (continued) Remember your implication table! P Q 5 P 5 Q P Q 5 Q 5 P TT F F T T TF F T F F FT T FF T T
A Simple Tautology (continued) Remember your implication table! P T T F F Q T F 5 P F F T T 5 Q F T P Q T F T T 5 Q 5 P T F T T P Q ] 5 Q 5 P T T Since the last column is all true, then the original statement: P Q ] 5 Q 5 P is a tautology Note: 5 Q 5 P is the contrapositive of P Q
Translation of English If P then Q: P Q P only if Q: 5 Q 5 P or P Q P if and only if Q: also written as P]Q P iff Q
Translation of English P is sufficient for Q: P Q P is necessary for Q: 5 P 5 Q Q P or P is necessary and sufficient for Q: P]Q P unless Q: 5 Q P 5 P Q or
Predicate Logic • • Consider the statement: x 2 > 1 Is it true or false? Depends upon the value of x! What values can x take on (what is the domain of x)? • Express this as a function: S(x) = x 2 > 1 • Suppose the domain is the set of reals. • The codomain (range) of S is a set of statements that are either true or false.
Example • S(0. 9) = 0. 92 > 1 is a false statement! • S(3. 2) = 3. 22 > 1 is a true statement! • The function S is an example of a predicate. • A predicate is any function whose codomain is a set of statements that are either true or false.
Note • The codomain is a set of statements • The codomain is not the truth value of the statements • The domain of predicate is arbitrary • Different predicates can have different domains • The truth set of a predicate S with domain D is the set of the x ε D for which S(x) is true: {x ε D | S(x) is true} • Or simply: {x | S(x)}
Quantifiers • The phrase “for all” is called a universal quantifier and is symbolically written as œ • The phrase “for some” is called an existential quantifier and is written as › Notations for set of numbers: Reals Integers Rationals Primes Naturals (nonnegative integers)
Goldbach’s conjecture • Every even number greater than or equal to 4 can be written as the sum of two primes • Express it as a quantified predicate • It is unknown whether or not Goldbach’s conjecture is true. You are only asked to make the assertion • Another example: Every sufficiently large odd number is the sum of three primes.
Negating Quantifiers • Let D be a set and let P(x) be a predicate that is defined for x ε D, then 5(œ(x ε D), P(x)) ] (› (x ε D), 5 P(x)) and 5(› (x ε D), P(x)) ] (œ(x ε D), 5 P(x))
- Slides: 29