Sei sulla pagina 1di 9

UPRM - ECE Department ICOM5015/ICOM6087/CIIC5015

ICOM5015 – Artificial Intelligence


University of Puerto Rico
College of Engineering
Department of Electrical and Computer Engineering

Name: Student ID:

Instructions
Carefully read these instructions! Seriously!

This exam must be solved individually. Cheating in the exam will be handled according to the regulations
of the University of Puerto Rico.

You have 45 Minutes to solve the exam.

You can use only a sheet of formulas. You are not allowed borrow from or lend to anyone any material. Make
sure your pen has enough ink, or if you use pencil bring your own eraser.

You are not allowed to use calculator or computer – you do not need them anyway.

Turn off your cellular phone to avoid disturbing your classmates and yourself. You must keep it in your
pocket or backpack at all times.

You are not allowed to use any kind of electronic device during the exam – MP3 players, tablet
computers, cellular phones, beepers, laptops, etc. If you take any electronic device in your hands during the
exam, your action may be treated as an attempt to cheat.

Make sure your handwriting is legible. I will make a reasonable effort, when grading, to understand your
answers, but I may take off credit when I cannot fully understand your handwriting.

Suggestions
You may answer the exam in English or Spanish, as you feel comfortable.

If you do not understand a question, ask me for clarification.

State clearly any assumption you may need to solve any problem.

Divide your time proportionately to the points of each problem. If the time you assigned for one question
expires, go on solving another question. You may get partial credit for correct processes towards the
solution of a problem, but only if the process is correct. You may attempt to finish incomplete problem
solutions if you have time left before handing in your exam.

I wish you success!

March 28, 2018 Instructions - i


UPRM - ECE Department ICOM5015/ICOM6087/CIIC5015

Warm up questions
1. Match the correct statements (10 points):
According to the four visions of Artificial Intelligence, an agent that

Thinks humanly Passes the Turing test no matter the underlying


mechanisms
Acts rationally
The laws of thought

Acts humanly Is based on cognitive models

Thinks rationally Attempts to achieve the best expected outcome

2. Only agents in a fully observable environment can be rational (10 points)

TRUE

FALSE

Justify your answer


Any agent that attempts to achieve the best expected outcome is rational regardless of the
observability of the environment.

3. A perfectly rational Tic-Tac-Toe agent always wins (10 points).

TRUE

FALSE

Justify your answer

In Tic Tac Toe two rational agents always tie the game.

March 28, 2018 Problems and Solutions - 1


UPRM - ECE Department ICOM5015/ICOM6087/CIIC5015

4. The environment for a Monopoly player agent is (select all that apply) (10 points)

a. Fully observable b. Partially observable

c. Deterministic d. Strategic e. Stochastic

f. Episodic g. Sequential

h. Static i. Semidynamic j. Dynamic

k. Discrete l. Continuous

m. Single agent n. Multiagent

o. Known p. Unknown

q. Competitive r. Collaborative

