0% found this document useful (0 votes)
20 views77 pages

Logic 2024

The document provides an introduction to propositional logic. It defines key concepts including: - Propositions are statements that are either true or false. - Logical connectives like negation, conjunction, disjunction, implication and biconditional are used to combine propositions into compound statements. - Truth tables are used to define the semantics of logical connectives and determine the truth values of compound statements. - Applications of propositional logic include translating English sentences into formal logic and specifying systems formally.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views77 pages

Logic 2024

The document provides an introduction to propositional logic. It defines key concepts including: - Propositions are statements that are either true or false. - Logical connectives like negation, conjunction, disjunction, implication and biconditional are used to combine propositions into compound statements. - Truth tables are used to define the semantics of logical connectives and determine the truth values of compound statements. - Applications of propositional logic include translating English sentences into formal logic and specifying systems formally.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

Introduction to Logic

Introduction: Propositional Logic (PL)


• Logic is the study of the relationships between objects and forms
the basis of all mathematical reasoning and all automated
reasoning
• is study of abstract reasoning, specifically, concerned with
whether reasoning is correct
• focuses on relationship among statements
• as opposed to the content of any particular statement.

• In Propositional Logic ( Propositional Calculus or Sentential


Logic), the objects are called propositions
• Definition: A proposition is a statement that is either true or
false, but not both. We denote a proposition by a letter: p, q, r
Examples: 3+5=8 (true statement)
Today is Friday (false statement)
Note: x>y is not a statement
Propositions: Examples
• The following are propositions
– The grass is wet W
– It is raining R
• The following are not propositions
C++ is the best language Opinion
When is the pretest? Interrogative
Do your homework Imperative
• Opinions, interrogative, and imperative are not propositions
Determine if following statements are true?

• 2+2=5
• Every integer is divisible by 12
• Microsoft is an excellent company (Not Statement)
• 1+101=110 (Universe of Discourse)
Introduction: Proposition
• Definition: The value of a proposition is called its truth value
denoted by
– T or 1 if it is true or
– F or 0 if it is false
• Truth table
Logical connectives
• Connectives are used to create a compound
proposition from two or more propositions
– Negation (denote ¬ or !)
– And logical conjunction (denoted ∧)
– Or logical disjunction (denoted ∨)
– XOR or exclusive or (denoted ⊕)
– Implication (denoted ⇒ or →)

– Biconditional (denoted ⇔ or ↔)

• We define the meaning (semantics) of the logical


connectives using truth tables
Logical Connective: Negation
• ¬p, the negation of a proposition p, is also a
proposition
• Examples:
– Today is not Monday
– It is not the case that today is Monday, etc.
• Truth table
Logical Connective: Logical And
• The logical connective And is
true only when both of the •Truth Table
propositions are true.
• It is also called a conjunction
• Examples:
• It is raining and it is warm
• (2+3=5) and (1<2)
• Kamal’s cat is dead and
Kamal’s dog is not dead.
Logical Connective: Exclusive Or
• The exclusive Or, or XOR, of Truth Table
two propositions is true when
exactly one of the
propositions is true and the
other one is false
• Example: The circuit is either
ON or OFF but not both
• Let ab<0, then either a<0 or
b<0 but not both
• You may have cake or ice
cream, but not both
Logical Connective: Implication
• Definition: Let p and q be two
propositions. Truth Table
• The implication p→q is the
proposition that is false when p
is true and q is false and true
otherwise
• p is called the hypothesis,
antecedent, premise
• q is called the conclusion,
consequence
Logical Connective: Implication
• The implication of p→q can be
also read as Example:
• If you get 100% on the final,
– If p then q
then you will get an A.
– p implies q • If you manage to get a
– If p, q 100% on the final, then you
– p only if q would expect to receive an
– q if p A.
• If you do not get 100% you
– q when p
may or may not receive an
– q whenever p A depending on other
– q follows from p factors.
– p is a sufficient condition for q
(p is sufficient for q)
– q is a necessary condition for
p (q is necessary for p)
Logical Connective: Implication (3)
• Examples
–If you buy you air ticket in advance, it is cheaper.
–If x is an integer, then x2 ≥ 0.
–If it rains, the grass gets wet.
–If the sprinklers operate, the grass gets wet.
–If 2+2=5, then all unicorns are pink.
• If the Sun is a planet, elephants will fly is true statement
Hypothesis is false, thus the whole statement is true.
Which of the following implications is true?

