Professional Documents
Culture Documents
ITE P202-1
(Fri, 9:00 AM - 12:00 NN, online)
COURSE DESCRIPTION
Gary B. Shelly, Harry J. Rosenblat. Systems Analysis and Design (Shelly Cashman Series), 9th Edition
PROPOSITIONAL LOGIC
Logic
• The basis of all mathematical reasoning, and of all automated
reasoning
Proposition
• A declarative sentence that is either true or false, but not both
Examples: Examples:
1. Washington, D.C., is the capital of 1. What time is it?
the United States of America.
2. Read this carefully.
2. Toronto is the capital of Canada.
3. x + 1 = 2.
3. 1 + 1 = 2.
4. x + y = z.
4. 2 + 2 = 3.
Truth Value
• True, denoted by T, if it is a true proposition
• False, denoted by F, if it is a false proposition
Compound Propositions
• Propositions formed from existing propositions using logical operators
Logical Operators
• Used to form new propositions from two or more existing propositions
• negation
• conjunction
• disjunction
FUNDAMENTALS
Negation
Example 1
Proposition:
“Michael’s PC runs Linux”
Negation:
“It is not the case that Michael’s PC runs Linux.”
This negation can be more simply expressed as
“Michael’s PC does not run Linux.”
FUNDAMENTALS
Negation
Example 2
Proposition:
“Anna’s smartphone has at least 32GB of memory”
Negation:
“It is not the case that Anna’s smartphone has at least 32GB of memory.”
This negation can be more simply expressed as
“Anna’s smartphone does not have at least 32GB of memory.”
or even more simply as
“Anna’s smartphone has less than 32GB of memory.”
FUNDAMENTALS
Conjunction
Let p and q be propositions. The conjunction of p and q, denoted by p ∧ q, is the
proposition “p and q.” The conjunction p ∧ q is true when both p and q are true and is
false otherwise.
Note that in logic the word “but” sometimes is used instead of “and” in a conjunction. For
example, the statement “The sun is shining, but it is raining” is another way of saying
“The sun is shining and it is raining.”
Example
Proposition p:
“Rebecca’s PC has more than 16 GB free hard disk space”
Proposition q:
“The processor in Rebecca’s PC runs faster than 1 GHz.”
Conjunction p ∧ q:
“Rebecca’s PC has more than 16 GB free hard disk space, and the processor
in Rebecca’s PC runs faster than 1 GHz.”
This conjunction can be expressed more simply as
“Rebecca’s PC has more than 16 GB free hard disk space, and its processor
runs faster than 1 GHz.”
FUNDAMENTALS
Disjunction
Example
Proposition p:
“Rebecca’s PC has more than 16 GB free hard disk space”
Proposition q:
“The processor in Rebecca’s PC runs faster than 1 GHz.”
Disjunction p ∨ q:
“Rebecca’s PC has more than 16 GB free hard disk space, or the processor in
Rebecca’s PC runs faster than 1 GHz.”
This conjunction can be expressed more simply as
“Rebecca’s PC has more than 16 GB free hard disk space, or its processor
runs faster than 1 GHz.”
FUNDAMENTALS
Disjunction
inclusive or
• A disjunction is true when at least one of the two propositions is true.
Example
Propositions:
“Students who have taken Calculus or Computer Science can
take this class.”
exclusive or
• A disjunction is true when exactly one of the propositions is true and is false
otherwise.
Example
Propositions:
“Students who have taken Calculus or Computer Science, but
not both, can enroll in this class.”
In the conditional statement p → q, p is called the hypothesis (or antecedent or premise) and
q is called the conclusion (or consequence).
Example
Conditional Statement:
“If he (politician) is elected, then he will lower taxes.”
Example
Conditional Statement:
“If you get 100% on the final, then you will get an A.”
Example
Proposition p:
“Maria learns discrete mathematics”
Proposition q:
“Maria will find a good job.”
p→q
• “If Maria learns discrete mathematics, then she will find a good job.”
• “Maria will find a good job when she learns discrete mathematics.”
• “For Maria to get a good job, it is sufficient for her to learn discrete
mathematics.”
• “Maria will find a good job unless she does not learn discrete
mathematics.”
Example
Example:
Proposition Proposition
p→q If it rains, then I get wet.
Converse Converse
q→p If I get wet, then it rains.
Contrapositive Contrapositive
¬q → ¬p If I don’t get wet, then it does not rain.
Inverse Inverse
¬p → ¬q If it does not rain, then I don’t get wet.
FUNDAMENTALS
Conditional Statements
Let p and q be propositions. The biconditional statement p q, is the proposition “p,
if and only if q.” The biconditional statement p q is true when p and q is false have
the same truth values and is false otherwise.
Example:
Proposition Proposition
p→q If it rains, then I get wet.
Converse Converse
q→p If I get wet, then it rains.
Contrapositive Contrapositive
¬q → ¬p If I don’t get wet, then it does not rain.
Inverse Inverse
¬p → ¬q If it does not rain, then I don’t get wet.
FUNDAMENTALS
Truth Tables
p ¬p p q p∧q p q p∨q
T T T T T T
T F T F F T F T
F T F T F F T T
F F F F F F
p q p⊕q p q p→q p q p q
T T F T T T T T T
T F T T F F T F F
F T T F T T F T F
F F F F F T F F T
FUNDAMENTALS
Truth Tables
Compound Proposition
Example: (p ∨¬q) → (p ∧ q)
(p ∨¬q) → (p ∧ q)
p q ¬q p ∨ ¬q p∧q
p → q
T T F T T T
T F T T F F
F T F F F T
F F T T F F
EXERCISE (9/20)
1. Which of these sentences are propositions? What are the truth values
of those that are propositions?
a) Tokyo is the capital of Japan.
b) San Pablo is the provincial capital of Laguna.
c) 2 + 3 = 5.
d) 5 + 7 = 10.
e) x + 2 = 11.
f) Answer this question.
EXERCISE (9/20)
Bit operations
• Correspond to the logical connectives x y x∨y x∧y x⊕y
Bit string 0 0 0 0 0
Bitwise
• The bitwise OR, bitwise AND, and bitwise XOR of two strings of the same length to be the strings that have
as their bits the OR, AND, and XOR of the corresponding bits in the two strings, respectively.
Example:
01 1011 0110
11 0001 1101
__________________
Applications
Applications
System Specifications
Example:
Given the specification,
“The automated reply cannot be sent when the file system is full”.
Let p denote “The automated reply can be sent” and q denote “The file system is full.” Then ¬p represents
“It is not the case that the automated reply can be sent,” which can also be expressed as “The automated
reply cannot be sent.”
Conditional statement is q → ¬p
System specifications should be consistent (i.e., they should not contain conflicting requirements that could be used
to derive a contradiction). When specifications are not consistent, there would be no way to develop a system that
satisfies all specifications.
EXERCISE (9/23)
Using logical expressions,
1. Determine whether the following system specifications are consistent:
“The memorandum is saved in the sent folder or it is delivered to the recipient.”
“The memorandum is not saved in the sent folder.”
“If the memorandum is saved in the sent folder, then it is delivered to the recipient.”
Applications
Boolean Searches
AND - used to match records that contain both of two search terms
OR - used to match one or both of two search terms
NOT - (sometimes written as AND NOT) used to exclude a particular search term
Example 1: Use Boolean searching to find Web pages about universities in Metro Manila.
We can search for pages matching METRO AND MANILA AND UNIVERSITIES.
The results of this search will include those pages that contain the three words METRO, MANILA, and
UNIVERSITIES.
Note: In Google and many other search engines, the word “AND” is not needed, although it is understood, because
all search terms are included by default. These search engines also support the use of quotation marks to search for
specific phrases. So, it may be more effective to search for pages matching “Metro Manila” AND UNIVERSITIES.)
PROPOSITIONAL LOGIC
Applications
Boolean Searches
AND - used to match records that contain both of two search terms
OR - used to match one or both of two search terms
NOT - (sometimes written as AND NOT) used to exclude a particular search term
Example 2: Use Boolean searching to find Web pages about universities in Metro Manila or Cebu.
We can search for pages matching (METRO AND MANILA OR CEBU) AND UNIVERSITIES.
The results of this search will include all pages that contain the word UNIVERSITIES and either both the
words METRO and MANILA or the word CEBU.
PROPOSITIONAL LOGIC
Applications
Boolean Searches
AND - used to match records that contain both of two search terms
OR - used to match one or both of two search terms
NOT - (sometimes written as AND NOT) used to exclude a particular search term
Example 3: Use Boolean searching to find Web pages about universities in Manila (and not Metro Manila).
Note: In Google, the word NOT is replaced by the symbol “-“. The terms used for this search would be MANILA
UNIVERSITIES -METRO
PROPOSITIONAL LOGIC
p = A is a knight
¬p = A is a knave
Applications q = B is a knight
¬q = B is a knave
Logic Puzzles
• Puzzles that can be solved using logical reasoning.
Example:
An island that has two kinds of inhabitants, knights, who always tell the truth, and their opposites, knaves,
who always lie. You encounter two people A and B. What are A and B if A says “B is a knight” and B says
“The two of us are opposite types?”
Solution:
Let p and q be the statements that A is a knight and B is a knight, respectively, so that ¬p and ¬q are the
statements that A is a knave and B is a knave, respectively.
1st possibility: A is a knight
if p (A is a knight) is True, then q (B is a knight) is True
If B is a knight, then B’s statement that A and B are of opposite types, the statement (p ∧¬q) ∨ (¬p ∧ q),
would have to be true, which it is not, because A and B are both knights
2nd possibility: A is a knave
if p (A is a knave) is True, then q (B is a knight) is False (i.e., B is a knave)
If B is a knave, then B’s statement that A and B are of opposite types is a lie, which is consistent with
both A and B being knaves.
Conclusion: both A and B are knaves.
PROPOSITIONAL LOGIC
Applications
Logic Circuits
• A logic circuit (or digital circuit) receives input signals p , p , . . . , p , each a bit [either 0 (off) or 1
1 2 n
Applications
Logic Circuits
Build a digital circuit that produces the output (p ∨¬r) ∧ (¬p ∨ (q ∨¬r)) when given input
bits p, q, and r.
PROPOSITIONAL LOGIC
Applications
Logic Circuits
Build a digital circuit that produces the output (p ∨¬r) ∧ (¬p ∨ (q ∨¬r)) when given input
bits p, q, and r.
p p ∨¬r
r (p ∨¬r) ∧ (¬p ∨ (q ∨¬r))
¬r
¬p
p
¬p ∨ (q ∨¬r)
q
r q ∨¬r
¬r
QUIZ (9/30)
Construct a combinatorial circuit using inverters, OR gates, and AND gates that
produces the output ((¬p ∨¬r)∧¬q) ∨ (¬p ∧ (q ∨ r)) from input bits p, q, and r.
PROPOSITIONAL EQUIVALENCES
Tautology
• A compound proposition that is always true, no matter what the truth
values of the propositional variables that occur in it
Contradiction
• A compound proposition that is always false
Contigency
• A compound proposition that is neither a tautology nor a contradiction
PROPOSITIONAL EQUIVALENCES
p ¬p p ∨ ¬p p ∧ ¬p
T F T F
F T T F
Logically Equivalent
• Compound propositions that have the same truth values in all possible
cases
‣ The compound propositions p and q are called logically
equivalent if p ↔ q is a tautology.
‣ The notation p ≡ q denotes that p and q are logically equivalent.
‣ The symbol ≡ is not a logical connective
‣ p ≡ q is not a compound proposition but rather is the statement
that p ↔ q is a tautology.
‣ The symbol is sometimes used instead of ≡ to denote logical
equivalence
PROPOSITIONAL EQUIVALENCES
Logical Equivalence
De Morgan’s Laws
¬(p ∧ q) ≡ ¬p ∨ ¬q • Named after the English mathematician Augustus De
Morgan
¬(p ∨ q) ≡ ¬p ∧¬q
Because the truth values of the compound propositions ¬(p ∨ q) and ¬p ∧¬q agree for all possible
combinations of the truth values of p and q, it follows that ¬(p ∨ q) (¬p ∧¬q) is a tautology and that
these compound propositions are logically equivalent.
PROPOSITIONAL EQUIVALENCES
Logical Equivalence
T T T T T T T T
T T F F T T T T
T F T F T T T T
T F F F T T T T
F T T T T T T T
F T F F F T F F
F F T F F F T F
F F F F F F F F
PROPOSITIONAL EQUIVALENCES
Logical Equivalence
p∧T≡p (p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
Identity laws Associative laws
p∨F≡p (p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
p∨T≡T p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
Domination laws Distributive laws
p∧F≡F p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
p∨p≡p ¬(p ∧ q) ≡ ¬p ∨ ¬q
Idempotent laws De Morgan’s laws
p∧p≡p ¬(p ∨ q) ≡ ¬p ∧ ¬q
p ∨ (p ∧ q) ≡ p
¬(¬p) ≡ p Double negation law Absorption laws
p ∧ (p ∨ q) ≡ p
p∨q≡q∨p p ∨ ¬p ≡ T
Commutative laws Negation laws
p∧q≡q∧p p ∧ ¬p ≡ F
T denotes the compound proposition that is always true and F denotes the compound proposition that is
always false
PROPOSITIONAL EQUIVALENCES
Logical Equivalence
p → q ≡ ¬p ∨ q p ↔ q ≡ (p → q) ∧ (q → p)
p → q ≡ ¬q →¬p p ↔ q ≡ ¬p ↔ ¬q
p ∨ q ≡ ¬p → q p ↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q)
p ∧ q ≡ ¬(p →¬q) ¬(p ↔ q) ≡ p ↔¬q
¬(p → q) ≡ p ∧¬q
(p → q) ∧ (p → r) ≡ p → (q ∧ r)
(p → r) ∧ (q → r) ≡ (p ∨ q) → r
(p → q) ∨ (p → r) ≡ p → (q ∨ r)
(p → r) ∨ (q → r) ≡ (p ∧ q) → r
PROPOSITIONAL EQUIVALENCES
Note: A compound proposition is unsatisfiable if and only if its negation is true for
all assignments of truth values to the variables, that is, if and only if its negation is
a tautology.
PROPOSITIONAL SATISFIABILITY
Example
Determine if the compound proposition (p ∨¬q) ∧ (q ∨¬r) ∧ (r ∨¬p) is satisfiable.
Solution 1:
Recall that p ∨ q ≡ ¬p → q and p → q ≡ ¬q →¬p
Therefore, p ∨ ¬q ≡ ¬p → ¬q
p ∨ ¬q ≡ q → p
Example
Determine if the compound proposition (p ∨¬q) ∧ (q ∨¬r) ∧ (r ∨¬p) is satisfiable.
T T T T T T T
T T F T T F F
T F T T F T F
T F F T T F F
F T T F T T F
F T F F T T F
F F T T F T F
F F F T T T T
Since at least one entry of the truth table above is true, then it is satisfiable.
NORMAL FORMS
x y z x ∨ y → ¬x ∧ z
1 T T T F
2 T T F F
3 T F T F
4 T F F F
5 F T T T
6 F T F F
7 F F T T
8 F F F T
The formula is satisfied by the truth assignment in row 5 or by the truth assignment in
row 7 or by the truth assignment in row 8.
Therefore, DNF is: (¬x ∧ y ∧ z) ∨ (¬x ∧ ¬y ∧ z) ∨ (¬x ∧ ¬y ∧ ¬z)
NORMAL FORMS
x y z x ∨ y → ¬x ∧ z
1 T T T F
2 T T F F
3 T F T F
4 T F F F
5 F T T T
6 F T F F
7 F F T T
8 F F F T
The formula is not satisfied by the truth assignment in row 1 and in row 2 and in row 3 and in row 4
and in row 6.
Therefore, it is logically equivalent to:
¬(x ∧ y ∧ z) ∧ ¬(x ∧ y ∧ ¬z) ∧ ¬(x ∧ ¬y ∧ z) ∧ ¬(x ∧ ¬y ∧ ¬z) ∧ ¬(¬x ∧ y ∧ ¬z)
Apply DeMorgan’s law to obtain its CNF: (¬x∨¬y∨¬z) ∧ (¬x∨¬y∨z) ∧(¬x∨y∨¬z) ∧(¬x∨y∨z) ∧ (x∨¬y∨z)
PREDICATE LOGIC
Let P(x) denote the statement “x > 3.” What are the truth values of P(4) and P(2)?
Solution: We obtain the statement P(4) by setting x = 4 in the statement “x > 3.”
Hence, P(4), which is the statement “4 > 3,” is true. However, P(2), which is the
statement “2 > 3,” is false.
PREDICATE LOGIC
Let A(x) denote the statement “Computer x is under attack by an intruder.” Suppose
that of the computers on campus, only BSCS2 and BSIT1 are currently under
attack by intruders. What are truth values of A(BSCS1), A(BSCS2), and A( BSIT1)?
Let Q(x, y) denote the statement “x = y + 3.” What are the truth values of the
propositions Q(1, 2) and Q(3, 0)?
Solution: To obtain Q(1, 2), set x = 1 and y = 2 in the statement Q(x, y). Hence,
Q(1, 2) is the statement “1 = 2 + 3,” which is false. The statement Q(3, 0) is the
proposition “3 = 0 + 3,” which is true.
PREDICATE LOGIC
Let R(x, y, z) denote the statement ”x + y = z.” When values are assigned to the
variables x, y, and z, this statement has a truth value.
What are the truth values of the propositions R(1, 2, 3) and R(0, 0, 1)?
A statement of the form P(x1, x2, . . . , xn) is the value of the propositional function P at the
n-tuple (x1, x2, . . . , xn), and P is also called an n-place predicate or a n-ary predicate.
Preconditions
• the statements that describe valid input
• a condition that must be true before a function (or code segment) executes, in order for
the code to work correctly
Postconditions
• the conditions that the output should satisfy when the program has run
• a condition that will be true after a function returns or at the end of a code segment
Consider the following program, designed to interchange the values of two variables x and y.
temp := x
x := y
y := temp
Find predicates that we can use as the precondition and the postcondition to verify the
correctness of this program. Then explain how to use them to verify that for all valid input the
program does what is intended.
PREDICATE LOGIC
Solution:
Precondition
• Before we run the program, we need to express that x and y have particular values.
• We can use the predicate P(x, y), where P(x, y) is the statement “x = a and y = b,” where a and b
are the values of x and y.
Postcondition
We want to verify that the program swaps the values of x and y for all input values.We can use Q(x, y),
where Q(x, y) is the statement “x = b and y = a.”
To verify that the program always does what it is supposed to do, suppose that the precondition P(x, y)
holds. That is, we suppose that the statement “x = a and y = b” is true. This means that x = a and y = b.
temp := x (assigns the value of x to the variable temp, so after this step we know that x = a,
temp = a, and y = b.)
x := y (after this step, x = b, temp = a, and y = b)
y := temp (after this step, x = b, temp = a, and y = a)
Consequently, after this program is run, the postcondition Q(x, y) holds, that is, the statement “x =
b and y = a” is true.
QUANTIFIERS
Predicate Calculus - the area of logic that deals with predicates and quantifiers
Universal Quantification
Universal Quantification
Example 1: Let P(x) be the statement “x + 1 > x.” What is the truth value of the
quantification ∀xP(x), where the domain consists of all real numbers?
Solution: Because P(x) is true for all real numbers x, the quantification ∀xP(x)
is true.
QUANTIFIERS
Universal Quantification
Example 2: Let Q(x) be the statement “x < 2.” What is the truth value of the
quantification ∀xQ(x), where the domain consists of all real numbers?
Solution: Q(x) is not true for every real number x, because, for instance, Q(3)
is false. That is, x = 3 is a counterexample for the statement ∀xQ(x). Thus
∀xQ(x) is false.
QUANTIFIERS
Universal Quantification
Example 3: What is the truth value of ∀xP(x), where P(x) is the statement
“x2 < 10” and the domain consists of the positive integers not exceeding 4?
Because P(4), which is the statement “4 < 10,” is false, it follows that ∀xP(x) is
2
false.
Existential Quantification
Example 1: Let P(x) denote the statement “x > 3.” What is the truth value of the
quantification ∃xP(x), where the domain consists of all real numbers?
Solution: Because “x > 3” is sometimes true (for instance, when x = 4), then ∃xP(x)
is true.
QUANTIFIERS
Existential Quantification
The statement ∃xP(x) is false if and only if there is no element x in the domain for
which P(x) is true. That is, ∃xP(x) is false if and only if P(x) is false for every element
of the domain.
Example 2: Let Q(x) denote the statement “x = x + 1.” What is the truth value of the
quantification ∃xP(x), where the domain consists of all real numbers?
Solution: Because Q(x) is false for every real number x, then ∃xP(x), is false.
QUANTIFIERS
Existential Quantification
Example 3: What is the truth value of ∃xP(x), where P(x) is the statement “x2 > 10”
and the universe of discourse consists of the positive integers not exceeding 4?
Solution: Because the domain is {1, 2, 3, 4}, the proposition ∃xP(x) is the same as
the disjunction
Because P(4), which is the statement “42 > 10,” is true, it follows that ∃xP(x) is true.
QUANTIFIERS
Uniqueness Quantification
Example: ∃!x(x − 1 = 0), where the domain is the set of real numbers, states that
there is a unique real number x such that x − 1 = 0. This is a true statement, as x = 1
is the unique real number such that x − 1 = 0.
Precedence of Quantifiers
The quantifiers ∀ and ∃ have higher precedence than all logical operators from
propositional calculus.
For example, ∀xP(x) ∨ Q(x) is the disjunction of ∀xP(x) and Q(x). In other words, it
means (∀xP(x)) ∨ Q(x) rather than ∀x(P(x) ∨ Q(x)).
EXERCISE (10/21)
1. Let P(x) be the statement “x = x2.” If the domain consists of the
integers, what are these truth values?
a) P(0) - T
b) P(1) - T
c) P(2) - F
d) P(−1) - F
e) ∃xP(x) - T
f) ∀xP(x) - F
2. Determine the truth value of each of these statements if the domain
consists of all integers.
a) ∀n(n + 1 > n) - T
b) ∃n(2n = 3n) - T
c) ∃n(n = −n) - T
d) ∀n(3n ≤ 4n) - F
BINDING VARIABLES
Example 1: Example 2:
Logical Equivalence
Show that ∀x(P(x) ∧ Q(x)) and ∀xP(x) ∧ ∀xQ(x) are logically equivalent (where the same domain is used throughout).
Solution:
(1) Show that if ∀x(P(x) ∧ Q(x)) is true, then ∀xP(x) ∧ ∀xQ(x) is true.
Suppose ∀x(P(x) ∧ Q(x)) is true. If a is in the domain, then P(a) ∧ Q(a) is true. Hence, P(a) is true and
Q(a) is true. Because P(x) is true and Q(x) is true for every element in the domain, we can conclude that
∀xP(x) and ∀xQ(x) are both true. This means that ∀xP(x) ∧ ∀xQ(x) is true.
(2) Second, we show that if ∀xP(x) ∧ ∀xQ(x) is true, then ∀x(P(x) ∧ Q(x)) is true.
Suppose that ∀xP(x) ∧ ∀xQ(x) is true. It follows that ∀xP(x) is true and ∀xQ(x) is true. Hence, if a is in the
domain, then P(a) is true and Q(a) is true [because P(x) and Q(x) are both true for all elements in the
domain, there is no conflict using the same value of a here]. It follows that for all a, P(a) ∧ Q(a) is true. It
follows that ∀x(P(x) ∧ Q(x)) is true.
Example
Given the statement, “Every student in your class has taken a course in
calculus.”
“It is not the case that every student in your class has taken a course in
calculus.”
This is equivalent to “There is a student in your class who has not taken a
course in calculus.” which can be expressed as ∃x¬P(x).
Example
Given the statement, “There is a student in this class who has taken a course
in calculus.”
“It is not the case that there is a student in this class who has taken a
course in calculus.”
This is equivalent to “Every student in this class has not taken calculus.”
which can be expressed as ∀x¬Q(x).
This is why these rules are called De Morgan’s laws for quantifiers. When the
domain has n elements x1, x2, . . . , xn, it follows that ¬∀xP(x) is the same as ¬(P(x1)
∧ P(x2) ∧ … ∧ P(xn)), which is equivalent to ¬P(x1)∨¬P(x2) ∨ … ∨ ¬P(xn) by De
Morgan’s laws, and this is the same as ∃x¬P(x).
Example
What are the negations of the statements “There is an honest politician” and
“All Americans eat cheeseburgers”?
Solution
Let H(x) = “x is honest.”
“There is an honest politician” = ∃xH(x), where the domain consists of all politicians.
The negation is ¬∃xH(x), which is equivalent to ∀x¬H(x).
This negation can be expressed as “Every politician is dishonest.” (Note: In English, the
statement “All politicians are not honest” is ambiguous. In common usage, this statement
often means “Not all politicians are honest.” Consequently, we do not use this statement to
express this negation.)
Example
What are the negations of the statements ∀x(x2 > x) and ∃x(x2 = 2)?
Solution
The negation of ∀x(x2 > x) is ¬∀x(x2 > x), which is equivalent to ∃x¬(x2 > x).
This can be rewritten as ∃x(x2 ≤ x).
Example
Solution
By De Morgan’s law for universal quantifiers, we know that ¬∀x(P(x) → Q(x))
and ∃x(¬(P(x) → Q(x))) are logically equivalent.
By the logical equivalence ¬(p → q) ≡ p ∧¬q
we know that ¬(P(x) → Q(x)) and P(x)∧¬Q(x) are logically equivalent for every
x.
Because we can substitute one logically equivalent expression for another in a
logical equivalence, it follows that ¬∀x(P(x) → Q(x)) and ∃x(P(x)∧¬Q(x)) are
logically equivalent.
TRANSLATING FROM ENGLISH INTO LOGICAL EXPRESSIONS
Example
Express the statement “Every student in this class has studied calculus” using
predicates and quantifiers.
Solution
“For every student in this class, that student has studied calculus.”
“For every student x in this class, x has studied calculus.”
C(x) = “x has studied calculus.”
Consequently, if the domain for x consists of the students in the class, we can translate our
statement as ∀xC(x).
TRANSLATING FROM ENGLISH INTO LOGICAL EXPRESSIONS
Example
Express the statement “Every student in this class has studied calculus” using
predicates and quantifiers.
Solution
“For every student in this class, that student has studied calculus.”
“For every student x in this class, x has studied calculus.”
C(x) = “x has studied calculus.”
Consequently, if the domain for x consists of the students in the class, we can translate our
statement as ∀xC(x).
USING QUANTIFIERS IN SYSTEM SPECIFICATIONS
Example
“Every mail message larger than one megabyte will be compressed” and
Solution
Let S(m, y) = “Mail message m is larger than y megabytes,” where the variable x has the
domain of all mail messages and the variable y is a positive real number
C(m) = “Mail message m will be compressed.”
“Every mail message larger than one megabyte will be compressed” = ∀m(S(m, 1) → C(m)).
Let A(u) = “User u is active,” where the variable u has the domain of all users,
S(n, x) = “Network link n is in state x,” where n has the domain of all network links and x has
the domain of all possible states for a network link.
“If a user is active, at least one network link will be available” = ∃uA(u) → ∃nS(n, available).
USING QUANTIFIERS IN SYSTEM SPECIFICATIONS
Example
Consider these statements, of which the first three are premises and the fourth is a valid conclusion.
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)).
(Note we have assumed that “small” is the same as “not large” and that “dull in color” is the same as “not richly
colored.” To show that the fourth statement is a valid conclusion of the first three, we need to use rules of inference.
QUIZ (10/28)
1. Translate these statements into English, where C(x) is “x is a comedian” and F(x) is “x is funny”
and the domain consists of all people.
a) ∀x(C(x) → F(x))
b) ∀x(C(x) ∧ F(x))
c) ∃x(C(x) → F(x))
d) ∃x(C(x) ∧ F(x))
2. Express the negation of these propositions using quantifiers, and then express the negation in
English.
e) Some drivers do not obey the speed limit.
f) All Swedish movies are serious.
g) No one can keep a secret.
h) There is someone in this class who does not have a good attitude.
3. Determine the truth value of each of these statements if the domain of each variable consists of all
real numbers.
a) ∃x(x2 = −1)
b) ∀x(x2 + 2 ≥ 1)
REFERENCES
- Epp, Susanna S. (2010). Discrete Mathematics with Applications, 4th Edition. Boston:
Brooks/Cole Cengage Learning, copyright © 2011
- Rosen, Kenneth H. Discrete Mathematics and Its Applications, 7th Edition. New York:
McGraw-Hill, copyright © 2012
- Johnsonbaugh, Richard. Discrete Mathematics, 7th Edition. Philippines: Pearson Education
South Asia Pte. Ltd, copyright © 2010
- Johnsonbaugh, Richard. Discrete Mathematics, 3rd Edition. New York: Macmillan Publishing
Company, copyright © 1993
- Kolman, Bernard / Busby, Robert C. Discrete Mathematical Structures for Computer
Science, 2nd Edition. London: Prentice-Hall International, copyright © 1987 (Philippine
Reprint 1992, St. Martin Publications)
THANK YOU!