5. Depth-first is (Select all that apply or fill in the blanks (10 points):

Complete TRUE FALSE

Optimal TRUE FALSE

Space Complexity ______𝑂(𝑏𝑚 )_________________________

Time Complexity ______𝑂(𝑏𝑚 )_________________________

Describe any assumptions or constraints for optimality or completeness and explain the
terms for space and time complexity and justify your choices
Depth-first search is neither complete nor optimal regardless of any assumption. 𝑏 is the
branching factor and 𝑚 is the maximum depth of the graph.

March 28, 2018 Problems and Solutions - 2


UPRM - ECE Department ICOM5015/ICOM6087/CIIC5015

6. Breath-first search is (Select all that apply or fill in the blanks) (10 points):

Complete TRUE FALSE

Optimal TRUE FALSE

Space Complexity ____𝑂(𝑏𝑑 )____________________________

Time Complexity ____ 𝑂(𝑏𝑑 )___________________________

Describe any assumptions or constraints for optimality or completeness and explain the
terms for space and time complexity, and justify your choices
For the breath-first search to be complete it is necessary to assume that 𝑏 is finite.
Optimality assumes that the costs of all the branches are identical. 𝑏 is the branching factor
and 𝑑 is the depth of the solution.

7. Figure 1 shows four graphs where the number inside the nodes represent the value of the heuristic
function ℎ(𝑛) for node 𝑛, an estimation of the distance from node 𝑛 to the goal. The number on the
arcs represents the actual distance function 𝑔(𝑛) traveled along each arc. Write on the side of each
graph if ℎ(𝑛) is admissible or consistent – it could be both or none - (10 points).

March 28, 2018 Problems and Solutions - 3


UPRM - ECE Department ICOM5015/ICOM6087/CIIC5015

Admissible Not Admissible


Consistent Not Consistent

Admissible Not Admissible


Not Consistent Not Consistent
20 ≰ 6 + 13

Figure 1. Graphs for question 7

March 28, 2018 Problems and Solutions - 4


UPRM - ECE Department ICOM5015/ICOM6087/CIIC5015

Problem
8. Consider the state space shown in Figure 2, where A is the starting state, L satisfies the goal test. The
labels of each arc represent the cost of traversing them. The estimated cost to a goal is given inside
each node. For each of the following search strategies, indicate whether the goal state is reached, and
which nodes are in the explored set at the end of the execution. In case of ties, chose the next node
in alphabetical order.

Is ℎ (𝑛) admissible? Justify your answer (5 points).


ℎ(𝑛) is admissible because for any node 𝑛, ℎ(𝑛) ≤ 𝑐 (𝑛). The most critical node is G, where
ℎ(𝐺 ) = 𝑐(𝐺 ) = 6.

Is ℎ (𝑛) consistent? Justify your answer (5 points).


ℎ(𝑛) is consistent because for any node 𝑛, ℎ(𝑛) ≤ 𝑐 (𝑛, 𝑎, 𝑛′ ) + ℎ(𝑛′). Nodes G, J, and K are
contiguous to the goal and there are no intermediate goals so ℎ(𝑛) = 𝑐 (𝑛, 𝑎, 𝐿) + 0 ≤ 𝑐(𝑛) + 0.

Depth-First Search (5 points)


Goal Reached TRUE
(circle choice) FALSE
Nodes in the explored set at the end A D I K L
Frontier Discipline LIFO
Distance of computed route 47 (Route is A D I K L)
Iterative Deepening Search (5 points)
Goal Reached TRUE
(circle choice) FALSE
Nodes in the explored set at the end A B C D E F G H I K L(Goal)
Frontier Discipline LIFO in each iteration of ℓ.
Distance of computed route 25 (Route is A B G L)
A* (10 points)
Goal Reached TRUE
(circle choice) FALSE
Nodes in the explored set at the end A B C E F G L (Goal)
Frontier Discipline Priority by 𝑓 (𝑛) = ℎ (𝑛) + 𝑔(𝑛)
Distance of computed route 25 (Route is A B G L)

March 28, 2018 Problems and Solutions - 5


UPRM - ECE Department ICOM5015/ICOM6087/CIIC5015

Figure 2. Graph for problem 8

March 28, 2018 Problems and Solutions - 6


UPRM - ECE Department ICOM5015/ICOM6087/CIIC5015

Depth-First search Frontier/Explored set


1. A/{}
2. B C D/{A}
3. B C I/{A D}
4. B C K/{A D I}
5. B C L/{A D I K}
6. B C/{A D I K L(Goal)}

Iterative Deepening ℓ/Frontier/Explored

1. 0/A/{}
2. 0//{A}
3. 1/A/{}
4. 1/B C D/{A}
5. 1/B C/{A D}
6. 1/B/{A C D}
7. 1//{A B C D}
8. 2/A/{}
9. 2/B C D/{A}
10. 2/B C I/{A D}
11. 2/B C/{A D I}
12. 2/B E F/{A C D I}
13. 2/B E/{A C D F I}
14. 2/B/{A C D E F I}
15. 2/G/{A B C D E F I}
16. 2//{A B C D E F G I}
17. 3/A/{}
18. 3/B C D/{A}
19. 3/B C I/{A D}
20. 3/B C K/{A D I}
21. 3/B C/{A D I K}
22. 3/B E F/{A C D I K}
23. 3/B E/{A C D F I K}
24. 3/B H/{A C D E F I K}
25. 3/B/{A C D E F H I K}
26. 3/G/{A B C D E F H I K}
27. 3/L/{A B C D E F G H I K}
28. 3//{A B C D E F G H I K L(Goal)}

Iterative deepening finds the optimal solution by pure chance because the Frontier
queue does not take into consideration distance; it finds the shallowest solution which
in this case happens to be also optimal in distance (See detail above)
A* Search Frontier (𝑓(𝑛) = ℎ(𝑛) + 𝑔(𝑛))/Explored set

1. A(22+0)/{}

March 28, 2018 Problems and Solutions - 7


UPRM - ECE Department ICOM5015/ICOM6087/CIIC5015

2. B(17+6) C(20+4) D(24+6)/{A(0)}


3. C(20+4) E(13+11 via B) G(6+19) D(24+6)/{A B}
4. E(13+11 via B) F(15+9) G(6+19) D(24+6)/{A B C}
5. F(15+9) G(6+19) H(6+21) D(24+6)/{A B C E(via B)}
6. G(6+19) H(6+21) D(24+6)/{A(0) B(6) C(4) E((12 via B) F(9 via C)}
7. L(0+25) H(6+21) D(24+6)/{A(0) B(6) C(4) E((12 via B) F(9 via C) G(19 via B)}
8. H(6+21) D(24+6)/{A(0) B(6) C(4) E((12 via B) F(9 via C) G(19 via B) L(25 via G (Goal)) }

March 28, 2018 Problems and Solutions - 8

Potrebbero piacerti anche