• If -1 is a positive number, then 2+2=5


True. The premise is obviously false, thus no matter what the
conclusion is, the implication holds.
• If -1 is a positive number, then 2+2=4
True. Same as above.

• If sin x = 0, then x = 0
False. x can be a multiple of π. If we let x=2π, then sin x=0 but x≠0.
The implication “if sin x = 0, then x = kπ, for some k” is true.
Converse, Inverse, Contrapositive
• Consider the proposition p → q
– Its converse is q → p
– Its inverse is ¬p → ¬q
– Its contrapositive is ¬q → ¬p Truth Table
Logical Connective: Biconditional
• The bi conditional p↔q is
the proposition that is true
when p and q have the same Truth table
truth values. It is false
otherwise.
• Note that it is equivalent to
(p→q)∧(q→p)
Example:
Let p :“You can take the flight,”
let q :“You buy a ticket.”
Then p ↔ q is “You can take the flight
if and only if you buy a ticket.
Logical Connective: Biconditional (2)
• The biconditional p↔q can be equivalently read
as
– p if and only if q
– p is a necessary and sufficient condition for q
– if p then q, and conversely
– p iff q
• Examples
– x>0 if and only if x2 is positive
– The alarm goes off iff a burglar breaks in
– You may have pudding iff you eat your meat
Which of the following biconditionals is true?

• x2 + y2 = 0 if and only if x=0 and y=0


True. Both implications hold

• 2 + 2 = 4 if and only if √2<2


True. Both implications hold.

• x2 ≥ 0 if and only if x ≥ 0
False. The implication “if x ≥ 0 then x2 ≥ 0” holds.
However, the implication “if x2 ≥ 0 then x ≥ 0” is false.
Consider x=-1.
The hypothesis (-1)2=1 ≥ 0 but the conclusion fails.
Truth Tables
• A logical statement having n component statements
will have 2n rows in its truth table.
• For n = 2, 22 = 4 rows
Distinct Truth Tables
A logical statement having n variables must have its truth
table one of the 22(raise to n) possible truth tables,
Each of which having 2n rows.

Eg. P^(pvq) has truth value 4th column

The Number of distinct truth tables for formulas involving two


variables is given by 22raise to 2.= 16.
Reference: Trembley
Example: Constructing a Truth Table
1. p ˄ (~ p ˅ ~ q) 2. (( p ∧ q )∨ ¬q )
Constructing Truth Tables for 3 Variable
Construct the truth table for: (p → q )˄ (q → r)
Constructing Truth Tables Biconditional
Precedence of Logical Operators
• As in arithmetic, an ordering is imposed on the use of logical
operators in compound propositions
• However, it is preferable to use parentheses to disambiguate
operators and facilitate readability
¬ p ∨ q ∧ ¬ r ≡ (¬p) ∨ (q ∧ (¬r))
• To avoid unnecessary parenthesis, the following precedence
hold:
– Negation (¬)
– Conjunction (∧)
– Disjunction (∨)
– Implication (→)
– Biconditional (↔)
Well-formed formula
• Formal language

• Alphabet
A well-formed formula (wff) in propositional logic is:
(1) An atom is a wff
(2) If P is a wff, then ~P is a wff.
(3) If P and Q are wffs then P∧Q, P∨Q, P→Q, P↔Q are wffs.
(4) The set of all wffs can be generated by repeatedly applying rules
(1)..(3).

