Final v1 - ai exam PDF

Title Final v1 - ai exam
Author Doctor Pineapple
Course Artificial Intelligence
Institution Georgia Institute of Technology
Pages 59
File Size 2.5 MB
File Type PDF
Total Downloads 35
Total Views 165

Summary

ai exam...


Description

CS6601 Final – Spring 2020 Please read the following instructions thoroughly. Fill out this PDF form and submit it on G  radescope. Remember to also submit on Canvas for backup purposes. You have unlimited resubmissions until the deadline. You can: (a) type directly into the form – we highly recommend using Adobe Reader DC (or Master PDF on Linux). Other programs may not save your answers, so please keep a backup; or (b) print, hand-write & scan. You can combine the methods as well. Submit only a single PDF – no phone pictures, please! (You may use an app like CamScanner or Office Lens if you do not have scanner access.) Do not add pages unless absolutely necessary; if you do, please add them at the end of the exam only, and clearly label both the extra page and the original question page. Submit ALL  pages of the exam, not only the completed ones. Do not forget to fill the checklist at the end before turning in the exam. The exam may not be graded if it is left blank. The exam is open-book, open-note, open video lectures, with no time limit aside from the open period. No internet use is allowed, except for e-text versions of the textbook, this semester's CS6601 course materials, Piazza, and any links provided in the PDF itself. No resources outside this semester’s 6601 class should be used. Do not discuss the exam on Piazza, Slack, or any other form of communication. If there is a question for the teaching staff, please make it private on Piazza and tag it as Final Exam with the question number in the subject line (for example, a question on Search would be “Final Exam #2”). Please round all your final answers to 6 decimal places and do not round intermediate results. You can use the round(your_number,6)   function in Python for help. You will not receive full credit if your answers are not given to the specified precision.

Point breakdown (Each question has sub-parts with varying points):

Pts

Q1

Q2

Q3

Q4

Q5

Q6

Q7

Q8

Q9

Q10

Total

7

7

10

10

12

10

12

8

12

12

100

1. Game Playing - Giant Probabilistic TicTacToe (7 points) This is a version of TicTacToe that incorporates randomness. The first main difference from regular TicTacToe is that the board is 4x4 instead of 3x3. The rules to win are the same as regular TicTacToe (i.e.), you need 3 consecutive markers vertically, horizontally or diagonally to win. The other main difference is that on your turn, the marker being placed may not end up where it was intended to be placed. The marker has a probability of being placed in the intended location with a probability of 0.8. It may end up in any of the 4 squares adjacent to the intended location with a probability of 0.05 each. The probability of the final marker location is: ● Intended position with probability 0.8 ● Left of intended position with probability 0.05 ● Below intended position with probability 0.05 ● Right of intended position with probability 0.05 ● Above intended position with probability 0.05 In addition, if your intended position is adjacent to any blocked positions of the board, the probability of those blocked positions gets added to the probability of the given position. Here, a blocked position could be a position that’s already occupied, or a position that is off the board. A couple of examples are given below: In the following empty board, if the intended position is D2, a marker can’t be placed below D2 because D2 is at the edge of the board. So the 0.05 that was intended for the below cell is now assigned to D2, and so the probability of the marker being placed at D2 becomes 0.85. The distribution of probabilities would be as shown below: 1

2

3

A B C D

0.05 0.05

0.85

0.05

Page 2 out of 59

4

In the following empty board, if the intended position is A4, the distribution of probabilities would be as shown: 1

2

A

3

4

0.05

0.9

B

0.05

C D

In the following partially filled board, if the intended position is B3, the distribution of probabilities would be as shown: 1 A

X

B C

2

3

4

0.05 O

O

0.95

O

X

D

In the following partially filled board, if the intended position is B1, marker would go to the intended position with a probability of 1: 1 A

X

B

1

C

O

2

3

O

4

O X

D

Page 3 out of 59

Question A: Evaluating the Board In this part, we will evaluate different moves, using different evaluation metrics. The first metric we will use is the number of similar markers neighboring the position in question. For example, if it is X’s turn to place a marker, a cell’s score is the number of X’s in the 8 cells that are neighbors to the cell in consideration. (A cell’s neighbors include cells that are adjacent vertically, horizontally and diagonally). For example, in the given partially filled board, the scores of some of the scores have been filled, given it’s X’s turn and that X is the maximizing player. 1

2

3

A

X

B

1

O

1

C

O

2

X

D

4

0

X

Page 4 out of 59

O

Q1.A.1 Given the following board state, answer the following questions given that it is O’s turn and that O is the maximizing player: 1 A

2

3

X

O

B

O

C D

4

X

O

X

