DS Mid 1 Solution
DS Mid 1 Solution
DS Mid 1 Solution
Course Course
Name: Discrete Structures Code: CS-211
Total
Duration: 60 Minutes Marks: 4+4+4+4+4
QUESTION 1: Translate the following English sentences into propositional logic using the relevant propositions
and predicates:
W: Planet has water O: Planet has oxygen N: Planet has nitrogen
F: Planet has food L: Planet has life
Operators you are allowed to use: {^, v, , →, ↔}. No other operators or propositional/predicate symbols
are allowed.
SOLUTION
a. Whenever there is oxygen and water on a planet, it has food: O ^ W → F
b. A planet has neither water nor oxygen but it has nitrogen: W ^O ^ N
c. A planet that has water can have either nitrogen or food but not both: W → ((N↔F))
QUESTION 2: Translate the following to predicate calculus. You are allowed to use the quantifiers: {, ∀} and
the connectives: {^, v, , →, ↔}. No other operators or propositional/predicate symbols are allowed.
A(x): x is an astronaut V(x,y): x visits y S(x): x is a star
P(x): x is a planet M(x): x is a mathematician
SOLUTION
a. Every astronaut is also a mathematician: ∀x (A(x) → M(x))
b. There are some astronauts who are mathematicians and have visited some planet: x (A(x) ^ M(x) ^ V(x,y) ^
P(y))
c. There are some mathematicians who have not visited any star: x ( M(x) ^ ∀y( S(y) → V(x,y) ) )
d. All astronauts who have visited a star have also visited all planets: ∀x ( A(x) ^ y( (V(x,y) ^ S(y) ) ^ (∀z( P(z)
→ V(x,z) ) )
SOLUTION
Translate all the above facts to propositional logic using the set of connectives: {^, v, , →, ↔} and next use the
concept of satisfiability and rules of inference to determine who is enrolled in discrete math. Truth table, and
informal reasoning will not be accepted and marks will be given only on the quality of your answer.
SOLUTION
The given facts are:
M→N (1)
P↔S (2)
(S↔M) (3)
N (4)
From the above we conclude that M and N are not enrolled (4) and (5)
and P and S are enrolled in discrete math (8) and (9)
QUESTION 5: Show that [ p ∧ (p q) ] q is a tautology using logical equivalences (and not truth table) .
SOLUTION
[ p ∧ (p q) ] q
[ p ∧ (p q) ] v q (from logical identity of implication)
[ p ∧ [ p v q ] ] v q (from logical identity of implication)
[q]vq (apply resolution on (p) and ( p v q) )
T (negation law)
Hence proved that the given expression is a tuatology