• pV^^q Not WFF


Usefulness/ Applications of Logic
• Logic is more precise than natural language
– You may have cake or ice cream.
• Can I have both?
– If you buy your air ticket in advance, it is cheaper.
• Are there or not cheap last-minute tickets?
Hence we Use Proposition Logic
• Applications:
• Translating English Sentences
• System Specifications
• Boolean Searches
• Logic Puzzles
• Logic Circuits
Properties of WFF
• Definitions
– A compound proposition that is always true, no matter what the
truth values of the propositions that occur in it is called a
tautology
– A compound proposition that is always false is called a
contradiction
– A proposition that is neither a tautology nor a contradiction is a
contingency
• Examples
– A simple tautology is p ∨ ¬p
– A simple contradiction is p ∧ ¬p
Logical Equivalences: Definition
• Definition: Propositions p and q are logically
equivalent if p ↔ q is a tautology.
• Informally, p and q are equivalent if whenever
p is true, q is true, and vice versa
• Notation: p ≡ q (p is equivalent to q), p ↔ q,
and p ⇔ q
• Alert: ≡ is not a logical connective
Logical Equivalences: Example 1
• Are the propositions (p → q) and (¬p ∨ q) logically
equivalent?
• To find out, we construct the truth tables for each:
The two columns in the truth table are identical, thus we
conclude that
(p → q) ≡ (¬p ∨ q)

• Prove DeMorgan’s Law Using


truth table.
Logical Equivalences: Example
• Show that (p → r) ∨ (q → r) ≡ (p ∧ q) → r
Logical Equivalences: Example
• Show that (p → r) ∨ (q → r) ≡ (p ∧ q) → r

