MAT - 125 Revision Questions
MAT - 125 Revision Questions
Course Content
• Propositional Logic:
Basic logical connectives: negation, conjunction, disjunction. Truth tables for each
ra
lo
connective.
iF
Applications
a) Logic [1 mark]
Solution:
b) A contingent [1 mark]
2. If Juan has a smartphone, then she will able to attend the meeting online. When is
Solution: The statement will be false if Juan has a smartphone but is not able to
Solution: p ∧ q ✓
Solution: p∧ ∼ q ✓
Solution: ∼ p ∧ q ✓
Solution: ∼ p∧ ∼ q ✓
Solution: p ∨ q ✓
Solution: Let
Answer: ∼ (s ∧ t) ≡ ∼ s ∨ ∼ t ✓
Solution: Let
p : He is poor
q : He is honest
Then we have : p ∧ q ✓
Solution: Let ar
lo
iF
p : It is hot today
nj
q : It is cold today
Ru
Solution: We have,
where-
p : I will dance
q : You sing
Solution: We have-
where-
q : Presence of deadlock
f) Presence of cycle in a multi instance RAG is a necessary but not sufficient condition
Solution: We have-
The given sentence is- “Presence of cycle in a multi instance RAG is a necessary
where-
.
Dr
q : Presence of deadlock
5. Given the statement: ”You can have tea or coffee,” describe the interpretation
Solution: Inclusive ”or” is false when both p and q are false and is true
otherwise. ✓
Thus the given statement can be interpreted: ; You may have tea, coffee, or
both. ✓
Solution: Exclusive ”or” is true when exactly one of p and q is true and is
false otherwise. ✓
not both. ✓
a) p ∨ ∼ q [1 mark]
Solution: ∼ (p ∨ ∼ q) ≡ ∼ p ∧ ∼ (∼ q) ≡ ∼ p ∧ q ✓
b) ∼ p → q [3 marks]
Solution: p → q ≡ ∼ p ∨ q ✓
∼ p → q ≡ ∼ (∼ p) ∨ q ≡ p ∨ q ✓
∴∼ [ ∼ p → q ] ≡∼ [ p ∨ q ] ≡ ∼ p ∧ ∼ q ✓
c) p ↔ q [1 mark]
Solution: p ↔ q ≡ p ⊕ q ✓
d) p → (q ∧ r)
ra [1 mark]
lo
iF
Solution: ∼ [ p → (q ∧ r) ] ≡ ∼ [ ∼ p ∨ (q ∧ r) ] ≡ p ∧ ∼ (q ∧ r) ✓
nj
Ru
7. What Boolean search would you use to look for Web pages about hiking in Nyeri,
.
respectively? [2 marks]
Solution:
9. Write the statement:”To be a citizen of this country, it is sufficient that you were
”If you are a citizen of this country, then you were born in Kenya” ✓
Solution:
11. Formalize in symbols the statement ”For every positive integer x, there exists a
Solution:
∀x ∈ Z+ ∃y ∈ Z+ (y > x). ✓✓
Solution:
Ru
Solution:
= X ′ Y + Y (Z ′ + Z) + X ′ Y Z ′ (Distributive property) ✓
= X ′Y + Y + X ′Y Z ′ (Complement property: Z ′ + Z = 1) ✓
= Y + X ′ Y + XY ′ Z ′ (Commutative property)
= Y + X ′ Y (1 + Z ′ ) (Distributive property) ✓
= Y + X ′Y (Complement property: 1 + Z ′ = 1) ✓
= Y (1 + X ′ ) (Distributive property)
=Y (Complement property: 1 + X ′ = 1) ✓
≡ p ∧ (q ∨ ¬q) . . . . . . by (b)
≡p∧t . . . . . . . . . . . . by (c)
≡p . . . . . . . . . . . . by (d)
[4 marks]
Solution:
(p ∧ ¬q) ∨ (p ∧ q) ≡ p ∧ (¬q ∨ q) a
. . . . . . by Distributive Laws
r ✓
lo
iF
≡p . . . . . . . . . . . . by Identity Laws ✓
.
Dr
15. Without constructing the truth table show that p → (q → p) ≡ t , where t denotes a
tautology. [3 marks]
Solution:
p → (q → p) ≡ ∼ p ∨ (∼ q ∨ p)
≡∼p ∨ p ∼q
≡ t∨ ∼q
≡ t
marks]
P Q ∼ Q (P ∧ Q) (P ∧ ∼ Q) (P ∧ Q) ∨ (P ∧ ∼ Q)
T T F T F T
T F T F T T
F T F F F F
F F T F F F
✓ ✓ ✓
Now, let’s compare the truth values of (P ∧ Q) ∨ (P ∧ ∼ Q) and P for each row. As
we can see, the two expressions are equal for all possible combinations of truth values
for P and Q. ✓
ra
Therefore, we have proved that (P ∧ Q) ∨ (P ∧ ∼ Q) ≡ P using the truth table.
lo
iF
17. Suppose that Smartphone A has 256 MB RAM and 32 GB ROM, and the resolution
nj
Ru
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
Dr
ROM, and the resolution of its camera is 5 MP. Determine the truth value of each of
these propositions:
B. [3 marks]
Solution: A disjuction statements is false only when both statements are false.
A 256 MB 32 GB 8 MP
B 288 MB 64 GB 4 MP
C 128 MB 32 GB 5 MP
• ROM Comparison: Smartphone C has 32 GB, while Smartphone B has
True. ✓
ii) If Smartphone B has more RAM and more ROM than Smartphone C, then it
false.
128 MB. Therefore, B has more RAM than C.. True statement. ✓
• The proposition is False because although B has more RAM and ROM, it
iii) Smartphone A has more RAM than Smartphone B if and only if Smartphone B
Solution: A biconditional is true iff both statements have same truth values.
288 MB. ∴ A does not have more RAM than B. False statement. ✓
• The statement ”if and only if” requires both directions to be true. Since one
marks]
Solution:
A tautology is a logical statement that is always true, regardless of the truth values
nor always false (contradiction). It is true for some combinations of truth values of
19. Let P (x) be the statement “the word x contains the letter a.” What are the truth
values of?
a
r
lo
iF
i) P(true). [1 mark]
nj
Solution:
Ru
Solution:
20. Let t denote a tautology, F the truth value FALSE , and p a proposition. Evaluate:
i) p ∨ F [1 mark]
Solution:
ii) ∼ t [1 mark]
Solution:
21. Find the bitwise OR, bitwise AND, and bitwise XOR of the following pairs of bit
Solution:
22. Let p and q be the following propositions p: it is below freezing q: it is snowing Write
Solution:
Solution:
Solution:
24. Find the bounded and free variables in the following statement: [2 marks]
∃y(x + y = 4)
Solution:
a
25. What is the scope of the existential quantifier in (b) above.
r [2 marks]
lo
iF
Solution:
nj
Ru
26. The function F (x, y, z) = xy + z from 3−tuples of Boolean variables to the set {0, 1}
Solution:
Solution:
Solution:
28. Construct a truth table for the exclusive or of p and q denoted by p ⊕ q. [2 marks]
Solution:
Solution:
(i) p ⇒ q
ra [1 mark]
lo
iF
Solution:
nj
Ru
(ii) q ⇒ p
Dr
[1 mark]
Solution:
If you will succeed in your life it means that you work hard.
(iii)) (∼ p) ⇒ (∼ q) [1 mark]
Solution:
If you don’t work hard then you will not succeed in your life.
(d) (∼ q) ⇒ (∼ p) [1 mark]
Solution:
If you don’t succeed in your life it means that you didn’t work hard.
32. How many rows appear in the truth table of this compound propositions?
(p ∧ r ∧ s) ∨ (q ∧ t) ∨ (r∧ ∼ t) [2 marks]
Solution:
If there are n variables, each with two possible truth values (True or False), then the
In this case, we have five variables (p, q, r, s, t), so the number of rows is 25 = 32.✓
Therefore, the truth table for the given compound proposition will have 32 rows.
33. Determine the number of rows in the truth table for the compound proposition (a ∧
b ∧ c) ∨ (∼ d ∧ e) ∨ (f ∧ ∼ g). [2 marks]
Solution:
To find the number of rows in the truth table for the compound proposition (a ∧ b ∧
a
c) ∨ (∼ d ∧ e) ∨ (f ∧ ∼ g), we need to consider all possible combinations of truth values
r
lo
iF
If there are n variables, each with two possible truth values (True or False), then the
Ru
In this case, we have seven variables (a, b, c, d, e, f , g), so the number of rows is
27 = 128. ✓
Therefore, the truth table for the given compound proposition will have 128 rows.
34. Write the converse, inverse and contra-positive of the following statement:
Solution:
Let the given statement ”If you work hard, then you will pass” be represented by the
- Converse: ”If you will pass, then you have worked hard.” ( Q → P ) ✓
- Contrapositive: ”If you will not pass, then you have not worked hard.” ( ∼ Q →∼ P
) ✓
35. Write the converse, inverse and contra-positive of the following statement:
Solution:
Let the given statement ”If I run fast, then I will win the race” be represented by the
- Inverse: ”If I do not run fast, then I will not win the race.” ( ∼ P →∼ Q )
nj
Ru
- Contrapositive: ”If I will not win the race, then I did not run fast.” ( ∼ Q →∼ P )
36. Write the converse, inverse and contra-positive of the following statement:
Solution:
37. Write the inverse, converse and contra-positive of the following statement “ if 6 + 1 ≥
Solution:
38. Use basic inference rules to establish the validity of the argument:
p →∼ q, q ∨ r, p ∨ u, ∼ r ∴ u. [3 marks]
Solution:
a
r
lo
From q ∨ r and ∼ r, we can use Disjunctive Syllogism to infer q ✓
iF
nj
Solution:
To show that the conclusion t can be inferred from the given premises using rules of
40. In the back of an old cupboard, you discover a note signed by a pirate famous for
his bizarre sense of humor and love of logical puzzles. In the note, he wrote that he
had hidden treasure somewhere on the property. He listed five true statements and
challenged the reader to use them to determine the location of the treasure. Given
the following five logical statements from the pirate, use inference rules to figure out
a
• If this house is next to a lake, then the treasure is not in the kitchen.
r
lo
iF
• If the tree in the front yard is an elm, then the treasure is in the kitchen.
nj
Ru
• The tree in the front yard is an elm or the treasure is buried under the flagpole.
Dr
• If the tree in the backyard is an oak, then the treasure is in the garage.
Let:
[6 marks]
• r → q: Premises 2
• p: Premises 3
• r ∨ s: Premises 4
• t → u: Premises 5
Tollens. ✓
• Using Premises 5 and s (since the treasure is buried under the flagpole), we
can conclude that t → u does not affect the conclusion, because the treasure is
ra
lo
already determined to be buried under the flagpole, not in the garage. Thus, we
iF
41. Rewrite the following quantified conditional statement informally i.e without using
quantifiers or variables.
Solution:
Solution:
”For any number greater than 2, its square is greater than 4.” ✓
43. Identify this logic gate by name and complete the table. [2 mark].
Solution:
Solution:
ar
lo
i) ∃ a triangle T such that the sum of the angles of T equals 200◦ .
iF
[1 mark]
nj
Solution:
Ru
Socrates is human.
∴ Socrates is mortal.
i) Write the argument form of the above argument and determine whether it is
valid. [2 marks]
Solution:
ii) Determine whether we can conclude that the conclusion is true if the premises
Solution:
46. Show that the negation of a conditional statement p implies q is logically equivalent
Solution:
¬(¬p ∧ q) ∧ (p ∨ q) ≡ p. [4 marks]
Solution:
Apply Distribution:
Ru
(p ∨ ¬q) ∧ (p ∨ q) ≡ p ∨ (¬q ∧ q) ✓
.
Dr
48. Convert the following logic gate circuit into a Boolean expression, writing Boolean
Solution:
i) If it is rainy, then the pool will be closed. It is rainy. Therefore, the pool is
closed. [1 mark]
Solution:
ii) Stacy is a mathematics major and computer science major. Therefore, Stacy is
iii) If I work all night on then homework, then I can answer all the exercise. If I
answer all the exercises, I will understand the material. Therefore, if I work all
Solution:
p → (q ∨ r). [3 marks]
Solution:
variable. [3 marks]
Solution:
ra
lo
52. Are the following system specifications consistent?
iF
nj
• The router can send packets to the edge system only if it supports the new
Ru
address space.
.
Dr
• For the router to support the new address space it is necessary that the latest
• The router can send packets to the edge system if the latest software release is
installed
Let
[9 marks]
them using logical expressions then get an assignment of truth values that makes all
• The router can send packets to the edge system only if it supports the new
address space. p → q. ✓
• For the router to support the new address space it is necessary that the latest
• The router can send packets to the edge system if the latest software release is
installed. r → p. ✓
T F F T F T T No
nj
F T T F T T T No
Ru
F T F F T F T No
F F T T T T F No
.
Dr
F F F T T T T Yes
✓ ✓ ✓ ✓
53. Are these system specifications consistent? ”The file system is not locked only if new
messages will be queued (∼ p → q). If the file system is not locked, then the system
is functioning normally, and conversely (∼ p ↔ r). For new messages are not queued,
it is necessary that they will be sent to the message buffer (∼ q → s). Whenever the
file system is not locked, new messages will be sent to the message buffer (∼ p → s).
New messages will not be sent to the message buffer (∼ s). [4 marks]
Solution:
Solution:
Solution:
56. Express the negation of the statement ∀x∃y(xy = 1) so that no negation precedes a
quantifier. [2 marks]
Solution:
Solution:
p q ∼q p⊕∼q
T T F T
T F T F ✓✓
F T F F
r a
lo
iF
F F T T
nj
Ru
Solution:
Dr
∀x(P (x) → Q(x)), ∀x(Q(x) → R(x)), and ∼ R(a), where a is in the domain, are true,
Solution:
∀x(Q(x) → R(x))
∼ R(a)
Solution: y free ✓
Solution: x free ✓
a
Determine the free variable(s) and bound variable(s) in the given expression.
r
lo
iF
Solution:
nj
Free Variables: z (These variables are not quantified and can take any value.) ✓
Ru
Solution:
Free Variables: z (This variable is not quantified and can take any value.) ✓
Free Variables: z, w (These variables are not quantified and can take any value.) ✓
Solution:
Free Variables: z (This variable is not quantified and can take any value.) ✓
Solution:
.
Dr
= B C̄ D̄(A + Ā) + B C̄ D̄ ✓
= B C̄ D̄(1) + B C̄ D̄..............A + Ā = 1 ✓
= B C̄ D̄ + B C̄ D̄
= B C̄(D̄ + D) ✓
= B C̄(1)
= B C̄ ✓
66. Write the conclusion that can be inferred using universal modus tollens given:
∴ ...................... [1 mark]
67. Find the Boolean expressions that correspond to the circuit shown below. [3 marks]
x
Out
y
Solution:
x x+y ¬(x + y) ✓
ar
lo
iF
¬(x + y) + ¬y · (y + z) ✓
nj
¬y
y
Ru
¬y · (y + z) ✓
.
Dr
y+z
z
68. Find the Boolean expressions that correspond to the circuit shown below. [2 marks]
A•
•
B• •
C•
Solution:
A• A.B A.B +(B̄+C)
•
B• •
B̄
B̄+C
C•
three input signals a, b and c. The recognizer circuit should output 1 for exactly one
specific combination of input signals and output 0 for all other combinations. Provide
the following:
Solution: . There are eight such Boolean expressions. For the combination
Solution:
:
a b c (a ∧ ¬b ∧ c)
0 0 0 0
0 0 1
r
0
a
lo
iF
0 1 0 0
nj
Ru
0 1 1 0
1 0 0 0
.
Dr
1 0 1 1
1 1 0 0
1 1 1 0
Solution:
a
c
a ∧ ¬b ∧ c
70. Tarski’s World is a computer program developed by information scientists Jon Barwise
and John Etchemendy to help teach the principles of logic. Consider a Tarski world
Based on the given objects, rewrite the informal version of the following given state-
Solution:
Truth Value: True. Explanation: Both triangles (small blue triangle and large
Truth Value: True.Explanation: There is a red square (large red square), so the
.
Dr
statement is true. ✓
Solution:
Truth Value: True; Explanation: The only circle present (medium green circle)
Solution:
is true. ✓
Truth Value: False; Explanation: There is a yellow square (small yellow square),
but there is also a red square (large red square), so the statement is false. ✓
Solution:
Formal Statement: For every object x, there exists an object y such that if x
Truth Value: True. All triangles in the Tarski world are blue, and the existence
71. Rewrite the statement “No good cars are cheap” in the form
nj
Solution:
.
Dr
Informal Version;For every car out there, if it’s a good one, then it definitely isn’t
cheap.”. ✓
72. Disprove the converse of the statement: For all integers a and b , if a + b is odd, then
Solution: Converse: For all integers a and b ,if a is odd or b is odd then a + b is
odd. ✓
Statement not true since 1 + 3 = 4 where 1 is odd, 3 is odd but the sum is even. ✓
If you find this exam difficult, you are either a joker or you are going through some
life challenges.
Solution: Let:
ar
lo
Premise 1: P → (Q ∨ R)
iF
Premise 2: ¬R
nj
Ru
Conclusion: ¬P ✓
.
Dr
P Q R Q ∨ R P → (Q ∨ R) ¬R ¬P
T T T T T F F
T T F T T T F
T F T T T F F
T F F F F T F
F T T T T F T
F T F T T T T
F F T T T F T
F F F F T T T
✓ ✓ ✓
The argument is invalid because there is a critical row (Row 2) where the premises
Solution:
p q ∼q p→q ∼q∧p→q ∼p [∼q ∧ (p → q)]→ ∼ p
T T F T F F T
T F T F F F T ✓✓
F T F T F T T
F F T T T T T
The last column has all T ′ s, hence a tautology. ✓
r a
lo
75. Is the following argument valid?
iF
nj
If you do every problem in this book, then you will learn discrete mathematics.
Ru
Solution:
Let p be the proposition ”You did every problem in this book”. Let q be the propo-
sition ”You learned discrete mathematics”. Then this argument is of the form: if
p → q and q, then p. ✓
This is an example of an incorrect argument using the fallacy of affirming the con-
clusion(converse error). ✓
Hence invalid. ✓
Solution:
≡ c ∨ (∼ p∧ ∼ q) ...................... (∼ p ∧ p) = c
Solution:
p q r q→r p → (q → r) p∧q
ra
(p ∧ q) → r (p → (q → r)) → ((p ∧ q) → r)
lo
iF
T T T T T T T T
nj
T T F F F T F T
Ru
T F T T T F T T
.
Dr
T F F T T F T T
F T T T T F T T
F T F F T F T T
F F T T T F T T
F F F T T F T T
A tautology
Solution:
T T T F F T F F T F
T T F F T T F F T F
T F T F F F F T T F
T F F F T F F T T F
F T T T F T F F T F
F T F T T T T T F F
F F T T F T F T T T
F F F T T T T T F F
✓ ✓ ✓ ✓ ✓
Solution:
nj
T T T F T T F T T
.
Dr
T T F F T T T T T
T F T F T T F T T
T F F F T F T T F
F T T T T T F T T
F T F T F T T F F
F F T T T T F T T
F F F T F F T F F
✓ ✓ ✓ ✓ ✓
There exists an interpretation, row 1,2,3,5 and 8 satisfying ϕ thus ϕ is satisfiable. ✓
80. Let A = {2, 3, 4, 5.6 }. Determine the truth value of each of the following statements:
i) ∃ x ∈ A : x + 2 < 7 [1 mark]
iii) ∀ x ∈ A, ∃ y ∈ A : x + y ≤ 10 [1 mark]
Solution: T since for any number in the set, there is a number you can add
iv) ∃ x ∈ A, ∀ y ∈ A : x + y ≤ 10 [1 mark]
Solution: T since 2 added to any of the element in the set has sum ≤ 10 ✓
81. Let B = {−2, 0, 3, 5, 7}. Determine the truth set for the statement
∃y ∈ B : 2y − 1 > 3. [2 marks]
Solution:
The given statement can be read as ”There exists an element y in the set B such that
So, any element y in the set B that is greater than 2 satisfies the given inequality.
Ru
Therefore, the truth set for the statement ∃y ∈ B : 2y − 1 > 3 is {3, 5, 7}. ✓
.
Dr
I am guilty.
p→q
83. Write the negation, converse , contrapositive and the inverse of the statement:
i) p ∧ t [1 mark]
Solution: p ✓
ii) p ∧ c [1 mark]
Solution: c ✓
85. Let p mean ”Paola is happy”, q mean ”Paola paints a picture”, and r mean ”Renzo
r a
lo
is happy’.Formalize the following sentences:
iF
nj
i) If Paola is happy and paints a picture then Renzo isn’t happy [1 mark]
Ru
Solution: p ∧ q →∼ r ✓
.
Dr
Solution: p → q ✓
Solution:
T T T T T T T T
T T F F F F T F
T F T T T T F T
T F F F T F F T
F T T T T T F T
F T F T F F F T
F F T T T T F T
F F F T T T F T
✓ ✓ F ✓
87. Find a sum of products (SOP) and a product of sums (POS) for the truth table
r a
lo
below.[6 marks]
iF
nj
Ru
Output
A B C Z
.
Dr
1 1 1 1
1 1 0 1
1 0 1 0
1 0 0 0
0 1 1 0
0 1 0 1
0 0 1 0
0 0 0 1
Solution:
complement of the variable if the variable input is 0, then multiply the variables
forming a term.
• For each such row, write the variable if the variable input is 0 or write the
complement of the variable if the variable input is 1, then add the variables
forming a sum
Rows: (A, B, C) = (1, 1, 1), (1, 1, 0), (0, 1, 0), (0, 0, 0). ✓
Ru
(1, 1, 1) : A · B · C,
(1, 1, 0) : A · B · C,
(0, 1, 0) : A · B · C,
(0, 0, 0) : A · B · C. ✓
Z = A · B · C + A · B · C + A · B · C + A · B · C. ✓
Rows: (A, B, C) = (1, 0, 1), (1, 0, 0), (0, 1, 1), (0, 0, 1). ✓
(1, 0, 1) : (A + B + C),
(1, 0, 0) : (A + B + C),
(0, 1, 1) : (A + B + C),
(0, 0, 1) : (A + B + C) ✓.
Z = (A + B + C) · (A + B + C) · (A + B + C) · (A + B + C). ✓
Output
r a
lo
iF
A B C Y
nj
1 1 1 0
Ru
1 1 0 0
.
Dr
1 0 1 1
1 0 0 0
0 1 1 0
0 1 0 0
0 0 1 1
0 0 0 0
i) Determine and simplify the logic expression for the output Y above. [3 marks]
Solution:
There are two rows with output 1’s and their corresponding binary values are
001 and 101 which correspond to product terms ĀB̄C and AB̄C respectively.✓
Solution:
89. Find the truth set for each propositional function p(x) defined on the set N of positive
integers.
Solution:
Solution:
90. You are about to leave for campus in the morning and discover that you don’t have
.
Dr
a. If I was reading the newspaper in the kitchen, then my glasses are on the kitchen
table.
d. I was reading the newspaper in the living room or I was reading the newspaper in
the kitchen.
e. If I was reading the newspaper in the living room then my glasses are on the coffee
table.
Solution: Let
RK → GK.............................. by (a)
GK → SB.............................. by (d)
∼ SB........................................ by (c)
RL ∨ RK...................................... by (d)
RL → GC.............................. by (e) ra
lo
RL............................................. by the conclusion of (3)
iF
Solution:
(x + y + z) (x̄ + ȳ + z̄) ✓
Solution:
(x + z̄) (x + 1) (x̄ + 0) ✓
Solution:
=A+B+C +D ✓
93. State and prove that the law of syllogism is a valid argument. [6 marks]
Solution:
Law: p → q, q → r, ∴ p → r. ✓
T T T T T T ∗
T T F T F F
T F T F T T ar
lo
T F F F T F ✓ ✓ ✓ ✓
iF
nj
F T T T T T ∗
Ru
F T F T F T
.
Dr
F F T T T T ∗
F F F T T T ∗
All the critical rows are true hence the argument is valid. ✓
94. Use De Morgan’s laws to write the negation of 4 ≥ x > −1. [3 marks]
Solution:
95. Determine whether the following compound proposition is a tautology and whether
Solution:
Solution:
Solution:
98. Rewrite the following statement in if-then form. ”Either you get to work on time or
Solution:
99. For the given truth table, form a Boolean function and simplify it. [6 marks]
ra
lo
iF
nj
. Ru
Dr
Solution:
100. Determine whether the following two combinatorial circuits equivalent. [3 marks].
101. Use a truth table to determine whether the following statement is a tautology.
[(p ⇒ q) ∧ p] ⇒ q [4 marks]
ar
lo
Solution:
iF
nj
Ru
p q p ⇒ q [(p ⇒ q) ∧ p] [(p ⇒ q) ∧ p] ⇒ q
T T T T T
.
Dr
T F F F T
F T T F T
F F T F T
✓ ✓ ✓
The final column evaluates to true for all possible combinations of truth values of p
Solution:
T T T T T T T T
T T F T F F F T
T F T F T F T T
T F F F T F F T
F T T T T T T T
F T F T F F T T
F F T T T T T T
F F F T T T T T
✓ ✓ ✓
a
The final column evaluates to true for all possible combinations of truth values of p
r
lo
iF
ia a tautology. [4 marks]
.
Dr
Solution: It is a tautology . ✓
✓ ✓ ✓
p q ∼p ∼q p→q ∼ q →∼ p (p → q) ↔ (∼ q →∼ p)
T T F F T T T
T F F T F F T
F T T F T T T
F F T T T T T
equivalent?. [5 marks]
T T T T T T T T
T T F T F F F F
T F T T T T T T
T F F T F F T T
F T T T T T T T
F T F T F T F T
F F T F T T T T
F F F F T T T T
Solution:
ar
lo
P Q ∼P Q′ ∼ P + Q′ ✓ P ∧ (∼ P + Q′ )✓ P → Q✓ (P → Q)′ ✓
iF
1 1 0 0 0 0 1 0
nj
Ru
1 0 0 1 1 1 0 1
.
Dr
0 1 1 0 1 0 1 0
0 0 1 1 1 0 1 0
From the truth table, we can observe that the values in the columns P ∧ (∼ P + Q′ )
and (P → Q)′ are the same for all possible combinations of truth values of P and Q.
c) Every student has at least one course where the lecturer is a professor. [1 mark]
professor ✓
107. What kind of error does the following invalid argument exhibit? Explain.
a) All cheaters sit in the back row. George sits in the back row. ∴ George is a
cheater. [2 marks]
∀ x, P (x) → Q(x),
∴ P (a) ✓
b) All honest people pay their taxes.Darth is not honest. ∴ Darth does not pay his
taxes.[2 marks]
ra
lo
Solution: The argument is of the form:
iF
∀ x, P (x) → Q(x),
nj
Ru
∴ ∼ Q(a)
.
✓
Dr
108. Determine whether each the following arguments are valid. Do not use tables.
a) If John drinks beer, he is at least 18 years old. John does not drink beer. Therefore,
p → q,
∼p
∴∼q ✓
b) If girls are blonde, then they are popular with boys. Ugly girls are unpopular with
boys.
Intellectual girls are ugly. Therefore, blonde girls are not intellectual. [4 marks]
b → p............(1),
u → ∼ p..........(2) ✓
t → u..............(3)
∴ b→t
109. Derive the truth table for the Sum Of Product expressions
Solution:
x y z F Minterms
ra
lo
iF
1 1 1 1 xyz
nj
1 1 0 0
Ru
1 0 1 0
.
Dr
1 0 0 0 ✓✓✓
0 1 1 1 x̄yz
0 1 0 1 x̄yz̄
0 0 1 1 x̄ȳz
0 0 0 1 x̄ȳz̄
110. Simplify the boolean expression P̄ Q̄R̄ + P̄ Q̄R + P̄ QR̄ + P̄ QR + P QR. [3 marks]
= P̄ Q̄(1) + P̄ Q(1) + P QR = P̄ Q̄ + P̄ Q + P QR ✓
= P̄ (Q̄ + Q) + P QR
= P̄ (1) + P QR ✓
= P̄ + P QR
111. Draw the digital circuit corresponding to the Boolean expression āb + bc̄. [3 marks]
112. Rewrite each of the following statements in the form: ” ∀.... if .... then ....”:
Solution: ∀ even integers a and b, if a and b are even integers, then the sum of
.
Dr
a and b is even. ✓
Solution:
Solution:
c) If John drinks beer, he is at least 18 years old. John does not drink beer. Therefore,
p → q,
∼p
∴∼q ✓
d) If girls are blonde, then they are popular with boys. Ugly girls are unpopular with
b → p............(1),
u → ∼ p..........(2) ✓
t → u..............(3)
∴ b→t ra
lo
Contrapositive of (2) gives us p → ∼ u..........(4) ✓
iF
nj
114. Derive the truth table for the Sum Of Product expressions
Solution:
1 1 1 1 xyz
1 1 0 0
1 0 1 0
1 0 0 0 ✓✓✓
0 1 1 1 x̄yz
0 1 0 1 x̄yz̄
0 0 1 1 x̄ȳz
0 0 0 1 x̄ȳz̄
115. Simplify the boolean expression P̄ Q̄R̄ + P̄ Q̄R + P̄ QR̄ + P̄ QR + P QR. [3 marks]
Solution:
ra
P̄ Q̄R̄ + P̄ Q̄R + P̄ QR̄ + P̄ QR + P QR = P̄ Q̄(R̄ + R) + P̄ Q(R̄ + R) + P QR ✓
lo
iF
= P̄ Q̄(1) + P̄ Q(1) + P QR = P̄ Q̄ + P̄ Q + P QR ✓
nj
Ru
= P̄ (Q̄ + Q) + P QR
.
= P̄ (1) + P QR ✓
Dr
= P̄ + P QR
116. Draw the digital circuit corresponding to the Boolean expression āb + bc̄. [3 marks]
Solution: ✓
117. 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 “The two of us are both knights” and B says “A is a knave.”
[4 marks]
Solution:
A B A B A B
118. Use a truth table to determine whether the argument below is valid.
p, p → q, ∼ q ∨ r ∴ r [5 marks]
Solution: .
p q r ∼q p p→q ∼q∨r r ra
lo
T T T F T T T T
iF
T T F F T T F F
nj
Ru
T F T T T F T T
.
Dr
T F F T T F T F
F T T F F T T T
F T F F F T F F
F F T T F T T T
F F F T F T T F
✓ ✓ ✓
Row 1 is a critical row, it has a true conclusion and hence the argument is valid. ✓✓
“Whenever the system software is being upgraded, users cannot access the file system.
If users can access the file system,then they can save new files.
If users cannot save new files, then the system software is not being upgraded.” [5
marks]
Solution:
“Whenever the system software is being upgraded, users cannot access the file sys-
tem.” u → ∼ a ✓
“If users can access the file system, then they can save new files.” a → s ✓
“If users cannot save new files, then the system software is not being upgraded.”
∼ s → ∼ u or u → s ✓
u a s ∼ u ∼ a ∼ s u→∼a a→ s ∼s→∼u
T T T F F F F T T
r a
lo
T T F F F T F F F
iF
T F T F T F T T T
nj
Ru
T F F F T T T T F
.
Dr
F T T T F F T T T
F T F T F T T F T
F F T T T F T T T
F F F T T T T T T
The system is consistent , for example making u false, a false, and s true makes it
consistent. ✓ ✓
120. List any four valid rules of inference for quantified statements [4 marks]
Solution:
i) Universal Generalization
“If John is eligible to vote, then he is at least 18 years old.” Re-write this statement
be eligible to vote.”
ii) A sufficient condition for the warranty to be good is that you bought the com-
mark]
Solution: If you bought the computer less than a year ago then the warranty
is good. ✓
123. Determine the truth value for each simple statement. Then using the truth values
contradiction”. [5 marks]
1 is a prime number: F ✓
p ∨ ∼ p is a contradiction. F ✓
contradiction. : F ✓
124. Write down the converse and the Contrapositive of the implication:
Solution:
125. Given:
. Ru
• Domain P = {a, b, c}
• The truth set of E(x, y) is {(a, a), (b, b), (c, c), (a, c), (a, b)}
Solution: True ✓
Explain. [1 mark]
Solution: False ✓
Solution:
T T T T T T F T
T T F F T F T T
T F T T F T T T
T F F F F T T T
F T T T T T
r aF T
lo
iF
F T F T T F T T
nj
F F T T T T F T
Ru
F F F T T T F T
.
Dr
✓ ✓ ✓
The expression evaluates to True for all possible combinations of truth values of x,
y, and z.
127. Complete the truth table below and use it to establish the truth of each statement
a b ∼a ∼b a→b ∼ a →∼ b b→a ∼ b →∼ a
Solution:
mark]
Solution: False;
From the truth table, we see that the truth values of a → b and b → a are
different in some rows (for example, in the second row where a = T and b = F ).
mark]
Solution: False;
ra
lo
iF
From the truth table, we observe that the truth values of a → b and ∼ a →∼ b
nj
differ in several rows (for example, in the third row where a = F and b = T ).
Ru
Solution: True;
From the truth table, we observe that the truth values of a → b and ∼ b →∼ a
are identical in all rows. Therefore, a → b and its contrapositive are logically
equivalent. ✓
iv) The converse and inverse of a conditional statement a → b are logically equivalent
Solution: True;
From the truth table, we observe that the truth values of b → a and ∼ a →∼ b are
the same in all rows.Therefore, the converse and inverse of a → b are logically
Solution:
p q ∼q p→q p∧∼q (p → q) ∧ (p ∧ ∼ q)
T T F T F F
T F T F T F
F T F T F F
F F T T F F
✓ ✓ ✓
A Contradiction ✓
129. Using the sentence variables (p and q) and the logic symbols (∼, ∧, and ∨), rewrite
Solution: p ∧ ∼ q ✓
Ru
Solution: ∼ (p ∨ q) ≡ ∼ p ∧ ∼ q ✓
[3 marks]
Solution:
p→q
q→r
∴ (p ∨ q) → r [4 marks]
Solution:
ra
lo
iF
nj
. Ru
Dr
All critical rows have a true conclusion and thus the argument is valid ✓
132. Determine a simple logical expression for which each of the following is equivalent to:
i) ∼ (p → q) [1 mark]
Solution: ∼ (p → q) ≡ p ∧ ∼ q ✓
ii) ∼ (p ⇐⇒ q) [1 mark]
Solution: ∼ (p ⇐⇒ q) ≡ p ⊕ q ✓
iii) p ∧ ∼ p [1 mark]
∀x(P (x) → Q(x)), ∀x(Q(x) → R(x)), and ∼ R(a), where a is in the domain, are true,
Solution:
∀x(Q(x) → R(x))
∼ R(a)
Solution:
Ru
T T T T T T ∗
T T F T F F
T F T F T T
T F F F T F ✓ ✓ ✓ ✓
F T T T T T ∗
F T F T F T
F F T T T T ∗
F F F T T T ∗
All the critical rows are true hence the argument is valid. ✓ ✓
Solution:
= A.1
=A
✓✓
136. Let Ψ = {p ∨ q, p∨ ∼ q, ∼ p ∨ q, ∼ p∨ ∼ q ∨ ∼ r, ∼ p ∨ r}
Solution:
p q r p∨q p∨ ∼ q ∼p∨q ∼ p∨ ∼ q∨ ∼ r ∼p∨r Ψ
T T T T T T F T F
T T F T T T T
r a F F
lo
iF
T F T T T F T T F
nj
✓ ✓ ✓
Ru
T F F T T F T F F
F T T T F T T T F
.
Dr
F T F T F T T T F
F F T F T T T T F
F F F F T T T F F
There is no assignment where Ψ evaluates to T . ✓
Hence Ψ is un-satisfiable ✓
137. i) Draw the logic circuit for the following expression: AB + A (B + C) [4 marks]
Solution:
Solution:
AB + A(B + C) = AB + AB + AC = AB + AC = A(B + C) ✓✓
iii) Draw the simplified logic gate circuit derived in ii) above. [2 marks]
Solution:
138. You are about to leave for campus in the morning and discover that you don’t have
ar
a. If I was reading the newspaper in the kitchen, then my glasses are on the kitchen
lo
iF
table.
nj
d. I was reading the newspaper in the living room or I was reading the newspaper in
the kitchen.
e. If I was reading the newspaper in the living room then my glasses are on the coffee
table.
Solution Let
RK → GK.............................. by (a)
GK → SB.............................. by (d)
∼ SB........................................ by (c)
RL ∨ RK...................................... by (d)
RL → GC.............................. by (e)
139. Find the bitwise OR, bitwise AND, and bitwise XOR of the pair of bit strings:
Solution:
nj
OR: 1111111 ✓
Ru
AND: 010000 ✓
.
Dr
XOR: 101111 ✓
Solution:
101111 ✓
141. Find the bitwise OR, bitwise AND, and bitwise XOR of the pair of bit strings:
OR: 1111111 ✓
AND: 0000000 ✓
XOR 1111111 ✓
142. Deduce the conclusion of the argument from the hypothesis explaining each step:
p→q
q→r
∼r
∴∼p
[2 marks]
Solution: ar
lo
iF
nj
.Ru
Dr
143. Determine the validity of the following argument using a truth table
Solution:
T T F F T
p →∼ q
T F T F F
∼p
F T T T T
∴q ✓
F F T T F
Notice that in the fourth row, both premises are true while the conclusion is false;
144. Without using truth tables, determine the validity of the argument:
p→q
∼q
∴∼ p
145. A college cafeteria line has four stations: salads, main courses, desserts, and bever-
ages.
The salad station offers a choice of green salad or fruit salad; the main course station
offers spaghetti or fish; the dessert station offers pie or cake; and the beverage station
choices:
ra
lo
iF
nj
. Ru
Dr
Write each of following statements informally and find its truth value.
Solution:
Solution:
x chose I . [2 marks]
There is a student who chose at least one item from every station. ✓
This is true; both Uta and Tim chose at least one item from every station. ✓
x chose I. [2 marks]
Solution:
146. In a bookstore, there are three genres of books: fiction, mystery, and science fiction.
Three readers, Alex, Brooke, and Chris, make the following choices:
.
Write each of the following statements informally and find its truth value:
Solution:
Solution:
R chose B . [2 marks]
Solution:
Informally: There is a reader who chose at least one book from every genre. ✓
This is true; All the readers chose at least one book from every genre. ✓
Solution:
Informally: There is a genre such that every reader chose a book from that genre..
147. Consider the following truth table. Determine and simplify the logic expression for
the output Y . r a
lo
iF
Output
nj
Ru
A B C Y
1 1 1 0
.
Dr
1 1 0 0
1 0 1 1
1 0 0 0
0 1 1 0
0 1 0 0
0 0 1 1
0 0 0 0
[3 marks]
Solution: There are two rows with output 1’s and their corresponding binary values
are 001 and 101 which correspond to product terms ĀB̄C and AB̄C respectively. ✓
marks]
Assume the hypothesis is true, i.e., m and n are both perfect squares. It follows that
150. Using the Contrapositive proof, show that if n2 is odd, then n is odd, where n is an
integer . [3 marks]
√ √
151. Let x and y be positive numbers. If x ≤ y, then x ≤ y. Proof. [3 marks]
Proof:
152. Prove that: There are no integers x and y such that x2 = 4y + 2. [3 marks]
Solution:
Proof by contradiction
Suppose there are integers x and y such that x2 = 4y + 2 = 2(2y + 1),so x2 is even
So x = 2k, k ∈ Z. Then x2 = 4k 2 .
⇒ 2k 2 = 2y + 1 . This equality is not possible since the LHS is even and RHS odd.
A contradiction. ✓
a
153. For all integers a, b, c, if a divides b and b divides c then a divides c.
r
lo
iF
Prove [3 marks]
nj
Ru
Solution:
.
b = am (i) ✓
c = bn (ii) .
Now, substitute the expression of b from Equation (i) into the b in Equation (ii).
get c = a(mn). Because m and n are integers, their product must also be an integer
[5 marks]
Solution:
when divided by 3. ✓
155. Prove the statement: For all integers m and n, if m and n are odd integers, then
Solution:
Solution:
x2 − 6x + 5 = (2a)2 − 6(21) + 5
= 4a2 − 12a + 5
= 4a2 − 12a + 4 + 1
= 2(2a2 − 6a + 2) + 1
✓✓
Solution:
a
r
lo
Let P (n) : 1 + 3 + 5 + 7 + ... + (2n − 1) = n2
iF
nj
158. Prove the statement: For all integers m and n, if m and n are odd integers, then
Solution:
⇒ m + n = 2a + 1 + 2b + 1 = 2a + 2b + 2 = 2(a + b + 1) ✓
Solution:
n(3n − 1)
1 + 4 + 7 + · · · + (3n − 2) =
2
Proof:
n(3n − 1)
1 + 4 + 7 + · · · + (3n − 2) = ✓
2
1= which is true. ✓
2
nj
Ru
k(3k − 1)
1 + 4 + 7 + · · · + (3k − 2) =
2
(k + 1)(3(k + 1) − 1) (k + 1)(3k + 2)
1+4+7+· · ·+(3k −2)+(3k +1) = = ✓✓
2 2
1 + 2 + 22 + · · · + 2n = 2n+1 − 1,
Solution:
n(n + 1)(2n + 1)
162. Proof that for every n ∈ Z+ , 12 + 22 + ... + n2 = . [5 marks]
6
Solution: Proof by mathematical induction:
ra
(12 + 22 + ... + (k + 1)2 =12 + 22 + ... + k 2 ) + (k + 1)2
lo
✓
iF
k(k + 1) + (2k + 1)
= + (k + 1)2 ✓
nj
6
Ru
(k + 1)(2k + 1) + 6(k + 1)
=
6
2
(k + 1)(2k + 7k + 6)
= ✓
6
(k + 1)(k + 2)(2k + 3)
=
6
⇒ p = 2m, m ∈ Z
⇒ p2 = 4m2 (ii) ✓
2q 2 = 4m2
⇒ q 2 = 2m2
⇒ q 2 is a multiple of 2
⇒ q is a multiple of 2 ✓
Hence, p, q have a common factor 2. This contradicts our assumption that they are
co-primes.
p
ra
lo
Therefore, is not a rational number ✓
iF
q
√
nj
∴ 2 is an irrational number.
Ru
164. [2 marks]
.
Dr
Solution: ✓✓
165. Find the dual of these Boolean expression: xz + 0.x + xy.1. [2 marks]
167. How many different Boolean functions are there of degree 7? [2 marks]
168. Find a Boolean product of the Boolean variables x, y, and z, or their complements,
169. Find the sum-of-products expansion for the function F (x, y, z) = (x + y)z.[4 marks]
171. Prove that if a2 is an odd integer, then a is also an odd integer. [3 marks]
174. Let F (x, y) be the statement “x can fool y,” where the domain consists of all people
ra
lo
in the world. Use quantifiers to express each of these statements.
iF
nj
175. Determinethetruth value of the statement ∃x, ∀y, x ≤ y 2 if the domain for the