Algorithm for making Truth Table

Logical Operators (Connectives)
We will examine the following logical operators:
• Negation (NOT, )
• Conjunction
(AND, )
• Disjunction
(OR, )
• Exclusive-or
(XOR,  )
• Implication
(if – then,  )
• Biconditional
(if and only if,  )
Truth tables can be used to show how these operators
can combine propositions to compound propositions.
Negation (NOT)
Unary Operator, Symbol: 
P
 P
true (T)
false (F)
false (F)
true (T)
2
Conjunction (AND)
Binary Operator, Symbol: 
P
Q
P Q
T
T
T
T
F
F
F
T
F
F
F
F
Note: p∧ q is T if and only if p is T and q is T.
3
Disjunction (OR)
Binary Operator, Symbol: 
P
Q
P Q
T
T
T
T
F
T
F
T
T
F
F
F
Note: p V q is F is and only if q is F and q is F.
4
Exclusive Or (XOR)
Binary Operator, Symbol: 
P
Q
PQ
T
T
F
T
F
T
F
T
T
F
F
F
PQ : Today is either Tuesday or it is Thursday.
: Pat is either male or female only one of P or Q must be true
5
Implication (if - then)
Implication (continued)
– Equivalent forms:
•
•
•
•
•
•
•
If P, then Q
P implies Q
If P, Q
P is a sufficient condition for Q
Q if P
Q whenever P
Q is a necessary condition for P
– Terminology:
• P = premise, hypothesis, antecedent
• Q = conclusion, consequence
Implication (if - then)
Binary Operator, Symbol: 
P
Q
PQ
T
T
T
T
F
F
F
T
T
F
F
T
7
Biconditional (if and only if (iff))
Binary Operator, Symbol: 
P
Q
PQ
T
T
T
T
F
F
F
T
F
F
F
T
Both P and Q must have the same truth value.
8
Algorithm for making Truth Table
Step 1: The first n columns of the table are labeled by the
component propositional variables. Further columns are included
for all intermediate combinations of the variables, culminating in
a column for the full statement.
Step 2: Under each of the first n headings, we list the 2n possible ntuples of truth values for the n component statements.
Step 3: For each of the remaining columns, we compute, in
sequence, the remaining truth values.
Statements and Operators
Statements and operators can be combined
in any way to form new statements.
P
Q
P
Q
(P)(Q)
T
T
F
F
F
T
F
F
T
T
F
T
T
F
T
F
F
T
T
T