1 / 35

MATH 213 A – Discrete Mathematics for Computer Science Dr. ( Mr.) Bancroft

MATH 213 A – Discrete Mathematics for Computer Science Dr. ( Mr.) Bancroft.

ilyssa
Télécharger la présentation

MATH 213 A – Discrete Mathematics for Computer Science Dr. ( Mr.) Bancroft

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. MATH 213 A – Discrete Mathematics for Computer Science Dr. (Mr.) Bancroft

  2. The inhabitants of the island created by Smullyanare peculiar. They consist of knights and knaves. Knights always tell the truth and knaves always lie. You encounter two people A and B. Determine, if possible, what A and B are (either a knight or a knave) from the way they address you. A says “I am a knave or B is a knight.” B says nothing.

  3. 1.1 Logic • Logic- • Proposition- • Notation: • Negation:

  4. Truth Tables

  5. Conjunction of p and q: Disjunction of p and q:

  6. Exclusive or: Implication/Conditional: Biconditional:

  7. Operations on Implications: Converse: Contrapositive: Inverse:

  8. More complicated truth tables

  9. Logic and Bit Operators

  10. 1.2 Propositional Equivalences (Several Definitions): Compound proposition- Tautology- Contradiction- Contingency-

  11. Logical Equivalence

  12. Using Truth Tables to Demonstrate Logical Equivalence

  13. Show that and are logically equivalent.

  14. Some Commonly used Logical Equivalences

  15. Other Commonly used Logical Equivalences

  16. De Morgan’s Laws

  17. Let’s revisit the knight and knave problem: A says “I am a knave or B is a knight.” B says nothing.

  18. Arguments using logical equivalence “Chain” of equivalences (recall the way you proved trig identities) Examples: 1. Prove is a tautology.

  19. 2. Show that and are logically equivalent (again), this time using equivalences from the tables.

  20. Using a Computer to Find Tautologies Practical only with small numbers of propositional variables. How many rows does the truth table contain for a compound proposition containing 3 variables? 5 variables? 10 variables? 100 variables?

  21. 1.3 – Predicates and Quantifiers Is “” a proposition? Predicates, or Propositional functions

  22. Note that if x has no meaning, then P(x) is just a form. The domain of x is … There are two ways to give meaning to a predicate P(x):

  23. The Universal Quantifier The universal quantification of the predicate P(x) is the proposition which states that… In symbols, Example: (Let the domain of discourse be all real numbers)

  24. The Existential Quantifier The existential quantification of the predicate P(x) is the proposition which states that… In symbols, Example: (Let the universe of discourse be all people)

  25. Looping to Determine the Truth of a Quantified Statement

  26. Free and Bound Variables “Scope” of a quantifier

  27. Relationship with Conjunction and Disjunction

  28. Negating a Quantified Statement

  29. Translating into English Sentences P(x) = “x likes to fly kites” Q(x,y) = “x knows y” L(x,y) = “x likes y”

  30. Translating from English Sentences “All cats are gray” “There are pigs which can fly”

  31. sibling(X,Y) :- parent(Z,X), parent(Z,Y), X \= Y. brother(X,Y) :- sibling(X,Y), male(X). sister(X,Y) :- sibling(X,Y), female(X). male(chris). male(mark). female(anne). female(erin). female(jessica). female(tracy). parent(chris,mark). parent(anne,mark). parent(chris,erin). parent(anne,erin). parent(chris,jessica). parent(anne,jessica). parent(chris,tracy). parent(anne,tracy). ?sibling(erin,jessica) ?sibling(mark,chris) ?parent(Z,tracy) Logic Programming

  32. Section 1.4 – Nested Quantifiers Examples: Order of quantification matters! Example: M(x,y) = “x is y’s mother”

  33. Another Example Translate each of these, where M is as above and S(x) = “x is a student” …

  34. English to First-Order Logic Let L(x,y) = “x loves y”. Translate… “Everybody loves somebody.” “There are people who love everybody” “All students love each other”

More Related