Chapter 1
Chapter 1
and Proofs
Chapter 1
Propositional Logic
Section 1.1
Propositions
A proposition is a declarative sentence that
is either true or false.
Examples of propositions:
b) 1 + 0 = 1
a) Dhaka is the capital of Bangladesh.
c) 0 + 0 = 2
Examples that are not propositions:
a) What time is it?
b) x + 1 = 2
Propositional Logic
Constructing Propositions
Propositional Variables: p, q, r, s, …
The proposition that is always true is denoted by T
and the proposition that is always false is denoted
by F.
Compound Propositions: formed from existing
propositions using logical operators.
Negation ¬
Conjunction ∧
Disjunction ∨
Implication →
Bi-conditional ↔
Compound Propositions: Negation
The negation of a proposition p is denoted by
¬p and has this truth table:
p ¬p
T F
F T
Example: If p
round.”, then ¬p
denotes “The earth is
denotes “The earth is not
round.”
Conjunction
The conjunction of propositions p and q is
denoted by p ∧ q and has this truth table:
p q p∧q
T T T
T F F
F T F
F F F
p q p ∨q
T T T
T F T
F T T
F F F
p q p ⊕q
T T F
T F T
F T T
F F F
Implication
If p and q are propositions, then p →q is a conditional
statement or implication that is false when p is true and q
p q p →q
T T T
T F F
F T T
F F T
is false.
Different Ways of Expressing p →q
if p, then q p implies q
if p, q p only if q
q unless ¬p q when p
q if p
q whenever p p is sufficient for q
q follows from p q is necessary for p
Converse, Contrapositive, and Inverse
From p →q we can form new conditional statements .
q →p is the converse of p →q
¬q → ¬ p is the contrapositive of p →q
¬ p → ¬ q is the inverse of p →q
Solution:
converse: ?
inverse: ?
contrapositive: ?
Converse, Contrapositive, and Inverse
From p →q we can form new conditional statements
q →p is the converse of p →q
.
¬q → ¬ p is the contrapositive of p →q
¬ p → ¬ q is the inverse of p →q
Example: Find the converse, inverse, and
contrapositive of “It raining is a sufficient condition
for my not going to town.”
Solution:
converse: If I do not go to town, then it is raining.
inverse: If it is not raining, then I will go to town.
contrapositive: If I go to town, then it is not raining.
Biconditional
If p and q are propositions, then we can form the
biconditional proposition p ↔q that is true when p and q
p q p ↔q
T T T
T F F
F T F
F F T
p q r is equivalent to (p q)
r )
then parentheses must be used.
Truth Tables
For Compound Propositions
Construction of a truth table:
Rows
Need a row for every possible combination of
values for the atomic propositions.
Columns
Need a column for the compound proposition
Need a column for the truth value of each
expression that occurs in the compound
proposition as it is built up.
Example Truth Table
Construct a truth table for
p q r r pq pq→
r
T T T F T F
T T F T T T
T F T F T F
T F F T T T
F T T F T F
F T F T T T
F F T F F T
F F F T F T
Equivalent Propositions
Two propositions are equivalent if they
always have the same truth value.
Example: Show using a truth table that the
implication is equivalent to the
contrapositive.
p q ¬p ¬q ¬q → ¬
Solution:
p →q
p
T T F F T T
T F F T F F
F T T F T T
F F T T T T
Using a Truth Table to Show
Non-Equivalence
Example: Show using truth tables that
neither the converse nor inverse of an
implication are not equivalent to the
implication.
p q ¬p ¬q p →q ¬ p →¬ q→p
Solution:
q
T T F F T T T
T F F T F T T
F T T F T F F
F F T T T T T
Problem
How many rows are there in a truth table
with n propositional variables?
Solution: ?
Problem
How many rows are there in a truth table
with n propositional variables?
Solution: 2n
q→ ¬ p
and q denote “The file system is full.”
Logic Puzzles
An island has two kinds of inhabitants, knights, who always
tell the truth, and knaves, who always lie.
You go to the island and meet A and B.
A says “B is a knight.”
B says “The two of us are of opposite types.”
Example: What are the types of A and B?
Solution: ?
Logic Puzzles
An island has two kinds of inhabitants, knights, who always
tell the truth, and knaves, who always lie.
You go to the island and meet A and B.
A says “B is a knight.”
B says “The two of us are of opposite types.”
The inverter (NOT gate)takes an input bit and produces the negation of that bit.
The OR gate takes two input bits and produces the value equivalent to the
disjunction of the two bits.
The AND gate takes two input bits and produces the value equivalent to the
conjunction of the two bits.
More complicated digital circuits can be constructed by combining these
basic circuits. For example:
Propositional
Equivalences
Section 1.3
Tautologies, Contradictions, and
Contingencies
A tautology is a proposition which is always
p ∨¬p
true.
Example:
A contradiction is a proposition which is
Example: p ∧¬p
always false.
p ¬p ¬p ∨ q p→ q
q
T T F T T
T F F F F
F T T T T
F F T T T
De Morgan’s Laws
Augustus De
Morgan
1806-
1871
Domination Laws: ,
Idempotent laws: ,
Negation Laws: ,
Key Logical Equivalences (cont)
Commutative Laws: ,
Associative Laws:
Distributive Laws:
Absorption Laws:
More Logical Equivalences
Constructing New Logical Equivalences
We can show that two expressions are logically
equivalent by developing a series of logically
equivalent statements.
To prove that we produce a series of
equivalences beginning with A and ending with B.