1 / 20

Logical Form and Logical Equivalence

Logical Form and Logical Equivalence. Lecture 2 Section 1.1 Fri, Jan 19, 2007. Statements. A statement is a sentence that is either true or false, but not both. These are statements: It is Wednesday. Discrete Math meets today. These are not statements: Hello. Are you there? Go away!.

jake
Download Presentation

Logical Form and Logical Equivalence

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. Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007

  2. Statements • A statement is a sentence that is either true or false, but not both. • These are statements: • It is Wednesday. • Discrete Math meets today. • These are not statements: • Hello. • Are you there? • Go away!

  3. Logical Operators • Binary operators • Conjunction – “and”. • Disjunction – “or”. • Unary operator • Negation – “not”. • Other operators • XOR – “exclusive or” • NAND – “not both” • NOR – “neither”

  4. Logical Symbols • Statements are represented by letters: p, q, r, etc. •  means “and”. •  means “or”. •  means “not”.

  5. Examples • Basic statements • p = “It is Wednesday.” • q = “Discrete Math meets today.” • Compound statements • pq = “It is Wednesday and Discrete Math meets today.” • pq = “ It is Wednesday or Discrete Math meets today.” • p = “It is not Wednesday .”

  6. False Negations • Statement • Everyone likes me. • False negation • Everyone does not like me. • True negation • Someone does not like me.

  7. False Negations • Statement • Someone likes me. • False negation • Someone does not like me. • True negation • No one likes me.

  8. Truth Table of an Expression • Make a column for every variable. • List every possible combination of truth values of the variables. • Make one more column for the expression. • Write the truth value of the expression for each combination of truth values of the variables.

  9. Truth Table for “and” • p  q is true if p is true and q is true. • p  q is false if p is false or q is false.

  10. Truth Table for “or” • p  q is true if p is true or q is true. • p  q is false if p is false and q is false.

  11. Truth Table for “not” • p is true if p is false. • p is false if p is true.

  12. Example: Truth Table • Truth table for the statement (p)  (q  r).

  13. Logical Equivalence • Two statements are logically equivalent if they have the same truth values for all combinations of truth values of their variables.

  14. Example: Logical Equivalence • (p q)  (p  q)  (p  q)  (p  q)

  15. DeMorgan’s Laws • DeMorgan’s Laws: (pq)  (p)  (q) (pq)  (p)  (q) • If it is not true that i < size && value != array[i] then it is true that…

  16. DeMorgan’s Laws • DeMorgan’s Laws: (pq)  (p)  (q) (pq)  (p)  (q) • If it is not true that i < size && value != array[i] then it is true that i >= size || value == array[i]

  17. DeMorgan’s Laws • If it is not true that x 5 orx  10, then it is true that …

  18. DeMorgan’s Laws • If it is not true that x 5 orx  10, then it is true that x > 5 andx < 10.

  19. Tautologies and Contradictions • A tautology is a statement that is logically equivalent to T. • It is a logical form that is true for all logical values of its variables. • A contradiction is a statement that is logically equivalent to F. • It is a logical form that is false for all logical values of its variables.

  20. Tautologies and Contradictions • Some tautologies: • pp • pq (pq) • Some contradictions: • pp • pq (pq)

More Related