Q1.A.1.a. What is the score of cell B2? (0.25 points) ___________________________________________________________ Q1.A.1.b. What is the score of cell B4? (0.25  points) ___________________________________________________________ Q1.A.1.c. What is the score of cell C3? (0.25 points) ___________________________________________________________ Q1.A.1.d. According to this metric, which is the best cell to place an O? (0.25 points) ___________________________________________________________ Do you think this evaluation metric is the most suitable? As you may have guessed, it probably isn’t the best, because it doesn’t consider opponent markers. It seems that placing a marker at B2 is the better option, as it not only blocks X from possibly winning in their next turn, but also opens the possibility of O winning in their next turn. So let us try a metric that considers the opponent markers as well. The next evaluation metric we consider is the total number of neighboring markers.

Page 5 out of 59

Q1.A.2 Apply this new evaluation metric to the same board and, answer the following questions given that it is O’s turn and that O is the maximizing player 1 A

2

3

X

O

B

O

C D

4

X

O

X

Q1.A.2.a. What is the score of cell B2? (0.25 points) ___________________________________________________________ Q1.A.2.b. What is the score of cell B4? (0.25  points) ___________________________________________________________ Q1.A.2.c. What is the score of cell C3? (0.25 points) ___________________________________________________________ Q1.A.2.d. According to this metric, which is the best cell to place an O? (0.25 points) ___________________________________________________________ Clearly, this metric is a little better than the previous one. Still, is it the best? You must’ve noticed that placing an O at C3 would likely cause O to win, and yet this is not captured in either evaluation metric as above. So to further improve the evaluation metric, we can use something like this: ● If a cell causes immediate victory, assign it a massive score (say 10) which is greater than the largest possible score from the first two metrics ● If there is a position which could lead to opponent victory in the next move, blocking that move should be the next highest priority. Assign it a value (say 9) that is greater than the largest possible score from the first two metrics, but lesser than the score assigned to a possible immediate victory ● Else, score is equal to the number of neighboring markers, i.e., the second evaluation function.

Page 6 out of 59

Q1.A.3 Apply this new evaluation metric to the same board and, answer the following questions given that it is O’s turn and that O is the maximizing player: 1 A

2

3

X

O

B

O

C D

4

X

O

X

Q1.A.3.a. What is the score of cell B2? (0.25 points) ___________________________________________________________ Q1.A.3.b. What is the score of cell B4? (0.25  points) ___________________________________________________________ Q1.A.3.c. What is the score of cell C3? (0.25 points) ___________________________________________________________ Q1.A.3.d. According to this metric, which is the best cell to place an O? (0.25 points) ___________________________________________________________

Hopefully, this has helped you understand better how to construct a suitable evaluation function for the given game. If you look into it more deeply, you will notice that the above evaluation function has some flaws, and would fail to produce the best move in some cases, especially when the game is close to its end. For those who are further interested, there are other things you can consider to build up an evaluation function for this game: ● Different weights for player and opponent’s markers while counting neighbors ● Weighting edge and corner cells differently from other cells ● Considering the cases where the intended position may not be reached because of the probabilistic nature of the game

Page 7 out of 59

Question B: Expectimax Expectimax is a version of the Minimax algorithm that takes into account probabilistic events. Consider the following board. Assume that it is O’s turn to place a marker, and that O is the maximizing player. 1

2

3

4

A

O

X

X

O

B

X

X

O

X

C D

O O

X

X

O

The three possible moves for O are cells C1, C2, and C4. Obviously, the marker may not end up in the intended position. All this has been captured in the expectimax tree given below. The intended cell is given next to the probability circles, and the actual cell taken is given next to the triangles.

Page 8 out of 59

Q1.B.1. Please fill in the tree (without pruning). Make sure to use inequality signs wherever necessary. Answer the following questions: Q1.B.1.a What is the value of the root node? (0.5 points) ___________________________________________________________ Q1.B.1.b Which move does O select based on this tree? (0.5 points) ___________________________________________________________

Page 9 out of 59

Q1.B.2 Please fill in the tree (with pruning). Make sure to use inequality signs wherever necessary. Answer the following questions: Q1.B.2.a What is the value of the root node? (0.25 points) ___________________________________________________________

Q1.B.2.b Which move does O select based on this tree? (0.25 points) ___________________________________________________________

Q1.B.2.c How many leaf nodes are pruned? (0.5 points) ___________________________________________________________

Page 10 out of 59

Question C: General Game Playing Q1.C.1 Which of these change automatically when you go from regular minimax to minimax with Alphabeta Pruning? (Select all that apply) (1 point) The move selected by agent The value of the root node The number of computations performed to determine the best move The evaluation function The number of nodes explored during the search Q1.C.2 Which of the following are true about Iterative Deepening, in the context of game playing? (Select all that apply) (1 point) It is a DFS technique It gives the same value for root node irrespective of the depth currently being searched It is used in cases where the time allotted to select a move is limited If a timeout occurs, you return the best move from the current level being searched, even if the current level is not fully searched It makes use of the fact that better moves are predicted if you increase the search depth After all that you have learnt through this question, maybe you can build an unbeatable AI agent for Giant Probabilistic TicTacToe!

Page 11 out of 59