• A and B are
logically
equivalent as A
<-> B Tautology
Logical Equivalences: Example
•Show that (p → q ) ∨ (q→p) is a tautology using Truth table
Logical Equivalences: Example
1. (p ∨(~ (p ∧ q)) 2. (p ∧ q) ∧ ~ (p ∨ q)
Expressing Connectives :
Some connectives can be expressed through others
Using Logical Equivalences: Example
• Logical equivalences can be used to construct additional logical
equivalences
• Example:
• Show that (p ∧ q) →q is a tautology using truth table(h. w.)
• Show that (p ∧ q) →q is a tautology without using truth table
0. (p ∧ q) →q
1. ≡ ¬(p ∧ q) ∨ q Implication Law on 0
2. ≡ (¬p ∨ ¬q) ∨ q De Morgan’s Law (1st) on 1
3. ≡ ¬p ∨ (¬q ∨ q) Associative Law on 2
4. ≡ ¬p ∨ T Negation Law on 3
5. ≡ T Domination Law on 4
Using Logical Equivalences: Example
• Example : Show that ¬(p ↔ q) ≡ (p ↔ ¬q)
• Sometimes it helps to start with the second proposition (p ↔ ¬q)
0. (p ↔ ¬q)
1. ≡ (p → ¬q) ∧ (¬q → p) Equivalence Law on 0
2. ≡ (¬p ∨ ¬q) ∧ (q ∨ p) Implication Law on 1
3. ≡ ¬(¬((¬p ∨ ¬q) ∧ (q ∨ p))) Double negation on 2
4. ≡ ¬(¬(¬p ∨ ¬q) ∨ ¬(q ∨ p)) De Morgan’s Law…
5. ≡ ¬((p ∧ q) ∨ (¬q ∧ ¬p)) De Morgan’s Law
6. ≡ ¬((p ∨ ¬q) ∧ (p ∨ ¬p) ∧ (q ∨ ¬q) ∧ (q ∨ ¬p))
Distribution Law
7. ≡ ¬((p ∨ ¬q) ∧ (q ∨ ¬p)) Identity Law
8. ≡ ¬((q → p ) ∧ (p → q)) Implication Law
9. ≡ ¬(p ↔ q) Equivalence Law
Using Logical Equivalences: Example
• Show that ¬(q → p) ∨ (p ∧ q) ≡ q
0. ¬(q → p) ∨ (p ∧ q)
1. ≡ ¬(¬q ∨ p) ∨ (p ∧ q) Implication Law
2. ≡ (q ∧ ¬p) ∨ (p ∧ q) De Morgan’s Double negation
3. ≡ (q ∧ ¬p) ∨ (q ∧ p) Commutative Law
4. ≡ q ∧ (¬p ∨ p) Distributive Law
5. ≡ q ∧ T Identity Law
≡q Identity Law
Examples
[(p→q) ∧ ~q] → ~p prove that it is tautology.
Answer:
[(p→q) ∧ ~q] → ~p
≡ [(~p∨q) ∧ ~q] → ~p Implication Law
≡[(~p ∧ ~q) ∨ (q ∧ ~q)] → ~p Distributive Law
≡ [(~p ∧ ~q) ∨ F] → ~p
≡ [~(p ∨ q)] → ~p Identity Law
≡ ~[~(p ∨ q)] ∨ ~p
≡ (p ∨ q) ∨ ~p
≡ (p ∨ ~p) ∨ q
≡T∨q
≡T
A tautology.
Simplifying Statement Forms

• Show that (¬ p ^ (¬q ^ r)) v (q ^ r) v (p ^ r) ≈ r


More Logical Equivalences
• Commutative laws:

• Associative laws:

• Distributive laws:

• Absorption laws:
Logical Equivalences Involving Conditional and
Biconditional Statements
Duality Law
The dual statement obtained by interchanging OR (unions)
into AND (intersections) (and vice versa), interchanging
T(Universal set) into F(Null set )(and vice versa) .
EXAMPLE:
A A* are known as duels of each other.
The dual of ¬p ∧ ¬ (q ∨ p ) is ¬p ∨ ¬ (q ∧ p )

1. (p v q) ^ r dual is (p ^ q) v r
2. (p ^ q) v T dual is (p v q) ^ F
3. ¬ (p v q) ^ (p v ¬ (q ^ ¬s )) dual is ¬ (p ^ q) v (p ^ ¬ (q v ¬s ))
Thus The negation of a formula is equivalent to its dual in which every
variable is replaced by its negation.

1. The dual of (p ^ q) is (p v q)
And ¬ (p ^ q) ≈ (¬p v ¬ q)
Functionally Complete Sets of Logic Gates

AND , OR, NOT are all that’s needed to express any combinational
logic function as a switching algebra expression
operators are all that were originally defined
Thus the set {AND, NOT}, {OR, NOT} is said to be functionally
complete.

Other functionally complete sets exist


{NAND} NAND by itself ( )
{NOR} NOR by itself (↓)

We can demonstrate how just NANDs or NORs (sometimes called


“universal gates”) can do AND, OR, NOT operations
Functionally Complete Sets: Nand and Nor
Express ¬p , p ∧ q, p ∨ q using only Nand and Nor Gates
Negation Normal Form: NNF
• A sentence ¬S is in negation normal form if the ¬ is
moved as far inside S as possible.
• Use DeMorgan’s and double negation laws.
Example: ¬[(A ∧ ¬ B) ∨ C]
≡ ¬ (A ∧ ¬ B) ∧ ¬ C
≡ (¬ A ∨ ¬ ¬ B) ∧ ¬ C
≡ (¬ A ∨ B) ∧ ¬ C

Example: ~(~(P ^ Q) v R) ≡ P ^ Q ^ ~R
Conjunctive and disjunctive normal forms
• CNF: a sentence that is a conjunction of one or more disjunctions
of one or more literals (and-of-ors-of-literals)
F1∧… ∧ Fn, Fi , i=1,n (Li1 ∨ … ∨Lim).
Example: (~A v C v D) ^ (A v ~C v E) ^ W

DNF: a sentence that is a disjunction of one or more conjunctions of


one or more literals(or-of-ands-of-literals)
F1 ∨ … ∨ Fn, Fi , i=1,n (Li1 ∧… ∧ Lim)
Example: (~A ^ C ^ D) v (A ^ ~C ^ E) v W
CNF, DNF
Elementary Product
A product of the statement variables and their negations in the formula is called
Elementary Product. The possible elementary products are

𝑃,𝑄, ¬𝑃 ∧ 𝑄, ¬𝑄 ∧ 𝑃, 𝑃 ∧ ¬𝑃,𝑄 ∧ ¬𝑄, 𝑃 ∧ ¬𝑃 ∧ 𝑄


It is necessary and sufficient condition for an elementary product to be identically false
that contain at least one pair of factor in which one is negation of other.

Elementary Sum
A sum of the two statement variables and their negations is called Elementary Sum. The
possible elementary sums are
𝑃,𝑄, ¬𝑃 ∨ 𝑄, ¬𝑄 ∨ 𝑃, 𝑃 ∨ ¬𝑃 ∨ 𝑄,𝑃 ∨ 𝑄
It is necessary and sufficient condition for an elementary sum to be identically True
that contain at least one pair of factor in which one is negation of other.

● Minterms ● Maxterms
𝑃 ∧ 𝑄, ¬𝑃 ∧ 𝑄, 𝑃 ∧ ¬ 𝑄, ¬ 𝑃 ∧ ¬ 𝑄 𝑃 ∨ 𝑄, ¬𝑃 ∨ 𝑄, 𝑃 ∨ ¬ 𝑄, ¬ 𝑃 ∨ ¬ 𝑄
Method to construct DNF/ PDNF
Construct a truth table for the proposition.
Use the rows of the truth table where the proposition is True to
construct minterms
If the variable is true, use the propositional variable in the minterm
If a variable is false, use the negation of the variable in the minterm
Connect the minterms with ∨’s.
Or use laws.
1. PDNF of ¬(p ∨ q) ↔ p ∧ q

PDNF:(¬ p∧q) ∨ (p∧¬q)


Find the DNF/ PDNF of (p ∨ q)→¬r

p q r (p ∨ q) ¬r (p ∨ q)→¬r
● From the truth table we can
T T T T F F set up the PDNF
T T F T T T ● There are five sets of input
T F T T F F that make the statement
T F F T T T true.
F T T T F F
● Therefore there are five
minterms.
F T F T T T
F F T F F T
F F F F T T

(p ∨ q)→¬r ⇔ (p∧q∧¬r) ∨ (p∧¬q∧¬r) ∨ (¬p∧q∧¬r) ∨ (¬p∧¬q∧r) ∨


(¬p∧¬q∧¬r)
Find the DNF / PDNF of (¬ p → r )∧(q ↔ p)

p q r ¬p ¬p→r q ↔ p (¬p→r)∧ (q ↔P)

T T T F T T T
T T F F T T T
T F T F T F F
T F F F T F F
F T T T T F F
F T F T F F F
F F T T T T T
F F F T F T F

From the truth table we can set up the PDNF


(¬ p → r )∧(q ↔ p)→¬r ⇔ (p∧q∧r) ∨ (p∧q∧¬r) ∨ (¬p∧¬q∧ r)
Find the DNF / PDNF of (¬ p → r )∧(q ↔ p)→¬r

p q r ¬p ¬p q↔ (¬p→r)∧ (q ¬r (¬ p → r )∧(q ↔ p)→¬r


→r p ↔P)

T T T F T T T F F
T T F F T T T T T
T F T F T F F F T
T F F F T F F T T
F T T T T F F F T
F T F T F F F T T
F F T T T T T F F
F F F T F T F T T

From the truth table we can set up the PDNF


(¬ p → r )∧(q ↔ p)→¬r ⇔ (p∧q∧ ¬ r) ∨ (p∧ ¬ q∧r) ∨ (p∧ ¬
q∧¬r) ∨ (¬p∧q∧ r) ∨ (¬ p∧ q∧¬r) ∨ (p∧ ¬ q∧¬r)
Find the PDNF and PCNF of (P → Q) → R

p q r p→q (p→q ) →r
T T T T T
T T F T F
T F T F T
T F F F T
F T T T T
F T F T F
F F T T T
F F F T F

From the truth table we can set up the PDNF


(P → Q) → R ⇔ (¬p∧¬q∧ r) ∨ (¬ p∧q∧r) ∨ (p∧¬q∧¬r)
∨ (p∧¬q∧ r) ∨ (p∧q∧r)
From the truth table we can set up the PCNF
(P → Q) → R ⇔ (p ∨ q ∨ r) ∧(p ∨ ¬ q ∨ r) ∧ (¬ p ∨ ¬q ∨ r)
Find PDNF of p∨(~p → (q∨ (~ q → r)))

p∨(~p → (q∨ (~ q → r))) ⇔


(¬p ∧ ¬q ∧ r) ∨ (¬ p ∧ q∧ ¬r) ∨ (¬ p ∧ q∧ r) ∨
(p∧¬q∧ ¬ r) ∨ (p∧ ¬ q∧ r) ∨
(p ∧ q ∧ ¬ r) ∨ (p ∧ q ∧ r)
Find PDNF (p => (q ∧ r)) ∧(~ p => (~q ∧ ~r))

(p => (q ∧ r)) ∧(~ p => (~q ∧ ~r)) ⇔


(¬p ∧ ¬q ∧ ¬ r) ∨ (p ∧ q ∧ ¬ r)
Find an expression equivalent to p → q
that uses only conjunctions and negations.
p q p→q
How many minterms in the PDNF?
T T T
T F F
F T T
F F T
The PDNF of p → q is (p∧q) ∨ (¬p∧ q) ∨ (¬p∧ ¬q).
Then, applying DeMorgan’s Law, we get that this is
equivalent to
¬[¬(p∧q) ∧ ¬(¬p∧ q) ∧ ¬(¬p∧ ¬q)].
Now can we write an equivalent statement to p → q
that uses only disjunctions and negations?

p→q
⇔ (p∧q) ∨ (¬p∧ q) ∨ (¬p∧ ¬q). From PDNF
⇔ ¬[¬(p∧q) ∧ ¬(¬p∧ q) ∧ ¬(¬p∧ ¬q)] NNF & DeMorgan
⇔¬[(¬p∨¬q) ∧ (¬¬p∨¬q) ∧ (¬¬p ∨ ¬¬q)] DeMorgan
⇔¬[(¬p∨¬q) ∧ (p∨¬q) ∧ (p∨q)] Doub. Neg.
⇔[¬(¬p∨¬q) ∨ ¬(p∨¬q) ∨ ¬(p∨q)] DeMorgan
Double Implication Law
Implication Law CNF

Add Missing Proposition

Distributive Law PCNF

CSCE 235, Spring 2010 Logic 55


Find the PDNF and PCNF : (~p → r) ∧ (q ↔ p )

PDNF :
(¬p∧¬q∧ r) ∨
(p∧¬q∧¬r) ∨
(p∧q∧r)

PCNF :
(p ∨ q ∨ r) ∧
(p ∨ ¬ q ∨ r) ∧
(p ∨ ¬q ∨¬ r) ∧
(¬ p ∨ q ∨ r) ∧
(¬ p ∨ q ∨¬ r)
Distributive Laws, Normal Forms

• p∧(q∨r) ≡ (p∧q)∨(p∧r)
• p∨(q∧r) ≡ (p∨q)∧(p∨r)
• By applying these transformations, every formula
can be put in either
– Conjunctive normal form (and-of-ors-of-literals), or
– Disjunctive normal form (or-of-ands-of-literals)
• ¬p∨ (¬q∧¬r) is in DNF
• (¬p∨¬q)∧(¬p∨¬r) is an equivalent CNF
Quantifiers
Universe of Discourse, U: The domain of a variable in
a propositional function.
Universal Quantification ∀xP(x) of P(x) is the
proposition:“P(x) is true for all values of x in U.”

Existential Quantification ∃xP(x) of P(x) is the


proposition: “There exists an element, x, in U such
that P(x) is true.”
Universal Quantification of P(x)
∀xP(x) “for all x P(x)” “for every x P(x)”
Defined as:
P(x0) ∧ P(x1) ∧ P(x2) ∧ P(x3) ∧ . . . for all xi in U
∙ True when P(x) is true for every x.

∙ False if there is an x for which P(x) is false.

Example: Let P(x) denote x2 ≥ x


If U is x such that 0 < x < 1 then ∀xP(x) is false.
If U is x such that 1 < x then ∀xP(x) is true.
Existential Quantification of P(x) is ∃xP(x)
• there is an x such that P(x)
• there is at least one x such that P(x)
• there exists at least one x such that P(x)”
Defined as:
P(x0) ∨ P(x1) ∨ P(x2) ∨ P(x3) ∨ . . . for all xi in U
∙ True if there exists an x for which P(x) is true.

∙ False if P(x) is false for every x.

Example:
Let P(x) denote x2 ≥ x
If U is x such that 0 < x ≤ 1 then ∃xP(x) is true.
If U is x such that x < 1 then ∃xP(x) is true.
Example:
Example: Suppose P(x) indicates a predicate where "x is a
square" and Q(x) also indicates a predicate where "x is a
rectangle". Now we will find the universal quantifier of these
predicates.
Solution:
The statement must be:
∀x (x is a square ⇒ x is a rectangle), i.e., "all squares are
rectangles.'' The following syntax is used to describe this
statement:
∀xP(x) ⇒Q(x)
Negation (it is not the case)
¬∃xP(x) equivalent to ∀x¬P(x)
•True when P(x) is false for every x
•False if there is an x for which P(x) is true.

¬ ∀xP(x) is equivalent to ∃x¬P(x)


•True if there exists an x for which P(x) is false.
•False if P(x) is true for every x.
Quantifiers
Quantification of Two Variables
(read left to right)
∀x∀yP(x,y) or ∀y∀xP(x,y)
•True when P(x,y) is true for every pair x,y.
•False if there is a pair x,y for which P(x,y) is false.

∃x∃yP(x,y) or ∃y∃xP(x,y)
True if there is a pair x,y for which P(x,y) is true.
False if P(x,y) is false for every pair x,y.
Quantification of Two Variables
∀x∃yP(x,y)
•True when for every x there is a y for which P(x,y) is true.
(in this case y can depend on x)
•False if there is an x such that P(x,y) is false for every y.

∃y∀xP(x,y)
•True if there is a y for which P(x,y) is true for every x.
(i.e., true for a particular y regardless (or independent) of x)
•False if for every y there is an x for which P(x,y) is false.

Note that order matters here


In particular, if ∃y∀xP(x,y) is true, then ∀x∃yP(x,y) is true.
However, if ∀x∃yP(x,y) is true, it is not necessary that ∃y∀xP(x,y)
is true.
Equivalence of quantifiers
Examples

■ All purple mushrooms are poisonous


■ ∀x (Purple(x) ∧ Mushroom(x)) ⇒ Poisonous(x)
■ ∀x Purple(x) ⇒ (Mushroom(x) ⇒ Poisonous(x))
■ ∀x Mushroom (x) ⇒ (Purple (x) ⇒ Poisonous(x))
Examples
Consider these statements, of which the first three are premises and the fourth is
a valid conclusion.
“All hummingbirds are richly colored.”
“No large birds live on honey.”
“Birds that do not live on honey are dull in color.”
“Hummingbirds are small.”
Let P (x), Q(x), R(x), and S(x) be the statements “x is a hummingbird,” “x is
large,” “x lives on honey,” and “x is richly colored,” respectively.
Assuming that the domain consists of all birds, express the statements in the
argument using quantifiers and P (x), Q(x), R(x), and S(x).

Solution: We can express the statements in the argument as


∀x(P (x) → S(x)).
¬∃x(Q(x) ∧ R(x)).
∀x(¬R(x) → ¬S(x)).
∀x(P (x) → ¬Q(x)).
Examples
Consider these statements. The first two are called premises and the third is called the
conclusion. The entire set is called an argument.
“All lions are fierce.”
“Some lions do not drink coffee.”
“Some fierce creatures do not drink coffee.”

Let P (x), Q(x), and R(x) be the statements “x is a lion,” “x is fierce,” and “x drinks
coffee,” respectively.
Assuming that the domain consists of all creatures, express the statements in the
argument using quantifiers and P (x), Q(x), and R(x).

Solution: We can express these statements as:


∀x(P (x) → Q(x)).
∃x(P (x) ∧ ¬R(x)).
∃x(Q(x) ∧ ¬R(x)).
Notice that the second statement cannot be written as ∃x(P (x) → ¬R(x)).
The reason is that P (x) → ¬R(x) is true whenever x is not a lion, so that ∃x(P (x) →
¬R(x)) is true as long as there is at least one creature that is not a lion, even if every lion
drinks coffee.
Similarly, the third statement cannot be written as ∃x(Q(x) → ¬R(x))
Example
Horses are faster than dogs and there is a greyhound that is
faster than every rabbit. We know that Harry is a horse and that
Ralph is a rabbit. Derive that Harry is faster than Ralph.

Horse(x) Greyhound(y) Dog(y) Rabbit(z)


Faster(y,z))

