2. • 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
2
3. • Which of these are propositions? What are the truth values of those that
are propositions?
a) Do not pass go.
b) What time is it?
c) There are no black flies in Maine
d) 4 + x = 5.
e) The moon is made of green cheese.
f ) 2n ≥ 100.
3
4. • What is the negation of each of these propositions?
a) Mei has an MP3 player.
b) There is no pollution in New Jersey.
c) 2 + 1 = 3.
d) The summer in Maine is hot and sunny.
4
5. • What is the negation of each of these propositions?
a) Jennifer and Teja are friends.
b) There are 13 items in a baker’s dozen.
c) Abby sent more than 100 text messages every
day.
d) 121 is a perfect square.
5
6. • What is the negation of each of these propositions?
a) Steve has more than 100 GB free disk space on his
laptop.
b) Zach blocks e-mails and texts from Jennifer.
c) 7 · 11 · 13 = 999.
d) Diane rode her bicycle 100 miles on Sunday.
6
7. • Suppose that Smartphone A has 256MB RAM and 32GB ROM, and the
resolution of its camera is 8 MP; Smartphone B has 288 MB RAM and 64
GB ROM, and the resolution of its camera is 4 MP; and Smartphone C has
128 MB RAM and 32 GB ROM, and the resolution of its camera is 5 MP.
Determine the truth value of each of these propositions.
• a) Smartphone B has the most RAM of these three smartphones.
• b) Smartphone C has more ROM or a higher resolution camera than
Smartphone B.
• c) Smartphone B has more RAM, more ROM, and a higher resolution
camera than Smartphone A.
• d) If Smartphone B has more RAM and more ROM than Smartphone C,
then it also has a higher resolution camera.
• e) Smartphone A has more RAM than Smartphone B if and only if
Smartphone B has more RAM than Smartphone A
7
8. • Let p and q be the propositions
• p : I bought a lottery ticket this week.
• q : I won the million dollar jackpot.
• Express each of these propositions as an English sentence.
• a) ¬p b) p ∨ q c) p → q
• d) p ∧ q e) p ↔ q f ) ¬p →¬q
• g) ¬q ∧¬p h) ¬p ∨ (p ∧ q)
8
9. • Let p and q be the propositions “Swimming at the New Jersey
shore is allowed” and “Sharks have been spotted near the shore,”
respectively. Express each of these compound propositions as an
English sentence.
a) ¬q b) p ∧ q c) ¬p ∨ q
d) p →¬q e) ¬q → p f ) ¬p →¬q
g) p ↔¬q h) ¬p ∧ (p∨ ¬q)
9
10. • Let p and q be the propositions “The election is decided” and
“The votes have been counted,” respectively. Express each of
these compound propositions as an English sentence.
a) ¬p b) p ∨ q
c) ¬p ∧ q d) q → p
e) ¬q →¬p f ) ¬p →¬q
g) p ↔ q h) ¬q ∨ (¬p ∧ q)
10
11. • Let p, q, and r be the propositions
• p :You have the flu.
• q :You miss the final examination.
• r :You pass the course.
• Express each of these propositions as an English sentence.
a) p → q b) ¬q ↔ r
c) q →¬r d) p ∨ q ∨ r
e) (p →¬r) ∨ (q →¬r)
f ) (p ∧ q) ∨ (¬q ∧ r)
11
12. • Construct a truth table for each of these compound propositions.
a) p ∧¬p b) p ∨¬p
c) (p ∨¬q) → q d) (p ∨ q) → (p ∧ q)
e) (p → q) ↔ (¬q →¬p)
f ) (p → q) → (q → p)
12
13. • Construct a truth table for each of these compound propositions.
• a) p →¬p b) p ↔¬p
• c) p ⊕ (p ∨ q) d) (p ∧ q) → (p ∨ q)
• e) (q →¬p) ↔ (p ↔ q)
• f ) (p ↔ q) ⊕ (p ↔¬q)
13
14. • Construct a truth table for each of these compound propositions.
• a) (p ∨ q) → (p ⊕ q) b) (p ⊕ q) → (p ∧ q)
• c) (p ∨ q) ⊕ (p ∧ q) d) (p ↔ q) ⊕ (¬p ↔ q)
• e) (p ↔ q) ⊕ (¬p ↔¬r)
• f ) (p ⊕ q) → (p ⊕¬q)
14
15. • Construct a truth table for each of these compound propositions.
• a) p ⊕ p b) p ⊕¬p
• c) p ⊕¬q d) ¬p ⊕¬q
• e) (p ⊕ q) ∨ (p ⊕¬q) f ) (p ⊕ q) ∧ (p ⊕¬q)
15
16. • Construct a truth table for each of these compound propositions.
• a) p →¬q b) ¬p ↔ q
• c) (p → q) ∨ (¬p → q) d) (p → q) ∧ (¬p → q)
• e) (p ↔ q) ∨ (¬p ↔ q)
• f ) (¬p ↔¬q) ↔ (p ↔ q)
16
17. • Construct a truth table for each of these compound propositions.
• a) (p ∨ q) ∨ r b) (p ∨ q) ∧ r
• c) (p ∧ q) ∨ r d) (p ∧ q) ∧ r
• e) (p ∨ q)∧¬r f ) (p ∧ q)∨¬r
17
18. • Construct a truth table for each of these compound propositions.
• a) p → (¬q ∨ r)
• b) ¬p → (q → r)
• c) (p → q) ∨ (¬p → r)
• d) (p → q) ∧ (¬p → r)
• e) (p ↔ q) ∨ (¬q ↔ r)
• f ) (¬p ↔¬q) ↔ (q ↔ r)
18
19. Construct a truth table for
•((p → q) → r) → s
•(p ↔ q) ↔ (r ↔ s)
19
20. • Use De-Morgans law to express the negations of “Miguel has a cell
phone and he has a laptop computer” and “Heather will go to
concert or Steve will go to concert”
20
21. • Show that ¬(p → q) and p ∧¬q are logically equivalent using laws
• Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧¬q are logically equivalent
by developing a series of logical equivalences.
• Show that (p ∧ q) → (p ∨ q) is a tautology.
21
22. • Show that each of these conditional statements is a tautology by
using truth tables.
• a) (p ∧ q) → p b) p → (p ∨ q)
• c) ¬p → (p → q d) (p ∧ q) → (p → q)
• e) ¬(p → q) → p f ) ¬(p → q)→¬q
22
23. • Show that each of these conditional statements is a tautology by
using truth tables.
• a) [¬p ∧ (p ∨ q)] → q
• b) [(p → q) ∧ (q → r)] → (p → r)
• c) [p ∧ (p → q)] → q
• d) [(p ∨ q) ∧ (p → r) ∧ (q → r)] → r
23
24. Subject - predicates
• x is greater than 3” has two parts.
• The first part, the variable x, is the subject of the statement.
• The second part—the predicate, “is greater than 3”—refers to a
property that the subject of the statement can have.
• We can denote the statement “x is greater than 3” by P(x), where
P denotes the predicate “is greater than 3” and x is the variable.
• The statement P(x) is also said to be the value of the
propositional function P at x
24
25. • Let P(x) denote the statement “x > 3.” What are the truth values
of P(4) and P(2)?
25
26. Try this
1. Let P(x) denote the statement “x ≤ 4.” What are these truth
values?
a) P(0) b) P(4) c) P(6)
2. Let P(x) be the statement “the word x contains the letter a.”
What are these truth values?
a) P(orange) b) P(lemon)
c) P(true) d) P(false)
26
27. • 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)?
27
28. • Let A(x) denote the statement “Computer x is under attack by an
intruder.” Suppose that of the computers on campus, only CS2 and
MATH1 are currently under attack by intruders. What are truth
values of A(CS1), A(CS2), and A(MATH1)?
28
29. • 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)?
29
31. • Let A(c, n) denote the statement “Computer c is connected to
network n,” where c is a variable representing a computer and n is
a variable representing a network. Suppose that the computer
MATH1 is connected to network CAMPUS2, but not to network
CAMPUS1. What are the values of A(MATH1, CAMPUS1) and
A(MATH1, CAMPUS2)?
31
32. Try this one
State the value of x after the statement ifP(x) then x := 1 is
executed, where P(x) is the statement “x > 1,” if the value of x
when this statement is reached is
• a) x = 0 b) x = 1
• c) x = 2
32
33. Preconditions and postcondition
• The statements that describe valid input are known as
preconditions
• The conditions that the output should satisfy when the program
has run are known as postconditions.
33
34. • 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.
34
35. Quantifiers
• Quantification expresses the extent to which a predicate
is true over a range of elements.
• Two types of quantification
• Universal quantification: which tells us that a predicate is
true for every element under consideration
• Existential quantification, which tells us that there is one or
more element under consideration for which the predicate is
true.
• The area of logic that deals with predicates and
quantifiers is called the predicate calculus
35
36. • The universal quantification of P(x) is the statement
• “P(x) for all values of x in the domain.”
• The notation ∀ x P(x) denotes the universal quantification of P(x).
Here ∀ is called the universal quantifier.
• We read ∀xP(x) as “ for all x P(x)” or “for every xP(x).”
• An element for which P(x) is false is called a counterexample of
∀xP(x).
36
38. example
• 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?
• 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?
38
39. • When all the elements in the domain can be listed—say, x1, x2, . .
., xn—it follows that the universal quantification ∀xP(x) is the
same as the conjunction
P(x1) ∧ P(x2) ∧ · · · ∧ P(xn),
because this conjunction is true if and only if P(x1), P(x2), . . . , P
(xn) are all true.
39
40. • What is the truth value of ∀x P(x), where P(x) is the statement
“x2 < 10” and the domain consists of the positive integers not
exceeding 4?
• What does the statement ∀x N(x) mean if N(x) is “Computer x is
connected to the network” and the domain consists of all
computers on campus?
40
41. Existential quantification
• There exists an element x in the domain such that p(x)
• There is an x such that P(x)
• There is at least one x such that P(x)
• 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
41
42. examples
• 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?
42
43. • Let Q(x) denote the statement “x = x + 1.”What is the truth value
of the quantification ∃x Q(x), where the domain consists of all
real numbers?
43
44. • When all elements in the domain can be listed—say, x1, x2, . . . ,
xn—the existential quantification ∃xP(x) is the same as the
disjunction
P(x1) ∨ P(x2) ∨ · · · ∨ P(xn),
because this disjunction is true if and only if at least one of P(x1),
P(x2), . . . , P (xn) is true.
44
45. • What is the truth value of ∃x P(x), where P(x) is the statement
“x2 > 10” and the universe of discourse consists of the positive
integers not exceeding 4?
45