# COMP415 Artificial Intelligence

The exam/project has been submitted by myself is solely my own work and I did not get any aid from other people.
Note: Please make sure to read the last page of the exam which is about the instructions, before start to solve the exam
Problem 1: Given the following puzzle you are requested to design an agent to go around in the puzzle. Your agent can move only 2 squares in each direction, for example, if start point is S(0,0) and it moves towards right it can go to (2,0) as in the figure below. While the agent moves, it can jump over a black square but it cannot land over it. For example, no move can go over the point (1,0).
Assumming that this agent first moves to forward (up   ) then right(    ), then back (down  ) and then left (     ) in its move.

 0 1 2 3 4 (x-Axis) 0 S x 1 2 3 4 (y- axis)
1. Starting from point S, please draw a search space for this agent (you can use coordinates for that. Please apply loop detection. (10 pts)
2. For the above agent and its environment, please answer the following questions. Please write one sentence problem specific explanation and do not forget to tell the answer (ex: because of …. It is episodic). One word answers (ex: static or dynamic) or the definitional answers which is not specific to the problem will not get any points. (16 points)

1-Is the environment Accessible or Inaccessible?
2-Is the environment Deterministic or Non-deterministic?
3-Is the environment Static or Dynamic?
4-Is the environment Discrete or Continuous?

1. What is the type of this problem? Explain in one sentence. (Single word answers will not get any point) (4 pts)

Problem 2: Consider the following search problem as represented in the below tree. The start state is given as A and the goal state is represented as G (all of the nodes represented as  G1, G2, G3, G4 are actually the same goal G but they are numbered to ease your work in solution)
In the below tree, number on the edges which are black represents the actual cost between the nodes and the red values on the nodes represent the heuristic value.

• Do not use colors in your solution.
• In order to write numbers next to G do not use G1 but either use subscript and write G1.
• Any cost information written like B2 will not be accepted you should use superscript and it should be written B2
• In the questions you should use the queueing techniques as it is done in the lectures even it is possible to solve it in another way, the solutions with different methods won’t be accepted.
• While using the letters in the queue use font-14 (Arial) ex: A
• For queuing techniques please use the reserved places for you. To show the expanded nodes please use the word (insert-shapes-line) so that it can be easily detected as an example   A
• Follow the line numbers in an order when your write your queue which is top to down.
• Do not change the font or the format of the below reserved spaces for the questions
• If you need to draw, please use (insert-shapes)
• In the queue if you have a node with the same cost of the new expanded one, add the new expanded one after the one available in the queue.
1. What solution path will Breadth First Search returns? Write the path and show how you reach the goal by using queuing technique (10 pts )

Path:

1. What solution path will Iterative Deepening Search returns? Write the path and show how you reach the goal by using queuing technique ( 10 pts)

Path:

1. What solution path will Uniform Cost Search returns? Write the path and show how you reach the goal by using queuing technique e (10 pts )
2. What solution path will A* Search returns? Write the path and show how you reach the goal by using queuing technique (10 pts )

Path:

1. For the above given tree and the solutions of the four search algorithms you solved ( BFS, IDS, UCS, A* ), what is the highest space complexity among all the algorithms particularly for this example and how did you obtain it? Please explain in 2 sentences ( Please not the I am not asking bigO notation I am asking a literal number like 50)In your explanation, If you need to refer to the above solutions please do so. (10 points)

Problem 3: You are given a game which has the following rules:
You have a single token x, and it can move,

• Two squares right which has to follow with 1 square up or down (ex: if the token (x) in (2,3) goes to right, it should also either go to (4,2) or (4,4))
• Two squares left which has to follow with 1 square up or down
• Two squares up which has to follow with 1 square right or left
• Two squares down which has to follow with 1 square right or left

 0 1 2 3 4 5 6 0 1 2 3 x 4 5 6

1. Provide an admissible heuristic, means it should be admissible for a given any start state to any goal state (example below). Please provide your heuristic like a formula and then explain the formula if it is needed with an example ( not more than 2 sentences) (10 points)

 EX: 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 0 1 1 2 S 2 3 3 4 4 5 5 6 6 G

(in the example the first grid is a start state and the second grid is a goal state)

1. Independent than the above problem. Assume that for any game, the actual cost from start state to the goal state is 50. You have two admissible heuristics which h1 have an estimate 40 and h2 has an estimate 30. Which one of the two admissible heuristic would you choose to use in your algorithm for a better solution? Explain the reason in two sentences (answer with no explanation will not get any point) (10 points)

Submission Instructions:
1-MAKE SURE TO FILL THE FIRST PAGE OF THIS FILE.
Submission without the name, id, and acceptance of statement (you can put your name) in the first page will not be accepted
3- It is your responsibility to read the questions carefully. Any solution that is not matching with the questions will not be graded. Example, if question tells you to explain the answer in 2 sentences and you write a long explanation only the 2 sentences will be taken as an answer.
4- Your answer will be checked for plagiarism. Any plagiarism among you or another resources will cause you to get zero from the exam.
5- Questions are explained in details therefore no questions will be accepted about the exam.
6- You need to submit this exam electronically through the reserved place in Moodle
studentno_name_surname_comp415_midterm.docx

### Calculate a fair price for your paper

Such a cheap price for your free time and healthy sleep

1650 words
-
Place an order within a couple of minutes.
Get guaranteed assistance and 100% confidentiality.
Total price: \$78
We offer 