1.2 Basic Operations and Truth Tables: T Q R Q P
1.2 Basic Operations and Truth Tables: T Q R Q P
Basic Truth Tables and Truth Values of Expressions in Propositional Calculus: In this
section we will get a first look of how to deal algebraically with propositions. This part of
symbolic logic is called Propositional Calculus. Our approach is informal and does not
build Propositional Calculus axiomatically.
In our early childhood we learn how to add three bananas to four bananas, and three
oranges to four oranges. Only later, after seeing many examples, we get the abstract
notion of “ 3 + 4 .” Several years down the road, we are led one step further and are
introduced to the algebraic expression “ a + b ”, being told that we can substitute 3 for a
and 4 for b and get “ 3 + 4 .”
Propositional Calculus works in a very similar way. Our variables are propositions and
we have three binary operations and the negation. We do not deal with the semantics of
an individual proposition, but rather we are interested in the way propositions are
combined and the truth-value of their combination, once we know the truth value of each
proposition (variable.) For example we can consider the expression
(( p ∧ q) ∨ r ) → ¬(q ∨ t ) .
This expression of propositions is a well-formed formula, since we have combined the
proposition successively in a proper way.
While in our traditional algebra, where a letter (variable) can be assigned any numerical
value, a proposition (variable) can be assigned only one of two values, true or false,
denoted by T and F, respectively. Thus in order to compute the truth value of the
expression, (( p ∧ q) ∨ r ) → ¬(q ∨ t ) , given the truth values of its variables, we need the
basic rules. For example if p takes the value of T and q takes the value of F; what is the
truth value of p ∧ q ? In the Table 1 and Table 2 we depict these basic rules.
36
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
p ¬p
T F
F T
Table 1
Table 2
Most of the entries in the tables above are very intuitive and model our reasoning. The
two problematic ones are in the implication, whenever the assumption p is false then the
implication p → q is true, regardless of the truth value of q. There are several ways that
we can explain the reason “why” mathematicians decided to define the truth value this
way, but we will not elaborate on it here, but rather in the appendix to this section.
Example 1
Let’s consider the expression (( p ∧ q) ∨ r ) → ¬(q ∨ t ) from above, and suppose that p is
T, q is T, r is F, and t is F. Then an easy computation shows that the expression
(( p ∧ q) ∨ r ) → ¬(q ∨ t ) takes the value F.
As will be seen below, in the sample problems, we are asked sometimes to build a truth
table for a given expression. This means that we have to evaluate the given expression
for all possible values of its variables. If there are two variables, then there are 4
possibilities, and more general, if there are n variables, then there are 2n possibilities.
Example 2
In the following table we will show all the possible truth values for three variables p, q,
and 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
37
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
Definition 3
Definition 4
Example 5
We list below plenty of identities that can be easily verified using Tables 1 and 2.
38
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
In the first group there are identities which either follow intuitively from our spoken
language or are very natural.
The second group consists of identities which replace a given operation by another one.
It can be shown that every expression can be brought into a form where only negation
and one of the three: and, or and implication are used.
The third group consist of two classic ones that are very helpful.
SAMPLE PROBLEMS
PROBLEM 1.2.1:
39
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
SOLUTION:
p q r A1 = r ∧ ¬q A2 = ¬(r ∧ p) A1 ∨ ¬A2
T F F F T F
PROBLEM 1.2.2:
SOLUTION:
PROBLEM 1.2.3:
Use a De-Morgan’s Law to write ¬p ∨ (¬s ∨ r ) using only “ ∧ ” and negation. Simplify
all double negations, whenever possible.
SOLUTION:
¬p ∨ (¬s ∨ r ) = ¬p ∨ ¬ ( ¬¬s ∧ ¬r ) = ¬p ∨ ¬ ( s ∧ ¬r ) = ¬ ( ¬¬p ∧ ¬¬ ( s ∧ ¬r ) ) =
= ¬ ( p ∧ ( s ∧ ¬r ) )
PROBLEM 1.2.4:
Use a De-Morgan’s Law to write ¬p ∨ ¬(¬s ∧ r ) using only “ ∨ ” and negation. Simplify
all double negations, whenever possible.
SOLUTION:
¬p ∨ ¬(¬s ∧ r ) = ¬p ∨ ¬¬(¬¬s ∨ ¬r ) = ¬p ∨ ( s ∨ ¬r )
40
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
PROBLEM 1.2.5:
Use a truth table to determine for the given pairs of expressions whether P and Q are
equivalent, or P ≺ Q , or Q ≺ P , or none of the above.
SOLUTION:
(a)
p q r P = ( p ∧ q ) ∨ ( ¬ p ∧ ¬r ) Q = p ∨ ¬r
0 T T T T T
1 T T F T T
2 T F T F T
3 T F F F T
4 F T T F F
5 F T F T T
6 F F T F F
7 F F F T T
(b)
p q r P = ( p ∧ q) ∧ r Q = ( p → ¬q ) → ¬ r
0 T T T T T
1 T T F F T
2 T F T F F
3 T F F F T
4 F T T F F
5 F T F F T
6 F F T F F
7 F F F F T
41
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
(c)
p q r P = ( p → q) → r Q = ¬(¬p ∨ q ) ∨ r
0 T T T T T
1 T T F F F
2 T F T T T
3 T F F T T
4 F T T T T
5 F T F F F
6 F F T T T
7 F F F F F
Since the columns of P and Q are identical, it follows that P and Q are equivalent.
PROBLEM 1.2.6:
SOLUTION:
R = ¬( p → q ) ∧ ¬r = ¬ ( ¬( p → q ) → r )
PRACTICE PROBLEMS
(a) A1 = ( p ∨ ¬r ) ∧ s
(b) A2 = ( p ∧ ¬q) ∨ ( p ∧ r )
(c) A3 = ¬ ( ¬( p ∧ q ) ∨ ( p ∧ s ) )
(d) A4 = (( p ∧ q) ∧ r ) ∨ ¬s
(e) A5 = ( p ∧ ¬q ) ∨ ¬ ( r ∧ s )
2. Use De-Morgan’s Laws to write each of the expressions in problem 1 using only
∧ and negation.
3. Use De-Morgan’s Laws to write each of the expressions in problem 1 using only
42
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
∨ and negation.
4. Use a truth table to determine for the given pairs of expressions whether P ≺ Q or
Q ≺ P , or P is equivalent to Q, or none of the above.
(a) P = (a ∧ b) → (c → ¬b) Q = ( a → ¬b ) → ( c → b )
(b) P = (a ∨ c) → (a → b) Q = (a → ¬c) → (b → ¬c)
(c) P = (a ∨ b) → c Q = (a → c) ∧ (b → c)
(d) P = (a → b) ∧ (c → d ) ∧ (a ∨ c) Q = c∨d
(e) P = (a → b) ∧ (c → d ) ∧ (¬b ∨ ¬d ) Q = ¬a ∨ ¬b
5. (a) Write each of the expressions P and Q in problem 4 using only ∧ and negation.
(b) Write each of the expressions P and Q in problem 4 using only ∨ and negation.
(c) Write each of the expressions P and Q in problem 4 using only → and negation.
43
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
APPENDIX
Observation 1
Suppose that a car travels at a speed of 50 miles per hour for 3 hours. The distance that
the car will travel will be 50 × 3 = 150 miles. However, if we add orientation to the
direction of the car, say, if it travels at a speed of 50 miles per hour, we mean that it
travels to the right and if it travels at a speed of -50 miles per hour, we mean that it
travels to the left. Furthermore, suppose that at t = 0 , the car is at x = 0 on the x-axis.
We can give orientation to the time as well. When we say +3, we mean three hours in the
future from t = 0 and if we say -3, we mean three hours before t = 0 . Now, all the four
products ( +50) × ( +3), ( +50) × ( −3), (−50) × (+3), (−50) × (3) make perfect sense.
Next let’s get to the logical implication. The logical implication is distinct from the
spoken language implication since in our spoken language whenever we use the phrase
“If…, then…” we do not have in mind what happens in case that the “If part” is false. In
the next two examples we will give two arguments why it is convenient and appropriate
to decide that the truth value of p → q is T, whenever p is F.
Observation 2
Let’s define an honest person using an If…, then…statement. Person x will be called
honest if x has found a big amount of money and brought it to the police station in order
to help find the legal owner. Here are the responses of three people.
Abe: Yes, I once found a bag with $1,000 and brought it to the police station.
Bob: I once found $3,000, but I never told anyone about it and took it home.
Chad: I am sorry, I never found a penny. I wish I would, but I never did.
Using our definition Abe is honest and Bob is not. But what about Chad? Let’s give the
benefit of the doubt and declare him to be honest.
Observation 3
44
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
p q p ∧ ¬q p→q
T T F T
T F T F
F T F T
F F F T
45
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
HOMEWORK 1.2
1. (a) Construct a truth table for the following expressions. Then determine whether A
and B are equivalent, or A ≺ B , or B ≺ A , or none of the above.
A = ¬( q ∧ ¬r ) ∨ p
B = (¬q ∨ r ) ∨ ¬p
p q r A = ¬(q ∧ ¬r ) ∨ p B = (¬q ∨ r ) ∨ ¬p
0 T T T
1 T T F
2 T F T
3 T F F
4 F T T
5 F T F
6 F F T
7 F F F
(b) Construct a truth table for the following expressions. Then determine whether P
and Q are equivalent, or P ≺ Q , or Q ≺ P , or none of the above.
p q r P = ( ¬p → q ) ∧ r Q = ( p → ¬ q ) ∨ ¬r
0
1
2
3
4
5
6
7
2. Use De-Morgan’s Laws to write the following expression using only ∧ and negation.
(a) (¬p ∧ q ) ∨ ( q ∧ r )
(b) ( p ∨ ¬q ) ∨ ( p ∧ r )
3. Use De-Morgan’s Laws to write the following expression using only ∨ and negation.
46
Introduction to Logic. Copyright © 2005, by Arie Bialostocki. All rights reserved.
(a) ( p ∨ r ) ∧ (¬p ∧ ¬q )
(b) ¬( p ∧ q ) ∧ (¬q ∨ r )
4. Write the following expressions using only ∧ and negation.
(a) R = ¬( p ∧ r ) → (¬r → p )
(b) R = (( p ∧ q ) → ¬r ) → ( p ∧ r )
(a) R = ( p ∧ r ) ∨ ¬( p ∨ q )
(b) R = ¬( p ∨ ¬r ) ∧ ( r ∨ p )
(a) R = (¬p ∨ r ) → (q → r )
(b) R = ( p ∨ r ) → (¬r → q)
47