CLO1 - Lab 2 Solution
CLO1 - Lab 2 Solution
CLO1 - Lab 2 Solution
1. Which of these sentences are propositions? What are the truth values of those that are propositions?
a) Boston is the capital of Massachusetts.
Yes, True.
b) Miami is the capital of Florida.
Yes, False.
c) 2 + 3 = 5.
Yes, True.
d) 5 + 7 = 10.
Yes, False.
e) x + 2 = 11.
Not a proposition. Truth value cannot be determined as x is not specified.
f) Answer this question.
Not a proposition. The statement is not a fact.
2. Which of these are propositions? What are the truth values of those that are propositions?
a) Don’t go.
No.
b) What time is it?
No, a question is not a proposition.
c) There are no black flies in Maine.
d) 4 + x = 5.
No.
e) The moon is made of green cheese.
Yes, False.
f) 2n ≥ 100.
No.
The summer in Maine is not hot or it is not sunny, OR, It is not the case that the summer in Maine is hot and
sunny.
4. Suppose that Smartphone A has 256 MB 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.
False
b) Smartphone C has more ROM or a higher resolution camera than Smartphone B.
True
c) Smartphone B has more RAM, more ROM, and a higher resolution camera than Smartphone A.
False
d) If Smartphone B has more RAM and more ROM than Smartphone C, then it also has a higher resolution camera.
False
6. 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
“Sharks have not been spotted near the shore.”
b) p ∧ q
“Swimming at the New Jersey shore is allowed, and Sharks have been spotted near the shore.”
c) ¬p ∨ q
“Swimming at the New Jersey shore is not allowed, or Sharks have been spotted near the shore.”
d) p →¬q
“If swimming at the New Jersey shore is allowed, then Sharks have not been spotted near the shore.”
p ˄ ¬q
10. How many rows appear in a truth table for each of these compound propositions?
a) p →¬p
1 proposition, 21 = 2 rows
b) (p ∨¬r) ∧ (q ∨¬s)
4 propositions, 24 = 16 rows
c) (q →¬p) ∨ (¬p →¬q)
2 propositions, 22 = 4 rows
d) (p ∨¬t) ∧ (p ∨¬s)
3 propositions, 23 = 8 rows
p ¬p p ∧¬p
T F F
F T F
b) p ∨¬p
p ¬p p ˅¬p
T F T
F T T
c) (p ∨¬q) → q
p q ¬q p ˅¬q (p ˅¬q)àq
T T F T T
T F T T F
F T F F T
F F T T F
d) (p ∨ q) → (p ∧ q)
e) (p → q) → (q → p)
12. Find the bitwise OR, bitwise AND, and bitwise XOR of each of these pairs of bit strings.
a) 101 1110, 010 0001
101 1110
010 0001
111 1111 bitwise OR
000 0000 bitwise AND
111 1111 bitwise XOR
Do yourself
00 0111 0001
10 0100 1000
10 0111 1001 bitwise OR
00 0100 0000 bitwise AND
10 0011 1001 bitwise XOR
Do yourself
p Q p∨ q q∨ p
p q p∧ q q∧ p
T T T T
T T T T
F T T T
F T F F
T F T T
T F F F
F F F F
F F F F
From the truth table, p ∨ q ≡ q ∨ p. From the truth table, p ∧ q ≡ q ∧ p.
Hence Verified. Hence Verified.
p Q r p∨ q (p ∨ q)∨ r (q ∨ r) p ∨ (q ∨ r)
T T T T T T T
T T F T T T T
T F T T T T T
F T T T T T T
T F F T T F T
F T F T T T T
F F T F T T T
F F F F F F F
b) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r).
Self checking
4. Show that each of these conditional statements is a tautology by using truth tables.
a) (p ∧ q) → p
P q p∧ q (p ∧ q) → p
T T T T
F T F T
T F F T
F F F T
Since the truth values for the given proposition (p ∧ q) → p is all True, it is therefore a
Tautology.
b) p → (p ∨ q)
P q P∨ q p → (p ∨ q)
T T T T
F T T T
T F T T
F F F T
Since the truth values for the given proposition p → (p ∨ q) are all True, it is therefore a
Tautology.
c) ¬p → (p → q)
P q ¬p (p → q) ¬p → (p → q)
T T F T T
F T T T T
T F F F T
F F T T T
Since the truth values for the given proposition ¬p → (p → q)are all True, it is therefore a
Tautology.
Higher Colleges of Technology
Computer and Information Science Faculty
1. Let P(x) denote the statement “x ≤ 4.” What are these truth values?
a) P(0)
True
b) P(4)
True
c) P(6)
False
2. Let P(x) be the statement “the word x contains the letter a.” What are these truth values?
a) P(orange)
True
b) P(lemon)
False
c) P(true)
False
d) P(false)
True
3. Let Q(x, y) denote the statement “x is the capital of y.” What are these truth values?
a) Q(Denver, Colorado)
True
b) Q(Detroit, Michigan)
Find answers yourself for b, c, and d.
c) Q(Massachusetts, Boston)
d) Q(NewYork, NewYork)
4. Let P(x) be the statement “x spends more than five hours every weekday in class,” where the domain for x consists of
all students. Express each of these quantifications in English.
a) ∃xP(x)
There is some student who spends more than five hours every weekday in class. (or) There are some students who
spend more than five hours every weekday in class.
b) ∀xP(x)
All students spend more than five hours every weekday in class.
5. Let N(x) be the statement “x has visited North Dakota,” where the domain consists of the students in your school.
Express each of these quantifications in English.
a) ∃xN(x)
There is a student who has visited North Dakota.
b) ∀xN(x)
Every student has visited North Dakota.
6. 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))
Every comedian is funny.
b) ∀x(C(x) ∧ F(x))
Every person is a funny comedian/ Every person is comedian and funny.
c) ∃x(C(x) → F(x))
There exists a person such that if she or he is a comedian, then she or he is funny.
d) ∃x(C(x) ∧ F(x))
7. Let P(x) be the statement “x = 𝑥2.” 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
8. Let Q(x) be the statement “x + 1 > 2x.” If the domain consists of all integers, what are these truth values?
a) Q(0)
T
b) Q(−1)
T
c) Q(1)
F
d) ∃xQ(x)
T
e) ∀xQ(x)
F
9. Suppose the domain of the propositional function P(x, y) consists of pairs x and y, where x is 1, 2, or 3 and y is
1, 2, or 3. Write out these propositions using disjunctions and conjunctions.
a) ∃x P(x, 3)
P(1,3) ∨P(2,3) ∨P(3,3)
b) ∀y P(1, y)
P(1,1) ∧ P(1,2) ∧ P(1,3)