Lecture Notes 2
Lecture Notes 2
• Substitution Principle:
– Replace a statement with another statement having the same truth value.
• Tautology:
– A compound proposition always true, regardless of the truth values of its variables.
• Contradiction:
– A compound proposition always false, irrespective of variable truth values.
1
Logical equivalences
• p ≡ q : the compound propositions p and q are logically equivalent if p ↔
q is a tautology
• We can use truth tables to determine whether two propositions are
equivalent or not.
Example: Show that ┐(p v q) and ┐p ┐ q are logically equivalent.
2
An Important Logical Equivalence
p q p q
p q p→q ┐p˅q
T T T T
T F F F
F T T T
F F T T
3
De Morgan’s laws
4
Examples
• Original Example: "Sara finished her homework and Alex completed his
assignments."
• Negation: "Sara did not finish her homework or Alex did not complete his
assignments."
5
Logical equivalences
6
Logical equivalences
7
Logical equivalences
8
Example
• Show that
9
Predicates and Propositional Functions
• Statement: x > 3
• Subject: The variable x is the subject of the statement.
• Predicate: The predicate "is greater than 3" refers to a property that the
subject can have.
• Denotation: Denote the statement by p(x), where p is the predicate "is
greater than 3" and x is the variable.
• Propositional Function: p(x), also known as the value of the propositional
function p at x.
• Truth Value: Once a value is assigned to x, p(x) becomes a proposition
with a truth value.
10
Example of a Propositional Function
• Let p(x) denote the statement “x > 3”
– p(4): setting x=4, thus p(4) is true
– p(2): setting x=2, thus p(2) is false
11
N-ary Predicate
• A statement involving n variables, x1, x2, …, xn, can be denoted by p(x1, x2,
…, xn)
• p(x1, x2, …, xn) is the value of the propositional function p at the n-tuple
(x1, x2, …, xn)
• p is also called n-ary predicate
Example:
x + 2y + 3z < 18
is a propositional function on N × N × N. Such a propositional function has no
truth value.
12
Quantifiers
• Quantifiers can be used to express the extent to which a
predicate is true
• In English, all, some, many, none, few
• Focus on two types:
– Universal: a predicate is true for every element under
consideration
– Existential: a predicate is true for there is one or more
elements under consideration
• Predicate calculus: the area of logic that deals with predicates
and quantifiers
13
Universal quantifier
• “p(x) for all values of x in the domain”
x p (x)
• Read it as “for all x p(x)” or “for every x p(x)”
• A statement x p(x)is false if and only if p(x) is
not always true
• An element for which p(x) is false is called a
counterexample of x p(x)
• A single counterexample is all we need to
establish that is not true
x p (x)
14
Universal quantifier
15
Example
• Let p(x) be “x2>0”. To show that the statement
x p (x)is false where the domain consists of all
integers
> Show a counterexample (take x=0)
• When all the elements can be listed, e.g., x1, x2, …,
xn; it follows that the universal quantification
is same as thexconjunction
p (x) p(x1) ˄p(x2) ˄…˄
p(xn)
16
Example
• What is the truth value of x p(x) where p(x)
is the statement “x2 < 10” and the domain
consists of positive integers not exceeding 4?
x p (x) is same as p(1)˄p(2)˄p(3)˄p(4)
17