Docsity

Homework 1 Practice - Artificial Intelligence | CPSC 625, Assignments of Computer Science

Toggle sidebar
bg1
CPSC 625-600 Homework #1 (Total 100 points)
Due 10/8/07, in Class
Handwritten or printed hardcopy must be submitted.
Yoonsuck Choe
September 30, 2007
1 Uninformed Search
B
EA C D
(a) Tree 1 (b) Tree 2 (c) Tree 3
Figure 1: Search Trees.
Consider the three search trees in Figure 1. Suppose the branching factor is band the tree is full. Suppose
branches are visited from the left to the right. Nodes A, B, C, D, and E the goal nodes in the trees. Assume
that nodes A, C, D, and E are at depth n; and A and C are the k-th node of their parents (i.e., they are
children of the left-most node at depth n−1). Node B is at depth m(< n). Node D is the last node to the
right at depth n. Depth nis the last level of all the trees. Further assume that the exploration of each depth
level proceeds from the left to the right.
Question 1 (4 pts): If n > 2b, which one shows a case where both depth-first and breadth-first have
identical time complexity? (Tree 1, 2, 3, none, or any combination of the three)
Question 2 (4 pts): Which one shows a case where depth-first can be complete but non-optimal? (Tree 1,
2, 3, none, or any combination of the three) Explain why.
Question 3 (4 pts): Assume b= 5,k= 2, and n= 7. What is the number of nodes visited in case of
Tree 2 for depth-first (and breadth-first)? Note that the “number of node visited” is defined as the number’
of goal checks.
Question 4 (4 pts): Assume b= 10,k= 3,m= 4, and n= 20. In which case does depth-first outperform
breadth-first in terms of time complexity (= nodes visited)? (Tree 1, 2, 3, none, or any combination of the
three)
1
pf3
pf4

Partial preview of the text

Download Homework 1 Practice - Artificial Intelligence | CPSC 625 and more Assignments Computer Science in PDF only on Docsity!

CPSC 625-600 Homework #1 (Total 100 points)

Due 10/8/07, in Class

Handwritten or printed hardcopy must be submitted.

Yoonsuck Choe

September 30, 2007

1 Uninformed Search

B

A C E D

(a) Tree 1 (b) Tree 2 (c) Tree 3

Figure 1: Search Trees.

Consider the three search trees in Figure 1. Suppose the branching factor is b and the tree is full. Suppose branches are visited from the left to the right. Nodes A, B, C, D, and E the goal nodes in the trees. Assume that nodes A, C, D, and E are at depth n; and A and C are the k-th node of their parents (i.e., they are children of the left-most node at depth n − 1 ). Node B is at depth m (< n). Node D is the last node to the right at depth n. Depth n is the last level of all the trees. Further assume that the exploration of each depth level proceeds from the left to the right.

Question 1 (4 pts): If n > 2 b, which one shows a case where both depth-first and breadth-first have identical time complexity? (Tree 1, 2, 3, none, or any combination of the three)

Question 2 (4 pts): Which one shows a case where depth-first can be complete but non-optimal? (Tree 1, 2, 3, none, or any combination of the three) Explain why.

Question 3 (4 pts): Assume b = 5, k = 2, and n = 7. What is the number of nodes visited in case of Tree 2 for depth-first (and breadth-first)? Note that the “number of node visited” is defined as the number’ of goal checks.

Question 4 (4 pts): Assume b = 10, k = 3, m = 4, and n = 20. In which case does depth-first outperform breadth-first in terms of time complexity (= nodes visited)? (Tree 1, 2, 3, none, or any combination of the three)

2 Informed Search

Answer the following questions regarding informed search strategies.

A

b c

d e^ f

g h i

j k

l

m n

o

p

q

h=

h=

h=3 h=

h=

h=

h=

h=

h=

h=

h=

h=

h=

h=

h=

h=

h=

Figure 2: Search tree. An example search tree is shown with path cost on each edge and heuristic function value next to each node. The leaf nodes are goal states.

Question 1 (6 pts): Is the heuristic admissible? Explain why.

Question 2 (6 pts): Given the search tree in figure 2, calculate the f (n) value for each node (A to q).

Question 3 (12 pts): Given the search tree in figure 2, list the node visit order and the goal state reached for the three search methods: (1) greedy search and (2) A∗. When the evaluation function values are tied while sorting, give preference to the one that has been added latest. That is, given two nodes n and m, if f (n) = f (m), then visit n if n is newer (i.e., m has been in the node list for a longer while than n).

4 Propositional Logic

4.1 Normal forms

In all of the problems in this section, show each step of the derivation and indicate which axioms (or other rules) you used: For example, distributive law, definition, etc.

Question 1 (4 pts): Convert ¬(P → ¬S) ∨ (¬(Q → R) ∧ S) into conjunctive normal form.

Question 2 (4 pts): Convert ¬T → (R ∧ (S → (P ∧ Q))) into disjunctive normal form.

Question 3 (4 pts): Convert (R ∧ S) → (Q → ¬(P ∧ ¬T )) into horn normal form. After that, show the equivalent expression with a single implication (→) and some conjunctions (∧).

4.2 Valid vs. inconsistent

Question 1 (5 pts): Show that (P ∧ Q) ∨ ¬(R ∧ ¬(P → ¬Q)) is valid.

Question 2 (5 pts): Show that (P ∨ Q) ∧ ¬(¬Q → P ) is inconsistent.

4.3 Theorem proving

Given:

1. S ∨ ¬P

2. ¬S ∨ R

3. R → T

4. (R ∧ S ∧ T ) → Q

show that P → Q is a logical consequence of the above using resolution. Precisely follow the steps below.

Question 1 (5 pts): Convert the above problem into a form that is suitable for resolution. This may involve converting some expressions into CNF, and other steps such as including the conclusion part (P → Q).

Question 2 (14 pts): With the resulting resolution problem from the above, prove the initial theorem using resolution. Show every step.