1 / 33

Discrete Mathematics

Discrete Mathematics. Logic. Propositions. A proposition is a statement or sentence that can be determined to be either true or false (but no both). Examples: The only positive integers that divide 7 are 1 and 7 itself. Buy two tickets for Friday concert.

lakiesha
Download Presentation

Discrete Mathematics

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. Discrete Mathematics Logic

  2. Propositions • A proposition is a statement or sentence that can be determined to be either true or false (but no both). • Examples: • The only positive integers that divide 7 are 1 and 7 itself. • Buy two tickets for Friday concert. • Earth is the only planet in the universe that contains life.

  3. Example • Use variable to represent propositions • P: 1+1=3 • P: It is raining outside • P: Today is Tuesday

  4. Connectives If p and q are propositions, new compound propositions can be formed by using connectives • Most common connectives: • Conjunction (and) ^ • Disjunction (or)  • Negation (not) ~ • Exclusive-OR v • Condition (if … then)  • Bi-Condition 

  5. Example • P: It is raining • Q: It is cold • Form a new compound statement by combining these two statements • P  Q : It is raining and it is cold • P  Q : It is raining or it is cold

  6. The truth values of compound propositions can be described by truth tables. Truth table of conjunction P Q is true only when both P and Q are true. Truth table of conjunction

  7. Example • Let P = “A decade is 10 years” • Let Q = “A millennium is 100 years” • P  Q = “A decade is 10 years” and “A millennium is 100 years” • If P is true and Q is false then conjunction is false

  8. Truth table of disjunction • The truth table of disjunction is • p  q is false only when both p and q are false • Example: p = "John is a programmer", q = "Mary is a lawyer" • p v q = "John is a programmer or Mary is a lawyer"

  9. Negation • Negation of P: in symbols ~P or ⌐P • ~P is false when P is true, ~P is true when P is false • Example, P : "John is a programmer" • ~P = "John is not a programmer"

  10. E.g • P: Paris is the capital of England • ~P: Paris is not capital of England

  11. Exclusive disjunction • “Either P or Q” (but not both), in symbols P  Q • P  Q is true only when P is true and Q is false, or P is false and Q is true. • Example: p = "John is programmer, q = "Mary is a lawyer" • p v q = "Either John is a programmer or Mary is a lawyer"

  12. More compound statements • Let p, q, r be simple statements • We can form other compound statements, such as • (pq)^r • p(q^r) • (~p)(~q) • (pq)^(~r) • and many others…

  13. Example: truth table of (P Q)R

  14. Conditional propositions • A conditional proposition is of the form “If P then Q” • In symbols: P  Q • Example: • P = " A bottle contains acid" • Q = “A bottle has a label” • P  Q = “If a bottle contains acid then it has a label "

  15. Truth table of P  Q • P  Q is true when both p and q are true or when P is false

  16. Example • If the mathematics department gets an additional $40,000 then it will hire one new faculty member. • Let P: The Mathematics Department gets an additional $40,000 and Q: The mathematics Department will hire one new faculty member.

  17. Hypothesis and conclusion • In a conditional proposition P  Q, P is called the hypothesis Q is called the conclusion

  18. Example • For all real number x if x > 0 then x2 > 0 • For example x=3 , 3 > 0 then 32 > 0 both are true. • x=-2 , -2 > 0 is false but -22 > 0

  19. Logical equivalence • Two propositions are said to be logically equivalent if their truth tables are identical. • Example: ~P  Q is logically equivalent to P  Q

  20. Converse • The converse of p  q is q  p These two propositions are not logically equivalent

  21. Contrapositive • The contrapositive of the proposition p  q is ~q  ~p. They are logically equivalent.

  22. Bi-Conditional • The double implication “p if and only if q” is defined in symbols as p  q p  q is logically equivalent to (p  q)^(q  p)

  23. Tautology • A proposition is a tautology if its truth table contains only true values for every case • Example: p  p v q

  24. Contradiction • A proposition is a tautology if its truth table contains only false values for every case • Example: p ^ ~p

  25. De Morgan’s laws for logic • The following pairs of propositions are logically equivalent: • ~ (p  q) and (~p)^(~q) • ~ (p ^ q) and (~p)  (~q)

  26. Quantifiers • A propositional function P(x) is a statement involving a variable x • For example: • P(x): 2x is an even integer • x is an element of a set D • For example, x is an element of the set of integers • D is called the domain of P(x)

  27. For every and for some • Most statements in mathematics and computer science use terms such as for every and for some. • For example: • For every triangle T, the sum of the angles of T is 180 degrees. • For every integer n, n is less than p, for some prime number p.

  28. Universal quantifier • One can write P(x) for every x in a domain D • In symbols: x P(x) •  is called the universal quantifier

  29. Inference Or Deduction • An argument is a sequence of propositions written as below : • p1, p2 ,p3 ,p4 ,p5 ,,…, ,pn, therefore q. (if p1v p2v,.., pn then q) or (if p1 ^p2 ^,.., pn then q) • the propositions p1, .., pn, are called hypotheses (premises) and proposition q is called conclusion (consequent). • The above argument is valid if the consequent can be proven from the premises. • Validity can be shown using truth table or by using theorems / rules.

  30. Rules of Inference • Addition p , therefore p v q (read as if we know p is true, therefore we know p or q is true) • Simplification p ^ q , therefore p • Conjunction p , q , therefore p ^ q

  31. Rules of Inference (contd..) • Modus Ponens p  q , p, therefore q • Modus Tollens ~ q, p  q , therefore ~p • Hypothetical Syllogism p  q, q  r, therefore p  r • Disjunctive Syllogism p v q , ~ p, therefore q • Resolution p v q, ~ p v r , therefore q v r

  32. Example State which rule of inference is the basis of the following argument : “ It is below freezing now. Therefore it is either below freezing or raining now.” - addition rule “It is below freezing and raining now. Therefore, it is below freezing now. “ - simplification rule “Rules : If it snows today, then we will go skiing” Fact : it snows today. Conclude: We will go skiing” - modus ponens

  33. Problem Show that the hypotheses : “ It is not sunny this afternoon and it is colder than yesterday.” Will conclude : “We will be home by sunset “ Given the following fact : “We will go swimming only if it is sunny. If we do not go swimming, then we will take a canoe trip. If we take a canoe trip we will be home by sunset”

More Related