sol_asmt3bcs303_2024[1]
sol_asmt3bcs303_2024[1]
SOLUTIONS (ASSIGNMENT – 3)
NOTE : The solutions given below may prove beneficial for upcoimg examinations.
Q 1 Write the following in symbolic form: (i) the crop will be destroyed if there is a flood; (ii) if it rains, then
I will not go to market; (iii) I am in trouble if the work is not finished on time; and, (iv) the home team wins
whenever it is raining.
Solution. We know the truth value of p ∨ q is F if and only if both p and q have the truth value F. We thus have
¬ p ∧ q → q = ¬ ¬F ∧ F → F = F;
¬q → p ∧ q = ¬ F → F ∧ F = F;
¬p → q ↔ p → ¬q = ¬ F → F ↔ F → ¬F = T ↔ T = T.
Notice that in the second and thid equality we have used standard “order of precedence” for logic connectives. †
(a) The negation (¬) takes precedence over all other connectives.
(b) The conjunction (∧) takes precedence over the disjunction (∨).
Solutions : Assignment – 3 2
(c) Within parenthesis, one-sided conditional connective → takes precedence over bi-conditional
connective ↔ . In general, both → and ↔ have lower order of precedence over all other
connectives.
Q 3 Define tautology, contradiction, contingency, and satisfiability? Justify that each one of the following state-
ment formulas is a tautology: (i) (p ∨ q) ∧ (¬p ∨ r) → (q ∨ r); and, (ii) (p ∨ q) ∧ ¬(¬p ∧ (¬q ∨ ¬r) ∨ (¬p ∧
¬q) ∨ (¬p ∨ r).
Solution. A proposition is called a tautology if it is universally true. It is denoted by T (or simply T). A
proposition is called a contradiction if it is universally false. It is denoted by F (or simply F). A proposition is
called a contingency if it is neither a tautology nor a contradiction. A proposition is called satisfiable if it is true
for at least for one substitution instance. For (i), we have
p ∨ q ∧ ¬p ∨ r → q ∨ r ≡ (p ∨ q) ∧ ¬ p ∨ (p ∨ q) ∧ r → q ∨ r (distributivity)
≡ q ∧ ¬ p ∨ (p ∧ r) ∨ (q ∧ r) → q ∨ r (distributivity & identity)
≡ ¬ q ∧ ¬ p ∨ (p ∧ r) ∨ (q ∧ r) ∨ (q ∨ r) (implication as disjunction)
≡ (¬ q ∨ p) ∧ (¬ p ∨ ¬ r) ∧ (¬ q ∨ ¬ r) ∨ (q ∨ r) (DeMorgan)
≡ A ∧ (¬ q ∨ ¬ r) ∨ (q ∨ r) (distributivity)
≡ A∧T (associativity, commutativity, & complementation)
≡ (¬ q ∨ p) ∧ (¬ p ∨ ¬ r) ∨ (q ∨ r) (identity)
≡ (¬ q ∨ p) ∨ (q ∨ r) ∧ (¬ p ∨ ¬ r) ∨ (q ∨ r) (distributivity)
≡ p∨T ∨r ∧ ¬ p∨q∨T
(commutativity & complementation)
≡ T ∧T = T (dominance),
where A = (¬ q ∨ p) ∧ (¬ p ∨ ¬ r) ∨ (q ∨ r). For (ii), we have
(p ∨ q) ∧ ¬(¬p ∧ (¬q ∨ ¬r) ∨ ¬p ∧ ¬q ∨ ¬p ∨ r
≡ (p ∨ q) ∧ (p ∨ (q ∧ r) ∨ ¬ p ∨ q ∨ ¬p ∨ r (DeMorgan)
≡ (p ∨ q) ∧ p ∨ (p ∨ q) ∧ (q ∧ r) ∨ ¬ p ∨ q ∨ ¬p ∨ r (distributivity)
≡ p ∨ (q ∧ r) ∨ ¬ p ∨ q ∨ ¬p ∨ r (absorption)
≡ T ∨ (q ∧ r) ∨ ¬ p ∨ q
(commutativity & dominance)
≡T (dominance)
Q 4 Write the converse, contrapositive, and inverse of the following: (i) If she has the courage, then she will
win; (ii) if I wake up early in the morning, then I will be healthy; and, (iii) the home team wins whenever it is
raining.
Solution. With p : she has the courage and q : she will win, the statement in (i) can be expressed as p → q.
Solutions : Assignment – 3 3
With p : I wake up early in the morning and q : I will be healthy, the statement in (ii) can be expressed as p → q.
Therefore, the converse, contrapositive, and inverse are respectively given by
With p : it is raining and q : the home team wins, the statement in (iii) can be expressed as p → q. Therefore,
the converse, contrapositive, and inverse are respectively given by
Solution. The truth tables for the three statement formulas p → q, ¬p ∨ q, and ¬q → ¬ p in (i) are as given in
Table 1. The third and fifth columns shows that the equivalence p → q ≡ ¬p ∨ q holds, and the fifth and seventh
columns shows that the equivalence ¬p ∨ q ≡ ¬q → ¬p holds. For (ii), we may recall that the truth value of
r ↔ s is T if and only if r and s are both true or both are false. The truth tables for the three statement formulas
p ↔ q, p → q ∧ q → p , and p ∨ q ∨ ¬p ∧ ¬q are as given in Table 2. The seventh and tenth columns of
the table proves the first equivalence, and the tenth and eleventh columns proves the second equivalence. †
p q p→q ¬p ¬p ∨ q ¬q ¬q → ¬p
T T T F T F T
T F F F F T F
F T T T T F T
F F T T T T T
Q 6 Use algebraic laws to justify the following equivalences: (i) p → q ∧ q → r ≡ p ∨ q → r; and,
(ii) (p ∧ q ∧ a) → r ∧ a → (p ∨ q ∨ r) ≡ a ∧ (p ↔ q) → r.
Solutions : Assignment – 3 4
p → r ∧ q → r ≡ ¬p ∨ r ∧ ¬q ∨ r (implication as disjunction)
≡ ¬p ∧ ¬q ∨ r (distributivity)
≡ ¬(p ∨ q) ∨ r (DeMorgan)
≡ p∨q → r (implication as disjunction)
(p ∧ q ∧ a) → r ∧ a → (p ∨ q ∨ r) ≡ ¬(p ∧ q ∧ a) ∨ r ∧ ¬a ∨ (p ∨ q ∨ r)
≡ (¬p ∨ ¬q ∨ ¬a) ∨ r) ∧ (¬a ∨ p ∨ q) ∨ r (DeMorgan)
≡ (¬p ∨ ¬q ∨ ¬a) ∨ r ∧ (p ∨ q ∨ ¬a) ∨ r) (commutative)
≡ (¬p ∨ ¬q ∨ ¬a) ∧ (p ∨ q ∨ ¬a) ∨ r (distributivity)
≡ ((¬p ∨ ¬q) ∧ (p ∨ q)) ∨ ¬a ∨ r (distributivity)
≡ ¬ (p ∧ q) ∨ (¬p ∧ ¬q) ∨ ¬a ∨ r (DeMorgan)
≡ ¬ (p ∧ q) ∨ (¬p ∧ ¬q) ∧ a ∨ r (DeMorgan)
≡ ¬ (p ↔ q) ∧ a ∨ r (equivalence in Q. 5(ii))
≡ (p ↔ q) ∧ a → r (implication as disjunction)
Q 7 State and prove the modus ponens, modus tollens, and the disjunctive syllogism.
Solution. The modus ponens states that p → q ∧ p ⇒ q; the modus tollens states that (p → q ∧ ¬q ⇒ ¬p;
and, the disjunctive syllogism states that p ∨ q ∧ ¬p ⇒ q. We first prove that p → q ∧ p → q is a tautology.
Solutions : Assignment – 3 5
For, we have
p → q ∧ p → q ≡ ¬p ∨ q ∧ p → q (implication as disjunction)
≡ (¬p ∧ p) ∨ (q ∧ p) → q (distributivity)
≡ F ∨ (q ∧ p) → q
(complementation)
≡ (q ∧ p) → q (identity law)
≡ ¬(q ∧ p) ∨ q (implication as disjunction)
≡ ¬q ∨ ¬p ∨ q (DeMorgan)
≡ ¬q ∨ q ∨ ¬p (commutativity)
≡ T ∨ ¬p (identity law)
≡T (dominance)
We next prove that (p → q ∧ ¬q → ¬p is a tautology. For, we have
p → q ∧ ¬q → ¬p ≡ ¬p ∨ q ∧ ¬q → ¬p (implication as disjunction)
≡ (¬p ∧ ¬q) ∨ (q ∧ ¬q) → ¬p (distributivity)
≡ ¬(p ∨ q) ∨ F → ¬p
(DeMorgan & complementation)
≡ ¬(p ∨ q) → ¬p (identity law)
≡ p ∨ q ∨ ¬p (implication as disjunction)
≡ p ∨ ¬p ∨ q (commutativity)
≡ T ∨q (complementation)
≡T (dominance)
Finally, we prove that p ∨ q ∧ ¬p → q is a tautology. For, we have
p ∨ q ∧ ¬p → q ≡ (p ∧ ¬p) ∨ (q ∧ ¬p) → q (distributivity)
≡ F ∨ (q ∧ ¬p) → q
(complementation)
≡ (q ∧ ¬p) → q (identity)
≡ ¬(q ∧ ¬p) ∨ q (implication as disjunction)
≡ (¬q ∨ p) ∨ q (DeMorgan)
≡ (¬q ∨ q) ∨ p (commutativity)
≡T ∨p (complementation)
≡T (dominance)
Solution. The following is a step-by-step argument to show that the given premises are consistent:
(2) r → ¬q Rule - P
(3) q → ¬r (2), Rule - T (contrapositive)
(4) p → ¬r (1), (3), hypothetical syllogism
(5) s → ¬q Rule - P
(6) q → ¬s (5), Rule - T (contrapositive)
(7) p → ¬s (1),(6), hypothetical syllogism
(8) r → ¬p (4), Rule - T (contrapositive)
(9) s → ¬p (7), Rule - T (contrapositive)
(10) r ∨ s → ¬p (8), (9), Rule - T (equivalence)
(11) r∨s Rule - P
(12) ¬p (10), (11), modus ponens
(9) p ∨ ¬p ≡ T (1), (12)
Q 9 Justify that the following premises are inconsistent: (i) If Nirmala misses many classes due to illness, then
she fails high school; (ii) if Nirmala fails high school, then she would be uneducated; (iii) if Nirmala reads a
lot of books, then she is not uneducated; and, (iv) Nirmala misses many classes due to illness and reads a lot of
books.
p : Nirmala misses many classes due to illness; q : she fails high school;
r : she would be uneducated; s : Nirmala reads a lot of books
Q 10 Use rules of inference to justify that the three hypothesis (i) if it doesn’t rain or it is not foggy, then the
sailing race will be held, and the lifesaving demonstration will go on; (ii) if the sailing race is held, then the
trophy will be awarded; and (iii) the trophy was not awarded, imply the conclusion “it rained”.
Solutions : Assignment – 3 7
p : It rained; q : It is foggy;
r : The sailing race will be held; s : The life saving demonstration will go on;
t : The trophy will be awarded
(1) ¬r → s Rule - P
(2) s→t Rule - P
(3) ¬r → t (1), (2), hypothetical syllogism
(4) r→p Rule - P
(5) ¬p → ¬r (4), Rule - T (contrapositive)
(6) ¬p → t (5), (3), hypothetical syllogism
(7) ¬p ∧ q Rule - P
(8) ¬p (7), simplification
(9) t (6), (8), modus ponens
Q 11 Use variables, logical operations, and quantifiers, to express the following as predicates:
(iv) If a person is female, and is a parent, then this person is someone’s mother;
(v) There is a barber in the town who shaves all men who do not shave themselves.
Solution. The statement in (i) is the negation of the statement “all birds can fly”, which can be expressed as
¬ ∀ x Bird(x) → Fly(x) ≡ ∃ x Bird(x) ∧ ¬ Fly(x).
The statement in (ii) can be expressed as ∀ x ∃ y Like(x, y), where universe for x and y is the set of people (may
also include some pets). The statement in (iii) can be expressed as
∀ x Int x → Even x ∨ Odd x .
where universe for x is the set of females and y is the set of all humans. For (v), the given statement can be
expressed as
∃ y Barber(y) ∧ ∀ ¬ Shaves(x, x) → Shaves(y, x) ,
Solutions : Assignment – 3 8
where universe for x and y is the set of all men in the town. Alternatively, taking y = b (barber), the above
statement may also be expressed as
∃ b ∀ x ¬ S(x, x) → S(b, x)
Q 12 Use variables, logical operations, and quantifiers, to express the following as predicates:
(i) For every number there is a number greater than that number;
(iv) There is no student in the class who knows both Python and R programming.
Solution. Taking G(x, y) : y > x, the statement in (i) can be expressed as ∀ x ∃ y G(x, y), where universe for x and
y is the set of real numbers R. For (ii), let S(x, y) : x + y is an integer. Then the given statement can be expressed
as ∀ x ∀ y S(x, y), where universe for x and y is the set of integers Z. For (iii), we may take the predicates
so that the statement in (iii) is the negation of the statement “every man is perfect”, which can be expressed as
¬ ∀ x M(x) → P(x) ≡ ∃ x M(x) ∧ ¬ P(x) .