∀x ∀y Horse(x) ∧ Dog(y) ⇒ Faster(x,y)


∃y Greyhound(y) ∧ (∀z Rabbit(z) ⇒ Faster(y,z))

Horse(Harry)
Rabbit(Ralph)
∀y Greyhound(y) ⇒ Dog(y)
∀x ∀y ∀z Faster(x,y) ∧ Faster(y,z) ⇒ Faster(x,z)
TUTORIAL
• Which of these sentences are propositions? What are the truth values of those that are
propositions?
a) Boston is the capital of Massachusetts.
b) Miami is the capital of Florida.
c) 2 + 3 = 5. d) 5 + 7 = 10.
e) x + 2 = 11.
f) Answer this question.
• Let p and q be the propositions
p : It is below freezing.
q : It is snowing.
Write these propositions using p and q and logical connectives.
a) It is below freezing and snowing.
b) It is below freezing but not snowing.
c) It is not below freezing and it is not snowing.
d) It is either snowing or below freezing (or both).
e) If it is below freezing, it is also snowing.
I) It is either below freezing or it is snowing, but it is not snowing if it is below
freezing.
g) That it is below freezing is necessary and sufficient for it to be snowing.
TUTORIAL
• Let p, q, and r be the propositions
p : Grizzly bears have been seen in the area.
q : Hiking is safe on the trail.
r : Berries are ripe along the trail.
Write these propositions using p, q, and r and logical connectives.
a) Berries are ripe along the trail, but grizzly bears have
not been seen in the area.
b) Grizzly bears have not been seen in the area and hiking
on the trail is safe, but berries are ripe along the trail.
c) If berries are ripe along the trail, hiking is safe if and
only if grizzly bears have not been seen in the area.
d) It is not safe to hike on the trail, but grizzly bears have
not been seen in the area and the berries along the trail are ripe.
• Use existential and universal quantifiers to express the statement "Everyone
has exactly two biological parents“ using the propositional function P(x, y),
which represents "x is the biological parent of y."
• Express this statement using quantifiers: "Every student in this class has taken
some course in every department in the school of mathematical sciences."
TUTORIAL

You might also like