In preparation for a series of posts in which I will discuss Raymond Smullyan's knights and knaves puzzles and how to solve them using logic, this post aims to review a few basics of propositional logic. Note that I will most likely not need first-order (predicate) logic in this series.
Propositional logic represents statements and logical arguments using:
- atomic propositions represented by (propositional) variables that are either true or false, and
- logical connectives, such as:
- AND: we'll use & to denote conjunction
- OR: we'll use | for disjunction
- NOT: we'll use − for negation
- IF-THEN: we'll use → for implication or conditional
- IF-AND-ONLY-IF: we'll use ↔ for biconditional
When building proofs, we will use the following well-known logical equivalences (among others).
Logical equivalence #1
Given any two propositions P1 and P2, the following two formulas are equivalent:
P1↔P2
(P1→P2) & (P2→P1)
In other words, a biconditional is equivalent to the conjunction of two conditionals.
Informal justification
The fact that
P1 if and only if P2
holds is equivalent to the fact that both
P1 if P2
and
P1 only if P2
hold.
Note that:
P1 only if P2
is represented by
P1→P2
and
P1 if P2
is represented by
P2→P1
P1→P2
Formal justification
Build the truth tables for both formulas P1↔P2 and (P1→P2) & (P2→P1) and check that they have the same truth value in each and every row.
Logical equivalence #2
Given any two propositions P1 and P2, the following two formulas are equivalent:
P1→P2
−P1 | P2
In other words, a conditional is equivalent to a disjunction.
Justification
The only way to make the formula
P1→P2
false, is to make P1 true and P2 false.
This is also true of the second formula
−P1 | P2
Build the truth table for both formulas and check that they have the same truth value in each and every row.
In part 2 of this series, we will use the propositional logic formalism to represent and solve our first knights and knaves problem.
In part 2 of this series, we will use the propositional logic formalism to represent and solve our first knights and knaves problem.
No comments:
Post a Comment