Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

NPTEL: AI Assignment 7 Solutions

Logic & Satisfiability

Solution Q1) ABCD, Follows from slides

Solution Q2) D, Follows from slides.

Solution Q3) A

(¬q → r) ∧ (r → ¬p)
⇔ (¬(¬q) ∨ r) ∧ (¬r ∨ ¬p) [Using p → q ⇔ ¬p ∨ q]
⇔ (q ∨ r) ∧ (¬p ∨ ¬r)

You can also draw truth-table for all 4 options and verify that only option A matches the
question's expression.

Solution Q4) ABD, Follows from slides

Solution Q5) 3

i. This statement is incorrect. Forward chaining is complete but not necessarily sound
in this context.
ii. This statement is incorrect. A sound algorithm must only prove true statements, not
everything.
iii. This statement is correct. A sound algorithm proves only true statements.
iv.

Solution Q6) 0
Given{(a, ¬b, c), (c), (¬c, d, ¬e), (¬a, ¬b, e), (a, ¬b, ¬c), (d, b), (e, a)}
Setting c to be true (unit propagation)
=> {(d, ¬e), (¬a, ¬b, e), (a, ¬b), (d, b), (e, a)}
Setting d to be true (pure literal)
=> {(¬a, ¬b, e), (a, ¬b), (e, a)}
Setting e to be true (pure literal)
=> {(a, ¬b)}
Setting a to be true (pure literal)
=> {}
Solution Q7) ABCD
1. {¬a ∨ b} and {¬b} resolve to give {¬a}
2. {¬b} and {¬c ∨ b} resolve to give {¬c }
3. {¬a}(from 1) and {a ∨ d} resolve to give {d}
4. {c ∨ ¬d} and {¬c } (from 2) resolve to give {¬d}
5. {d} (from 3) and {¬d} (from 4) resolve to give {}

Solution Q8) 4

1. Applying MP on a (from i) and a ⇒ b (from iii) we get that b is true.


2. Given that a (from i) and b (from 1) are true and b ∧ a ⇒ c (from ii), applying MP we get
that c is true.
3. Given that c (from 2) and b (from 1) are true and c ∧ b ⇒ d (from iv), applying MP
we get that d is true.
4. Given that d (from 3) and b (from 1) are true and d ∧ b ⇒ e (from v), applying MP
we get that e is true.
Hence b, c, d, e all are true given the premises(i-v).

Solution Q9) BD
Discussed in videos: First-Order Logic also known as First-Order Predicate Logic and
Bayesian Networks / Probabilistic propositional logic have different ontological and
epistemological commitments.

Solution Q10) CD

- A) WalkSat guaranteed to make at least 1 false clause true, but is can also make true
clauses false and hence it not guaranteed to increase the number of clauses satisfied
in every iteration
- B) WalkSAT is designed to find a satisfying assignment for satisfiable problems but
does not inherently determine if a problem is unsatisfiable. It operates under a limit
on the number of flips or iterations and may terminate without finding a solution,
which does not necessarily imply that the problem is unsatisfiable. Instead, it could
mean that the solution was not found within the given computational limits.
- C) Given enough time (asymptotically), WalkSAT will find a solution if one exists. The
term "asymptotically complete" means that as the number of allowed iterations
approaches infinity, the probability that WalkSAT will find a solution (if one exists)
approaches 1
- D) A sound algorithm is one that, whenever it claims a solution, that solution is
indeed correct. WalkSAT, when it finds a satisfying assignment for a Boolean formula,
that assignment is indeed a correct solution to the problem. Soundness does not
comment on the algorithm's ability to find a solution in all cases, only that any
solution it does report is a true solution.

You might also like