Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 1813 – Discrete Mathematics

Similar presentations


Presentation on theme: "CS 1813 – Discrete Mathematics"— Presentation transcript:

1 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

2 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 PQ PQ  P CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

3 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) ((PQ)((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 ((PQ)((P)Q)) True False If they were all True: Tautology True True Formal statement about meaning Proved via truth table double turnstile CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

4 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

5 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

6 Some Theorems in Rule Form
a  b {Comm} b  a And Commutes a  b {Comm} b  a Or Commutes a a { +&- } False NeverBoth ab bc {Chain} ac 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

7 More Theorems in Rule Form
(a  b) {DeMF} (a)(b) DeMorgan Or Fwd (a)(b) {DeMB} (a  b) DeMorgan Or Bkw (a  b) {DeMF} (a)(b) DeMorgan And Fwd (a)(b) {DeMB} (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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

8 Laws of Boolean Algebra page 1
From Fig 2.1, Hall & O’Donnell, Discrete Math with a Computer, Springer, 2000 CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

9 Laws of Boolean Algebra page 2
From Fig 2.1, Hall & O’Donnell, Discrete Math with a Computer, Springer, 2000 CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

10 Some Theorems in Boolean Algebra
(a  b)  b = b { absorption} (a  b)  b = b { absorption} (a  b)  c = (a  c)  (b  c) { imp} CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

11 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

12 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

13 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

14 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

15 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

16 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 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

17 Practice Problem (a)  (b) |– b  a contrapositive backwards
Better way b { B} (a)  (b) (b) {modTol} (a) { F} a {I} b  a CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

18 Practice Problem a  ((a)  b) = a  b
= (a  (a))  (a  b) { dist/} = False  (a  b) { comp} = (a  b)  False { commutes} = a  b { id} CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page

19 Lecture 10 - CS 1813 Discrete Math, University of Oklahoma
11/22/2018 The End CS Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page


Download ppt "CS 1813 – Discrete Mathematics"

Similar presentations


Ads by Google