Professional Documents
Culture Documents
Chapter 1
The Foundations: Logic and Proofs
“y > 5”
Is this a statement? no
It’s a request.
Is this a proposition? no
• 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.
11/17/2023 Discrete Mathematics Chapter 1 18
The Negation Operator
The unary negation operator “¬” (NOT)
transforms a proposition into its logical negation.
E.g. If p = “I have brown hair.”
then ¬p = “It is not the case that I have brown
hair” or “I do not have brown hair.”
The truth table for NOT:
p p
T F
F T
Operand Result
11/17/2023
column
Discrete Mathematics Chapter 1
column 19
The Conjunction Operator
The binary conjunction operator “” (AND)
combines two propositions to form their logical
conjunction.
p q pq
T T T
T F F
F T F
F F F
Note that a conjunction p1 p2 … pn of n
propositions will have 2n rows in its truth table
11/17/2023 Discrete Mathematics Chapter 1 21
The Disjunction Operator
The binary disjunction operator “” (OR)
combines two propositions to form their
logical disjunction.
F F F
Note that pq means that p is true, or q is
true, or both are true!
So, this operation is also called inclusive or,
because it includes the possibility that both
p and
11/17/2023
q are true.
Discrete Mathematics Chapter 1 23
The Exclusive-Or Operator
p q pq
T T T
The only
T F F False case!
F T T
F F T
p q is false only when p is true but q is not true.
p q does not require that p or q are ever true!
E.g. “(1=0) pigs can fly” is TRUE!
11/17/2023 Discrete Mathematics Chapter 1 28
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
PQR
Why use XOR here? – example of ambiguity of natural
languages
– P: School is closed
– Q: 2 feet of snow falls
– R: wind chill is below -100
QRP
Precedence among operators:
, , , ,
T T F F T
T F T T T
F T T T T
F F T T T
The statements (PQ) and (P) (Q) are logically equivalent,
since they have the same truth table, or put it in another way,
(PQ) (P) (Q) is always true.
11/17/2023 Discrete Mathematics Chapter 1 34
Tautologies and Contradictions
A tautology is a statement that is always true.
Examples:
– R(R)
– (PQ) (P)( Q)
A contradiction is a statement that is always false.
Examples:
R(R)
((P Q) (P) (Q))
The negation of any tautology is a contradiction, and the
negation of any contradiction is a tautology.
Is it true? yes
p˄q pq
_____ qr Hypothetical
p Simplification _____ syllogism
pr (chaining)
p
q pq
_____ Conjunction ¬p Disjunctive
p˄q _____ syllogism
q (resolution)
p
pq Modus ponens
_____
q
Another example:
“If it rains today, then we will not have a barbeque
today. If we do not have a barbeque today, then we will
have a barbeque tomorrow.
Therefore, if it rains today, then we will have a
barbeque tomorrow.”
pq
qr Hypothetical
______
syllogism
Pr
i: “Gary is intelligent.”
a: “Gary is a good actor.”
c: “Gary can count from 1 to 10.”
Step 1: c Hypothesis
Step 2: i c Hypothesis
Step 3: i Modus tollens Steps 1 & 2
Step 4: aI Hypothesis
Step 5: a Disjunctive Syllogism
Steps 3 & 4
x P(x) Existential
______________________
P(c) for some element c U instantiation
Example:
U(x): “x is a PU student.”
G(x): “x is a genius.”
x P(x) Universal
__________
P(c) if c U instantiation
n is odd.
Therefore, 3n + 2 is even.