10/13/15 Nega%on Truth Table A A Propositional Logic and - - PDF document

10 13 15
SMART_READER_LITE
LIVE PREVIEW

10/13/15 Nega%on Truth Table A A Propositional Logic and - - PDF document

10/13/15 Nega%on Truth Table A A Propositional Logic and Truth Tables 0 1 (Rosen, Sections 1.1, 1.2, 1.3) 1 0 TOPICS Propositional Logic Logical Operations Logical Equivalences CS160 - Fall Semester 2015 Truth


slide-1
SLIDE 1

10/13/15 1

Propositional Logic and Truth Tables (Rosen, Sections 1.1, 1.2, 1.3)

TOPICS

  • Propositional Logic
  • Logical Operations
  • Logical Equivalences

Nega%on ¡Truth ¡Table ¡

A ¬A 1 1

CS160 - Fall Semester 2015

Truth ¡Table ¡for ¡Conjunc%on ¡

A B A ∧ B 1 1 1 1 1

CS160 - Fall Semester 2015

Truth ¡Table ¡for ¡Disjunc%on ¡

A B A ∨ B 1 1 1 1 1 1 1

CS160 - Fall Semester 2015

slide-2
SLIDE 2

10/13/15 2

Exclusive ¡Or ¡

n The ¡“or” ¡connec%ve ¡∨ ¡is ¡inclusive: ¡it ¡is ¡true ¡

if ¡either ¡or ¡both ¡arguments ¡are ¡true ¡

n There ¡is ¡also ¡an ¡exclusive ¡or ¡⊕

A B A ⊕ B 1 1 1 1 1 1

CS160 - Fall Semester 2015

Condi%onal ¡& ¡Bicondi%onal ¡ Implica%on ¡

n The ¡condi%onal ¡implica%on ¡connec%ve ¡is ¡→ n The ¡bicondi%onal ¡implica%on ¡connec%ve ¡is ¡↔ n These, ¡too, ¡are ¡defined ¡by ¡truth ¡tables ¡

A B A→B 1 1 1 1 1 1 1 A B A↔B 1 1 1 1 1 1

CS160 - Fall Semester 2015

Compound ¡Truth ¡Tables ¡

n Truth ¡tables ¡can ¡also ¡be ¡used ¡to ¡determine ¡

the ¡truth ¡values ¡of ¡compound ¡statements, ¡ such ¡as ¡(A∨B)∧(¬A) ¡(fill ¡this ¡as ¡an ¡exercise) ¡

A B ¬A A ∨ B (A ∨ B) ∧ (¬A) 1 1 1 1 1 1 1 1 1 1

CS160 - Fall Semester 2015

Tautology and Contradiction

n A tautology is a compound proposition that is

always true.

n A contradiction is a compound proposition that

is always false.

n A contingency is neither a tautology nor a

contradiction.

n A compound proposition is satisfiable if there is

at least one assignment of truth values to the variables that makes the statement true.

CS160 - Fall Semester 2015

slide-3
SLIDE 3

10/13/15 3

Logical Equivalence

n Two compound propositions, p and q, are

logically equivalent if p ↔ q is a tautology.

n Notation: p ≡ q n De Morgan’s Laws:

¬ (p ∧ q) ≡ ¬ p ∨ ¬ q ¬ (p ∨ q) ≡ ¬ p ∧ ¬ q

n How so? Let’s build a truth table!

CS160 - Fall Semester 2015

p q 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Prove ¬(p ∧ q) ≡ ¬p ∨ ¬q

p q ¬p ¬q (p ∧ q) ¬(p ∧ q) ¬p ∨ ¬q

= =

CS160 - Fall Semester 2015

Show ¬(p ∨ q) ≡ ¬p ∧ ¬q

= =

p q 1 1 1 1 1 1 1 1 1 1 1 1 1 p q ¬p ¬q (p ∨ q) ¬(p ∨q)

¬p ∧ ¬q

CS160 - Fall Semester 2015

More Equivalences

Equivalence Name p ∧ T ≡ p p ∨ F ≡ p Identity p ∧ q ≡ q ∧ p p ∨ q ≡ q ∨ p Commutative p ∨ (p ∧ q) ≡ p p ∧ (p ∨ q) ≡ p Absorption

See Rosen for more.

CS160 - Fall Semester 2015

slide-4
SLIDE 4

10/13/15 4

Converse, Contrapositive, Inverse

n The converse of an implication p → q

reverses the propositions: q → p

n The inverse of an implication p → q inverts

both propositions: ¬p → ¬q

n The contrapositive of an implication p → q

reverses and inverts: ¬q → ¬p The converse and inverse are not logically equivalent to the original implication, but the contrapositive is, and may be easier to prove.

CS160 - Fall Semester 2015

Logical Equivalences

n Show page of inference rules and

logical equivalences on course web site – ignore the inference rules for the moment.

CS160 - Fall Semester 2015

Logical Equivalence Proof (Cannot use Inference Rules!)

n By 2nd DeMorgan’s n By 1st DeMorgan’s n By Double Negation n By 2nd Distributive n By Negation Law n By Commutative Law n By Identity Law

Prove: ¬(p∨(¬p∧q)) ≡ ¬p∧¬q

¬(p∨(¬p∧q)) ≡ ¬p ∧ ¬(¬p∧q) ≡ ¬p ∧ (¬¬p∨¬q) ≡ ¬p ∧ (p∨¬q) ≡ (¬p∧p) ∨ (¬p∧¬q) ≡ F ∨ (¬p∧¬q) ≡ (¬p∧¬q) ∨ F ≡ (¬p∧¬q)

CS160 - Fall Semester 2015

Same proof using a truth table: ¬(p∨(¬p∧q)) ≡ ¬p∧¬q

= = p q ¬p ¬q ¬p∧q p∨(¬p∧q) ¬(p∨(¬p∧q)) ¬p∧¬q T T F F F T F F T F F T F T F F F T T F T T F F F F T T F F T T

CS160 - Fall Semester 2015