1 / 33

Mathematics for Computing

Mathematics for Computing. Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk. Logic. Propositions Connective Symbols / Logic gates Truth Tables Logic Laws. Propositions.

Download Presentation

Mathematics for Computing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk

  2. Logic • Propositions • Connective Symbols / Logic gates • Truth Tables • Logic Laws

  3. Propositions • Definition: A proposition is a statement that is either true or false. Which ever of these (true or false) is the case is called the truth value of the proposition.

  4. Connectives • Compound propositione.g. ‘If Brian and Angela are not both happy, then either Brian is not happy or Angela is not happy’ • Atomic proposition:‘Brian is happy’ ‘Angela is happy’ • Connectives:and, or, not, if-then

  5. Connective Symbols

  6. Conjugation • Logical ‘and’ • Symbol ٨ • Written p٨q • Alternative forms p & q, p . q, pq • Logic gate version p pq q

  7. Disjunction • Logical ‘or’ • Symbol ٧ • Written p ٧ q • Alternative form p + q • Logic gate version p p + q q

  8. Negation • Logical ‘not’ • Symbol ~ • Written ~p • Alternative forms ¬p, p’, p • Logic gate version p ~p

  9. Truth Tables

  10. Compound Propositions ~(p ٨ ~q)

  11. Tautologies • Always true

  12. Contradictions • Always false

  13. Website for Lecture Notes • http://www.cryst.bbk.ac.uk/~bpurk01/MfC/index2007.html

  14. End of First Logic 1? • Place marker

  15. Mathematics for Computing Lecture 3: Computer Logic and Truth Tables 2 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk

  16. Logical Equivalence • Logical ‘equals’ • Symbol ≡ • Written p≡p

  17. Conditional • Logical ‘if-then’ • Symbol → • Written p → q

  18. Biconditional • Logical ‘if and only if’ • Symbol ↔ • Written p ↔ q

  19. converse and contrapositive • The converse of p → q is q → p • The contrapositive of p → q is ~q → ~p

  20. Laws of Logic • Laws of logic allow use to combine connectives and simplify propositions.

  21. Double Negative Law • ~ ~ p ≡p

  22. Implication Law • p → q ≡ ~p ٧ q

  23. Equivalence Law • p ↔ q ≡ (p → q) ٨ (q → p)

  24. Idempotent Laws • p ٨ p ≡p • p ٧ p ≡p

  25. Commutative Laws • p ٨ q ≡q ٨ p • p ٧ q ≡q ٧ p

  26. Associative Laws • p ٨ (q ٨ r) ≡ (p ٨ q) ٨ r • p ٧ (q ٧ r) ≡ (p ٧ q) ٧ r

  27. Distributive Laws • p ٨ (q ٧ r) ≡ (p ٨ q) ٧ (p ٨ r) • p ٧ (q ٨ r) ≡ (p ٧ q) ٨ (p ٧ r)

  28. Identity Laws • p ٨ T ≡p • p ٧ F ≡p

  29. Annihilation Laws • p ٨ F ≡F • p ٧ T ≡T

  30. Inverse Laws • p ٨ ~p ≡F • p ٧ ~p ≡T

  31. Absorption Laws • p ٨ (p ٧ q) ≡p • p ٧ (p ٨ q) ≡p

  32. de Morgan’s Laws • ~(p ٨ q) ≡~p ٧ ~q • ~(p ٧ q) ≡~p ٨ ~q

More Related