0% found this document useful (0 votes)
24 views

4 Logic and Proofs

Proof

Uploaded by

Denzel Takawira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

4 Logic and Proofs

Proof

Uploaded by

Denzel Takawira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

MA11: Lecture 5

Logic and Proof


Propositional Logic
Compound Propositions
Operator Precedence
Logical Equivalence
Commutative, Associative and Distributive Laws
Negating Compound Propositions

. – p.1/14
More Complicated Expressions...

Compound propositions can be made up of more than two


atomic propositions:
e.g. (¬(p ∧ q)) ∨ r

The truth value of this proposition can be found by

Inserting the values of the individual propositions.

Applying the connectives in an appropriate order.

. – p.2/14
Examples
1. Given the three propositions
p : 1+1=2 T
q : 2 × 4 = 10 F
r : 33 = 27 T
the value of the above logical expression is

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


= (¬F) ∨ T
= T∨T
= T

2. What about (p ∧ q) ⇒ r?

. – p.3/14
...and their Truth Tables

It is also possible to construct a truth table for (¬(p ∧ q)) ∨ r.

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


T T T T F T
T T F T F F
T F T F T T
T F F F T T
F T T F T T
F T F F T T
F F T F T T
F F F F T T

. – p.4/14
Examples
1. Construct the truth table for (p ∧ q) ⇒ r.
p q r
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F

2. Construct the truth table for ¬p ∧ q.

. – p.5/14
Notes

Each additional proposition multiplies the number of


rows by 2 (and adds a column).

Each additional connective adds a column.

The order in which connectives are applied in a


compound proposition is important. Precedence rules are
introduced in order to avoid ambiguity.

. – p.6/14
Operator Precedence

Expressions within parentheses are evaluated first, after


which the connectives are applied in the following order:
¬ (negation) is applied first...
...followed by ∧ (conjunction)...
...then ∨ (disjunction)...
...then ⇒ (conditional)...
...and finally ⇔ (biconditional).

Multiple occurrences of the same connective are evaluated


from left to right.

. – p.7/14
Example
1. Evaluate the compound proposition
p ∧ q ⇔ ¬q ∨ r
where the propositions p, r are true and the proposition q is false.
p ∧ q ⇔ ¬q ∨ r = T ∧ F ⇔ ¬F ∨ T
=
=
=
=

Note that this expression is evaluated as (p ∧ q) ⇔ ((¬q) ∨ r).

2. What is the truth value of p ∧ q ⇔ ¬(q ∨ r) with the same truth values for p, q, r?

. – p.8/14
Logical Equivalence

Two compound propositions are logically equivalent if they


have the same truth value, whatever the values of their
constituent propositions

Show that the two expressions, p ⇒ q and ¬q ⇒ ¬p , are logically equivalent.

p q ¬q ¬p ¬q ⇒ ¬p p⇒q
T T T
T F F
F T T
F F T

• The truth values in the two right hand columns are precisely the same, so we can write
p ⇒ q ≡ ¬q ⇒ ¬p

• ¬q ⇒ ¬p is known as the contrapositive of p ⇒ q.

. – p.9/14
Commutativity

The connectives ∧ and ∨ are commutative. This means that it


doesn’t matter which order their associated propositions
appear in, the result is the same, i.e.
p∧q ≡ q∧p p∨q ≡ q∨p

These equivalences can be proved using truth tables.


p q p∧q q∧p p q p∨q q∨p
T T T T T T
T F F T F T
F T F F T T
F F F F F F

. – p.10/14
More Logical Equivalences

The connectives ∧ and ∨ are associative,


(p ∨ q) ∨ r ≡ p ∨ (q ∨ r) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
i.e. the position of the parentheses doesn’t matter.

They also satisfy a distributive law,


(p ∨ q) ∧ (p ∨ r) ≡ p ∨ (q ∧ r)
(p ∧ q) ∨ (p ∧ r) ≡ p ∧ (q ∨ r)
i.e. propositions common to both expressions can be
taken outside the parentheses.

These laws can also be proved using truth tables.

. – p.11/14
Negating Compound Propositions

De Morgan’s laws state that


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

They can be proved using truth tables, for example


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

The second de Morgan’s law can also be proved in this way.

. – p.12/14
Summary

As many logical statements can be combined as are


necessary to describe the situation.

Some combinations will always give the same truth


value, whatever the situation – they are equivalent.

The order in which things are done matters.

. – p.13/14

You might also like