CS 1813 – Discrete Mathematics Lecture 10 - CS 1813 Discrete Math, University of Oklahoma 11/22/2018 CS 1813 – Discrete Mathematics Review of Propositional Calculus CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Truth Tables for Logical Operators P Q P Q False False False False True False True False False True True True P Q False True P Q PQ PQ P CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Semantic Reasoning with Truth Tables Proposition (WFF): ((P Q)((P)Q)) P Q False False False True True False True True (P Q) (P) ((P)Q) ((PQ)((P)Q)) Some True: prop is Satisfiable False True False False True True True True True False True True All False: Contradiction (not satisfiable) If prop is True when all variables areTrue: P, Q ((PQ)((P)Q)) True False If they were all True: Tautology True True Formal statement about meaning Proved via truth table double turnstile CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Lecture 10 - CS 1813 Discrete Math, University of Oklahoma 11/22/2018 Rules of Inference Discrete Mathematics with a Computer Springer, 2000 Fig 2.1, Hall/O’Donnell After presenting this slide, put up a copy on the overhead projector to refer to in upcoming proofs. CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Some Intrinsic Data Structures in Haskell Lecture 10 - CS 1813 Discrete Math, University of Oklahoma 11/22/2018 Some Intrinsic Data Structures in Haskell Sequences (aka lists — in primitive PLs, done as linked lists) [x1, x2, …] all x’s must have same type Examples: [t] means a sequence with elements of type t [1, 9, 3, 27] type: [Integer] [And A B, Or P Q, B] type: [Prop] Tuples (like structs or records in other programming languages) (c1, c2) pair – components may have different types (c1, c2 , c3) 3-tuple (longer tuples OK—must be at least 2 components) Examples: (t1, t2) means a pair where component k has type tk (7, And A B) type: (Integer, Prop) (AndEL (Assume(A `And` B)) A, Assume B) type: (Proof, Proof) Constructors are things that build data of the type in which they appear as part of the definition. Proof Proof CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Some Theorems in Rule Form a b {Comm} b a And Commutes a b {Comm} b a Or Commutes a a { +&- } False NeverBoth ab bc {Chain} ac Implication Chain Rule (a b) {()Comm} (b a) Not Or Commutes a b b {modTol} a Modus Tollens a b {conPosF} (b)(a) Contrapositive Fwd {noMiddle} a (a) Law of Excluded Middle a b {F} (a) b Implication Fwd (a) b {F} a b Implication Bkw CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
More Theorems in Rule Form (a b) {DeMF} (a)(b) DeMorgan Or Fwd (a)(b) {DeMB} (a b) DeMorgan Or Bkw (a b) {DeMF} (a)(b) DeMorgan And Fwd (a)(b) {DeMB} (a b) DeMorgan And Bkw a b a {disjSyll} b Disjunctive Syllogism (a) { F} a Double Negation Fwd a { B} (a) Double Negation Bkw CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Laws of Boolean Algebra page 1 From Fig 2.1, Hall & O’Donnell, Discrete Math with a Computer, Springer, 2000 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Laws of Boolean Algebra page 2 From Fig 2.1, Hall & O’Donnell, Discrete Math with a Computer, Springer, 2000 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Some Theorems in Boolean Algebra (a b) b = b { absorption} (a b) b = b { absorption} (a b) c = (a c) (b c) { imp} CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Boolean Equations and Tautologies Tautology WFF that is true for all combinations of values of its atomic consituents Let p, q stand for arbitrary WFFs Suppose Boolean laws prove p = q Then the following WFFs are tautologies p q q p p q CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Theorems and Tautologies Let p, q, … stand for arbitrary WFFs p |– q If this is a theorem, then p q is a tautology p, q, r |– s If this is a theorem, then (p q r) s is a tautology |– p If this is a theorem, then p is a tautology CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
CS 1813 Discrete Mathematics, Univ Oklahoma What It All Means Notions of Consistency in Formal Systems If a |– b, then a |= b (a, b arbitrary WFFs) Completeness in Formal Systems If a |= b, then a |– b (a, b arbitrary WFFs) If b is true whenever a is, there is a proof of a |– b Propositional Logic Consistency — propositional logic is consistent Inference preserves tautologies Inconsistency would make all WFFs tautologies Some WFFs aren’t tautologies — QED (consistency) Completeness — propositional logic is complete That’s no surprise, is it? CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Kurt Gödel — the first computer scientist Arithmetic is consistent comforting, but not surprising Arithmetic is not complete Some statements about numbers are consistent with all the axioms, but cannot be proved A humongous surprise for mathematicians in the 1930s Consistency and Completeness Impossible goal No formal system can be both Except stripped-down systems (less powerful than arithmetic) In essence, this has nothing to do with numbers It has to do with the limits of formal systems (computers) Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I — Gödel, 1931 46 definitions + many lemmas precede main point Translation by Meltzer — $6.25, Amazon.com The recognition of Kurt Gödel as the first computer scientist is an insight of John Allen, a present-day logician and computer scientist, author of Anatomy of Lisp. CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Practice Problem (a) b |– a b Implication Backward Lecture 10 - CS 1813 Discrete Math, University of Oklahoma 11/22/2018 Practice Problem (a) b |– a b Implication Backward a { B} (a) b (a) {disjSyll} b {I} a b Form teams of 5 students each. Give them the following practice problems, one at a time. Give them 8 to 10 minutes to work on a problem. Ask a successful team to present it’s solution to the class. CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Practice Problem (a) (b) |– b a contrapositive backwards {conPosF} { F} { F} (b) (a) b a {F} {IL} {IR} ((b)) (a) (b) a (b) a {E} (b) a {B} b a That’s ugly! There must be a better way. CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Practice Problem (a) (b) |– b a contrapositive backwards Better way b { B} (a) (b) (b) {modTol} (a) { F} a {I} b a CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Practice Problem a ((a) b) = a b = (a (a)) (a b) { dist/} = False (a b) { comp} = (a b) False { commutes} = a b { id} CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page
Lecture 10 - CS 1813 Discrete Math, University of Oklahoma 11/22/2018 The End CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page