2. Search (7 points) Maks is an undergraduate student at Georgia Tech and is getting close to finishing his coursework and graduating. To better prepare for the future, Maks decides to do some career planning. There are many job options he could explore for his career, so he creates a graph of the job options in which he starts at node G = Georgia Tech and his final goal is to reach node R = Retire, with a bunch of options in between. The job options in the graph are connected by edges that represent the “cost of transition” between these job options. You could think of the “cost of transition” between two job options as the opportunity cost for Maks to transfer from one job to another (don't think too hard about what this means). Below is the career graph that Maks has made, where W = Wall Street | A = Graduate School | P = Professor | L = Lecturer | D = Civil Servant | E = Engineer | T = Entrepreneur | F = Freelancer | B = Writer | J = Journalist.

Figure 1. Career graph Note: In all search problems asked below, please use alphabetical order to break ties when deciding the priority to use for extending nodes.

Page 12 out of 59

Q2.1.a. Assume Maks wants to retire after doing the least number of different jobs. Of all the basic search algorithms listed below, which one is guaranteed to find the path with the minimum nodes (Note: we want you to find the shortest path with the number of nodes as the length of the path) from G to R when it reaches the goal node for the first time? (1 point) Depth first search Breadth first search Uniform cost search

Q2.1.b. Now Maks is interested in finding a path which has the least “cost of transition”. Which search algorithm should Maks apply to the graph in order to find the path? (1 point). Depth first search Breadth first search Uniform cost search

Q2.1.c. What is the least “cost of transition” path using the search algorithm you chose above? Please enter your answer as a comma-separated list using the node labels in the graph (e.g., the answer format should like: G, T, R) (2 points). ____________________________________________________________________

As a new undergraduate student, Maks was not very confident about his own judgement for the career graph he plotted. Therefore, he went to talk to one of the career advisors in the Center for Career Discovery & Development at Georgia Tech. The career advisor gave Maks an additional cost --- heuristic node-to-goal costs for each job option, which represent the preconceptions about the “potential cost” (Note: we assume “potential cost” has the same unit with “cost of transition” in the career graph) he has to work until he retires.

Page 13 out of 59

For example, Maks thinks it will take 350 “potential costs” to go from G (Georgia Tech) to retirement (R), 285 “potential costs” from Grad School (A), but only 120 “potential costs” from Entrepreneur (T). The heuristic node-to-goal costs table is listed below. Job options

Heuristic node-to-goal costs

G

350

W

150

F

400

D

320

A

285

T

120

E

35

J

330

B

390

L

400

P

310

R

0

Using the node-to-goal cost in the above table as a heuristic, the cost of a node in the below questions is: f(x) = g (x) + h(x) Q2.2.a. How many nodes were explored (including the start and end nodes) from G to R using A* search? Note: A node is considered as explored if this node is popped out from the frontier and added to the explored set. (2 points) ______________________________________________________________________ Q2.2.b. The heuristic function, h(n), in the A* algorithm is: (1 points) Cost of the cheapest path from current node to goal Estimated cost of cheapest path from current node to goal Average cost of all paths from current node to goal

Page 14 out of 59

3. Optimization Algorithms (10 points) The data used for answering the questions in this section is attached as a spreadsheet at the end of this question on page 22. For the sake of convenience, this spreadsheet is also provided to you as a Google Sheet that you can download and utilize on your local machine: https://docs.google.com/spreadsheets/d/1bUCva8a7n3MKf-SC4OlUT5rfsRIvanp8wsKQnxyomPM/edit?usp=sharing

Background A standard optimization problem is defined by two elements: an objective function and constraints. The objective function is typically the function that you want to explore, whether you want to find its minimum or maximum. The constraints specify the range of the domain of your search, as most searches don’t extend into an infinite domain. If you have an optimization problem and can formulate a clear objective function and constraints, you’re in a position to apply a wide range of optimization methods to find your answer such as genetic algorithms, simulated annealing, stochastic beam search, or gradient descent. One example of a standard formulation of an optimization problem is:

For some formulations of an objective function, we can apply methods to guarantee a globally optimum result, such as Convex Optimization. However, it is often the case that the objective function is unknown or can’t be modeled in a way where we can apply these guaranteed methods, and we must turn to other approaches. Gradient Descent is an intuitive and effective method used to explore an objective function over a certain domain that can be visualized as dropping a ping-pong ball on a curved surface. Depending on its initial position, the ball will follow the force of gravity and roll downhill until it rests at a local minimum, where it can’t go downhill by moving in any immediate direction. In this toy example, we could consider the distance from the ball to the ground as our objective function that we want to minimize. We can abstract this process into the following algorithm: 1. Choose an initial point to start your search 2. Calculate the gradient of your objective function at your current position. 3. If you determine you have reached a local minimum, stop your search. Else, move according to the gradient and repeat step 2.

Page 15 out of 59

You may notice that we need to define how we move in this algorithm. If your domain is enormous, it may be necessary to quickly traverse the space by moving in large steps at a time. If you want to carefully explore a small domain, however, you probably want to take smaller steps in each iterati...


Similar Free PDFs