CS210 Homework1 Fall2023
CS210 Homework1 Fall2023
Problem Set 1
1 Instructions
• The deadline for submitting this homework set is Thursday September 21, 2023 11:55pm
• Adhere to the deadline. Late submissions are not allowed. You have more than enough time for the
homework so it is advised to start early.
• The names of both the files should be ”yourrollnumber hw1.tex/pdf” e.g. 24100077 hw1.tex. If you
will not follow the naming convention your homework will NOT BE GRADED.
• Plagiarism of any sort will not be tolerated. All the cases will be forwarded to disciplinary committee.
• You are required to submit solutions for questions 1, 2, 5, 7, 8, 9, 10, 11, 12, 13, 14. The rest are
for practice.
2 Homework Questions
1. Let p and q be the propositions.
(a) ¬p
(b) p ∨ q
(c) ¬p ∧ q
(d) q → p
(e) ¬q → ¬p
(f) ¬p → ¬q
(g) p ↔ q
(h) ¬q ∨ (¬p ∧ q)
1
2. Determine whether each of these conditional statements is true or false.
p q p∨q ¬p r ¬p ∨ r (p ∨ q) ∧ (¬p ∨ r) (q ∨ r)
2
5. Construct a truth table for ((p → q) → r) → s
p q p→q r (p → q) → r s ((p → q) → r) → s
7. Show that ¬∃x(P (x) → ¬Q(x)) is logically equivalent to ∀x(P (x) ∧ Q(x)).
8. Let G(x, y) be the predicate “x is a good friend of y”. Let the UoD be all students in LUMS. Using
quantifier negation prove that ¬∃ x ∀ y G(x, y) ≡ ∀ x ∃ y ¬G(x, y)
9. Suppose a software system has 9 components {A, B, C, D, E, F, G, H, I}. Each component has either
exactly one of the two types of bugs (Bug 1 and Bug 2) or has no bug (is clean). We want to identify
which components have Bug 1 or Bug 2 or is clean. The software testing team has summarized its
findings as follows.
• (9.1) Let P (x) be the predicate that component x has Bug 1, let Q(x) be the predicate that component
x has Bug 2 and let R(x) be the predicate that component x is clean. Translate each of the
below findings in terms of the predicates P (x), Q(x) and R(x).
(a) E and H do not have the same bug.
3
(e) If either E or H has Bug 1 then I does not have Bug 2.
(l) If I has bug 2 then at least one of D, F and A have Bug 2 too.
(m) If E or G have bug 2 then all components have either Bug 1 or Bug 2.
• (9.2) Determine which components have Bug 1, which ones have Bug 2 and which are clean.
Hint: First determine which components have Bug 1 then determine which ones have Bug 2
and then list the clean ones.
10. What are the contrapositive, the converse, and the inverse of the conditional statement The home
team wins whenever it is raining?
4
11. Express each of these statements using predicates, quantifiers, logical connectives, and mathematical
operators where the domain consists of all integers.
12. Translate each of these nested quantifications into an English statement that expresses a mathemat-
ical fact. The domain in each case consists of all real numbers.
(a) ∃x∀y(xy = y)
(b) ∀x∀y((x < 0) ∧ (y < 0)) → (xy > 0)
(c) ∃x∃y((x2 > y) ∧ (x < y))
(d) ∀x∀y∃z(x + y = z)
13. Rewrite each of these statements so that negations appear only within predicates (that is, so that no
negation is outside a quantifier or an expression involving logical connectives).
14. Express each of these system specifications using predicates, quantifiers, and logical connectives, if
necessary.