Mathematics for Computing COMP SCI 1FC3 McMaster University, Winter - - PDF document

mathematics for computing
SMART_READER_LITE
LIVE PREVIEW

Mathematics for Computing COMP SCI 1FC3 McMaster University, Winter - - PDF document

Mathematics for Computing COMP SCI 1FC3 McMaster University, Winter 2013 Wolfram Kahl kahl@cas.mcmaster.ca 31 January 2013 Preliminary Slides Plan for Today Textbook Chapter 3: Propositional Calculus Disjunction Conjunction Doing proofs


slide-1
SLIDE 1

Mathematics for Computing

COMP SCI 1FC3 McMaster University, Winter 2013

Wolfram Kahl

kahl@cas.mcmaster.ca

31 January 2013

Preliminary Slides Plan for Today

Textbook Chapter 3: Propositional Calculus

Disjunction Conjunction

Doing proofs

slide-2
SLIDE 2

Theorems

A theorem is either an axiom

  • r the conclusion of an inference rule where the premises

are theorems

  • r a Boolean expression proved (using the inference rules)

equal to an axiom or a previously proved theorem. Such proofs will be presented in the calculational style. Note: “theorem” is a syntactic concept −

→ proofs

“validity” is a semantic concept −

→ truth tables

For the propositional logic E, theoremhood and validity coincide:

All theorems in E are valid: E is sound All valid Boolean expressions are theorems in E: E is complete

Disjunction Axioms

(3.24) Axiom, Symmetry of ∨: p ∨ q ≡ q ∨ p (3.25) Axiom, Associativity of ∨:

(p ∨ q) ∨ r ≡ p ∨(q ∨ r)

(3.26) Axiom, Idempotency of ∨: p ∨ p ≡ p (3.27) Axiom, Distributivity of ∨ over ≡: p ∨(q ≡ r) ≡ p ∨ q ≡ p ∨ r (3.28) Axiom, Excluded Middle: p ∨ ¬p

slide-3
SLIDE 3

Disjunction Axioms and Theorems

(3.24) Axiom, Symmetry of ∨: p ∨ q ≡ q ∨ p (3.25) Axiom, Associativity of ∨:

(p ∨ q) ∨ r ≡ p ∨(q ∨ r)

(3.26) Axiom, Idempotency of ∨: p ∨ p ≡ p (3.27) Axiom, Distr. of ∨ over ≡: p ∨(q ≡ r) ≡ p ∨ q ≡ p ∨ r (3.28) Axiom, Excluded Middle: p ∨ ¬p Theorems: (3.29) Zero of ∨: p ∨ true ≡ true (3.30) Identity of ∨: p ∨ false ≡ p (3.31) Distrib. of ∨ over ∨: p ∨(q ∨ r) ≡ (p ∨ q) ∨(p ∨ r) (3.32) (3.32) p ∨ q ≡ p ∨ ¬q ≡ p

Heuristics of Directing Calculations

(3.33) Heuristic: To prove P ≡ Q, transform the expression with the most structure (either P or Q) into the other.

Proving (3.29) p ∨ true ≡ true: p ∨ true

= Identity of ≡ (3.3)

p ∨(q ≡ q)

=

  • Distr. of ∨ over ≡ (3.27)

p ∨ q ≡ p ∨ q

= Identity of ≡ (3.3)

true Proving (3.29) p ∨ true ≡ true: true

= Identity of ≡ (3.3)

p ∨ p ≡ p ∨ p

=

  • Distr. of ∨ over ≡ (3.27)

p ∨(p ≡ p)

= Identity of ≡ (3.3)

p ∨ true

?

(3.34) Principle: Structure proofs to minimize the number of rabbits pulled out of a hat — make each step seem obvi-

  • us, based on the structure of the expression and the goal
  • f the manipulation.
slide-4
SLIDE 4

The Conjunction Axiom: The “Golden Rule”

(3.35) Axiom, Golden rule: p ∧ q

p ≡ q

p ∨ q Can be used as: p ∧ q

= (p ≡ q ≡

p ∨ q)

(p ≡ q) = (p ∧ q ≡

p ∨ q) . . . Theorems: (3.36) Symmetry of ∧: p ∧ q

q ∧ p (3.37) Associativity of ∧:

(p ∧ q) ∧ r ≡

p ∧(q ∧ r) (3.38) Idempotency of ∧: p ∧ p

p (3.39) Identity of ∧: p ∧ true

p (3.40) Zero of ∧: p ∧ false

false (3.41) Distributivity of ∧ over ∧: p ∧(q ∧ r) ≡ (p ∧ q) ∧(p ∧ r) (3.42) Contradiction: p ∧ ¬p

false

Theorems Relating ∧ and ∨

(3.43) Absorption: p ∧(p ∨ q)

p p ∨(p ∧ q)

p (3.44) Absorption: p ∧(¬p ∨ q)

p ∧ q p ∨(¬p ∧ q)

p ∨ q (3.45) Distributivity of ∨ over ∧: p ∨(q ∧ r) ≡ (p ∨ q) ∧(p ∨ r) (3.46) Distributivity of ∧ over ∨: p ∧(q ∨ r) ≡ (p ∧ q) ∨(p ∧ r) (3.47) De Morgan:

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

slide-5
SLIDE 5

Raymond Smullyan posed many puzzles about an island that has two kinds of inhabitants: knights, who always tell the truth, and knaves, who always lie. You encounter two people A and B. What are A and B if

1

A says “We are both knaves.”?

2

A says “At least one of us is a knave.”?

3

A says “If I am a knight, then so is B.”?

4

A says “We are of the same type.”?

5

A says “B is a knight” and B says “The two of us are opposite types.”?

1

A says “We are both knaves.”? A says X

AV

≡ ¬X

A says (AV ∧ BV)

slide-6
SLIDE 6

Theorems Relating ∧ and ≡

(3.48) (3.48) p ∧ q

p ∧ ¬q

≡ ¬p

(3.49) p ∧(q ≡ r)

p ∧ q

p ∧ r

p (3.50) p ∧(q ≡ p)

p ∧ q (3.51) Replacement:

(p ≡ q) ∧(r ≡ p) ≡ (p ≡ q) ∧(r ≡ q)

Alternative Definitions of ≡ and ≡

(3.52) Definition of ≡: p ≡ q

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

(3.53) Definition of ≡: p ≡ q

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