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

 

Final Term Examination Spring-2020


Subject Artificial Intelligence EDP / Section Code 32001205
32001304
32001307
32001333
Facilitator Dr. Aarij Mahmood Hussaan Max. Marks 40
Exam Date 08-06-2020 Start Time 12:00 AM
Submission Deadline 11-06-2020 End Time 09:00 PM
 
INSTRUCTIONS: 
 This exam is “openbook,” which means you are permitted to use any materials handed out
in class, your own notes from the course, the text book, and anything on the your VLE
 The exam must be taken completely alone. Showing it or discussing it with anyone is
forbidden.
 You may not consult with any other person regarding the exam. You may not check your
exam answers with any person. You may not discuss any of the materials or concepts in
this class with any other person.
 No discussion of the exam or anything about the exam is allowed.
 The answers must be typed and returned in a word file, no screenshots, images will be
accepted

Question 1) Search 10 marks


Consider a grid with ‘n’ rows and ‘m’ columns. The agent will start at a particular cell and its job
will be to move to a goal cell. The agent will have the following actions available to it:

I. Move up, the cost of this actions is +2


II. Move down, the cost of this action is -1
III. Move Right, the cost of this action is +1.5
IV. Move Left, the cost of this action is -0.5

The agent wants to find a path between the starting cell and the goal cell in as low of a cost as
possible. However, the grid has special cells marked as ‘W’ and ‘X’, if your agent moves to the
‘W’ cell, then the agent will be teleported a cell (randomly selected) next to the goal state, but
the cost will be ‘+7’. If your agent moves to the ‘X’ cell then your agent will be teleported to the
starting cell, however, the cost will be ‘-7’.

For example, take a look at a 7 x 8 grid below:


L

W
L G

W
A

Here the agent is at the position (0,0), and the goal is at the position (3,7). If the agent moves to
the ‘W’ cell at (4,2), then the agent will be transported to either (3,6) or (2,7) or (4,7).

Given the scenario above, answer the following questions:

I. What is the PEAS description of the agent?


II. Describe its task environment.
III. Model this problem as a search problem
IV. What is the branching factor of this problem?
V. Can we use BFS or DFS on this problem? Explain your answer.
VI. Given the scenario above, write down the path that will be discovered by UCS?
VII. If we can run BFS on this problem, will BFS and UCS give the same answer? Explain
VIII. Will Euclidean distance be an admissible heuristic? Will Manhattan distance be an
admissible heuristic? Prove your answer.
IX. Come up with your own admissible heuristic, and solve the problem above using your
heuristic and A* search.

Question 2) Constraint Satisfaction Problem 10 marks


Consider this variant of Sudoku

The objective is to fill the grid with numbers from 1 to 9 in a way that the following conditions
are met:

 Each row, column, and nonet contains each number exactly once.
 The sum of all numbers in a cage must match the small number printed in its corner.
 No number appears more than once in a cage. (This is the standard rule for killer
sudokus, and implies that no cage can include more than 9 cells.)

In 'Killer X', an additional rule is that each of the long diagonals contains each number once. 1

 
1
 https://en.wikipedia.org/wiki/Killer_sudoku 
More about this type of Sudoku can be found over here
https://en.wikipedia.org/wiki/Killer_sudoku. Do not worry you are not going to be asked to solve
the puzzle here. However, you are required to answer the following questions:

I. Model this problem as a CSP problem


II. What could be the time complexity of this problem if we solve this problem using DFS?
III. Apply vanilla backtracking on this problem for at-least 10 iterations
IV. Apply backtracking with Forward Checking for 5 iterations, show the variables whose
domains will be reduced if you follow the Most Constraining Variable heuristic.
V. Apply arc-consistency and show the resulting domain of variables
VI. What will be the complete-state formulation of this problem?
VII. Apply Simulated Annealing for 6 iterations on this problem. Show the domain values of
the effected variables only. Also show the value of the temperature variable at every
iteration, along with the generated random number and the choice of selecting the worst
state or not.

Question 3) MDP and RL 10 marks


The Cliff Walking environment is a gridworld with a discrete state space and discrete action space. The 
agent starts at grid cell S. The agent can move to the four neighboring cells by taking actions Up, Down, 
Left  or  Right.  The  Up  and  Down  actions  are  deterministic,  whereas,  the  Left  and  Right  actions  are 
stochastic, with a probability of 0.7 to be completed and a probability of 0.3 of the agent ending up in the 
perpendicular direction. Trying to move out of the boundary results in staying in the same location. So, 
for example, trying to move left when at a cell on the leftmost column results in no movement at all and 
the agent remains in the same location. The agent receives ‐1 reward per step in most states, and    ‐100 
reward when falling off of the cliff. This is an episodic task; termination occurs when the agent reaches 
the goal grid cell G. Falling off of the cliff results in resetting to the start state, without termination. 
 

         
         
         
S  The Cliff  G 
 

For the problem described above, answer the following question: 

I. Formulate the problem as a MDP 
II. Use policy iteration to find the optimal policy 
III. Suppose that you are not given the transition or the reward function, suppose that you observe 
the following (state, action, reward, state’) tuples, in episode 1 
Episode 1: 
( (0,0), Up, ‐1, (1,0) ) 
( (0,1), Down, ‐1, (0,0) ) 
( (0,0), Right, ‐1, (0,0) ) 
( (0,0), Left, ‐1, (0,0) ) 
( (0,0), Up, ‐1, (1,0) ) 
( (0,1), Right, ‐1, (1,1) ) 
( (1,1), Right, ‐1, (1,2) ) 
( (1,2), Right, ‐1, (1,3) ) 
( (1,3), Right, ‐1, (1,4) ) 
( (1,4), Down, ‐1, (0,4) ) 
 
Calculate the TD estimates of all the states in Episode 1 
IV. Use the MDP code given to you in your LAB and implement this scenario. 

Question 4) Games 10 marks


Consider the game of LUDO https://en.wikipedia.org/wiki/Ludo_(board_game). For LUDO answer the 
following questions: 

I. Model the LUDO game as an adversarial search problem 
II. Would you use minimax or expectimax search to solve LUDO? Explain your reasoning 
III. What will be the complexity of adversarial search for LUDO? 
IV. Draw the search graph of expectimax search for a turn for each player, assuming there are four 
players. One is controlled by you. 
V. Will it be feasible to do a vanilla search for solving LUDO? Why or why not? 
VI. Will you design an optimistic agent or a pessimistic agent for LUDO? explain your reasoning 
VII. How would you speed up the decision‐making process of your algorithm? Explain the 
improvements you would make and why they will be helpful 

You might also like