Docsity

Artificial Intelligence Midterm Exam - Fall 2022, Exams of Advanced Education

Toggle sidebar
bg1
CS 6601 Artificial Intelligence
Fall Semester 2022
Midterm Examination Paper
Duration of Exam: 10 Oct 2022, 8:00 AM (EDT) - 17 Oct 2022, 8:00 AM (EDT)
Weight: 15% No. pages: 35 No. Questions: 6Total marks: 103
Instructions:
•Before solving the exam, you should read the Ed post titled "Midterm Exam Next Week".
•You should fill out this PDF and submit it on BOTH Gradescope and Canvas. We reserve the right
to deduct points if you don’t submit on both platforms.
•You have an unlimited number of submissions until the deadline. You can either type directly into the
PDF or you can print, hand-write, and scan your solutions. If you decide to type into the PDF, we
strongly recommend using Adobe Acrobat Reader DC. If you are on MacOS, please do not use
Preview, as we have seen major issues with it in the past. Other programs may not save your answers.
Thus, always make sure to keep a backup of your answers.
•You should submit only a single PDF. Also, make sure your typed answers appear clearly in the
Gradescope Preview. After each question, a blank page is provided if you wish to highlight some
of your calculations. However, you should not expect any points to be awarded for your calculations
(only your final answers will be considered). The TAs reserve the right to assign partial credits based
on your calculations. Make sure to submit ALL the pages of the exam, not only the completed ones.
•You must fill out the checklist at the end of the exam. The exam may not be graded if it is left blank.
•The exam is open-book, open-note, and open video lectures, with no time limit aside from the duration
of the exam. No internet use is allowed, except for e-text versions of the textbook, this semester’s
CS6601 course materials, Ed, 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 Ed, Slack, or any other platform. In
particular, do not post publicly about the exam. If there is a question for the teaching staff, please make
it private on Ed and tag it as Midterm Exam with the question number in the subject line (for example, a
question on Search would be “Midterm Exam #2”). Please make different posts for different questions.
•Please round all your final answers to 6 decimal places. Don’t round intermediate results. You can
use round(answer, 6) function in Python for help. You may not receive full credit if your answers are
not given to the specified precision.
•Points breakdown is provided below.
Question No. 1 2 3 4 5 6 7
Points 12 20 20 12 18 18 3
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23

Partial preview of the text

Download Artificial Intelligence Midterm Exam - Fall 2022 and more Exams Advanced Education in PDF only on Docsity!

CS 6601 Artificial Intelligence

Fall Semester 2022

Midterm Examination Paper

Duration of Exam: 10 Oct 2022, 8:00 AM (EDT) - 17 Oct 2022, 8:00 AM (EDT)

Weight: 15%^ No. pages: 35 No. Questions: 6 Total marks: 103

Instructions:

  • Before solving the exam, you should read the Ed post titled "Midterm Exam Next Week".
  • You should fill out this PDF and submit it on BOTH Gradescope and Canvas. We reserve the right to deduct points if you don’t submit on both platforms.
  • You have an unlimited number of submissions until the deadline. You can either type directly into the PDF or you can print, hand-write, and scan your solutions. If you decide to type into the PDF, we strongly recommend using Adobe Acrobat Reader DC. If you are on MacOS, please do not use Preview, as we have seen major issues with it in the past. Other programs may not save your answers. Thus, always make sure to keep a backup of your answers.
  • You should submit only a single PDF. Also, make sure your typed answers appear clearly in the Gradescope Preview. After each question, a blank page is provided if you wish to highlight some of your calculations. However, you should not expect any points to be awarded for your calculations (only your final answers will be considered). The TAs reserve the right to assign partial credits based on your calculations. Make sure to submit ALL the pages of the exam, not only the completed ones.
  • You must fill out the checklist at the end of the exam. The exam may not be graded if it is left blank.
  • The exam is open-book, open-note, and open video lectures, with no time limit aside from the duration of the exam. No internet use is allowed, except for e-text versions of the textbook, this semester’s CS6601 course materials, Ed, 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 Ed, Slack, or any other platform. In particular, do not post publicly about the exam. If there is a question for the teaching staff, please make it private on Ed and tag it as Midterm Exam with the question number in the subject line (for example, a question on Search would be “Midterm Exam #2”). Please make different posts for different questions.
  • Please round all your final answers to 6 decimal places. Don’t round intermediate results. You can use round(answer, 6) function in Python for help. You may not receive full credit if your answers are not given to the specified precision.
  • Points breakdown is provided below.

Question No. 1 2 3 4 5 6 7

Points 12 20 20 12 18 18 3

Problem 1: Game Playing [12 points] For this question we will look at a variant of Isolation, which takes place on a 3x3 board. Player 1 controls piece ‘X’, while player 2 controls piece ‘O’. Squares which are no longer visited are grayed out. Both players have a single piece, and this piece can move to adjacent squares, but cannot move diagonally. For example, on player 1’s turn, with the board shown below in Figure 1, they have 4 valid moves:

Figure 1: Board Diagram

On the first turn, player 1 can place their piece in multiple locations. For this question, we will only look at the subtree where player 1 places their piece in the middle of the board. Because the rules for this variant of Isolation exhibit reflectional and rotational symmetry, we can greatly simplify the tree by removing duplicates:

Figure 2: The Game Tree

Figure 4: Game Tree to a Depth of 6

For the next questions, you may use the trees shown in Figures 5, 6, 7, 8, 9 for computations.

Let’s say player 1 and player 2 use different algorithms to decide their moves. Player 1 uses the depth- limited (to depth 6) minimax search to pick their moves, while player 2 has the luxury of an infinite depth search (the search from the first part of this problem). Player 2 also knows that player 1 will only search the board to a depth of 6, and uses this knowledge in their minimax algorithm.

(d) (2 points) Given this first move, and assuming that both players strictly follow their algorithms, does player 2 win the game?

Yes No

(e) (4 points) Apply alpha-beta pruning to player 2’s searches (traversing branches from left to right). How many leaves are pruned? (Hint: you will have to repeat player 1’s depth-limited searches as they proceed deeper into the game)

Type Your Answer Here:

Figure 5: Game Tree

Figure 6: Game Tree

Figure 9: Game Tree

You can add your notes on this page (if any)

Figure 10: Robot with 3DOF

The following (Figure 11) is a relaxed grid representation that shows the parts on the conveyor and the goal location. Assume that you have programmed the robot to lift, lower, grasp and release the parts. This allows you to write a program that can ignore the robot movement which will discretize the search space and avoid solving for continuous movement. Although you are concerned over producing efficient algorithms, and must optimize your steps, there must be a way to limit the complexity. You’ve decided to limit the ability of the robot to move according to a compass directions of N, NE, E, SE, S, SW, W, and NW. Based on that, answer the following question:

Figure 11: Grid of the Conveyor

(f) (2 points) What is the branching factor for this space?

Type Your Answer Here:

That seems like a challenge, but you consider what you have learned in AI@GT, and decide you should be able to limit this to the expected branching factor you should consider.

(g) (2 points) What number of states would you expect to consider at depth k, given the rules below?

Type Your Answer Here:

The rules of the assembly are as follows: The parts must be moved one at a time toward their prescribed goal position aligning the parts for assembly. Only one part can occupy a cell, and your robot can sense what cell a part is in. Your robot can perform the following actions:

  1. Ready (positions the robot at i0) no cost (a) Only available for step 0, result returns i
  2. Move (direction, # of cells) (Result returns current cell) (a) Moving N, S, W, E has a cost of 1 per cell moved. (b) Diagonal movement (i.e. NW, NE, SW, SE) has a cost of 1 per cell moved.

Answer the following questions given the problem formulation:

(h) (1 point) For memory space optimality which type of search would you use?

Tree Search Graph Search

(i) (1 point) What is the state space assuming each part originates in its cell as shown in the grid above?

Type Your Answer Here:

(j) (1 point) What is the state space assuming each part originates randomly in the grid?

Type Your Answer Here:

(k) (1 point) What are the admissible heuristics for this problem? (multiple-option correct MCQ)

Manhattan Distanceq ((x 2 − x 2 )^2 + (y 2 − y 2 )^2 ) Max(steps horizontally, vertically or diagonally) Number of misplaced parts |Part distance to current robot discrete position|+|Part distance to goal|

(l) (1 point) What would be the most effective strategy to transform the search to solve for optimal sequence and path concurrently? (multiple-option correct MCQ)

Use a priority queue that kept paths and costs from init to end-goals Add a final goal to the end of the search Set all of the g-values to infinity Add linking nodes between the end-goals and initial locations

You can add your notes on this page (if any)

Problem 3: Optimization Algorithms [20 points] We have introduced hill climbing in the lectures. Note that hill climbing is an analogy for optimizing a general function, that is, to find its minima and maxima. Let’s investigate a concrete algorithm, and its useful variants. First we introduce our general problem formulation. For x ∈ X, where X can be some arbitrary set, define f (x) : X → R a function takes elements from X and produces a real number so that f (x) ∈ R. Our goal is to find a minimum solution f (x∗) over the entire set X. Assume the derivative of f at any point x exists and denoted f ′(x). Recall that we learned hill climbing is essentially performing the following Gradient Descent iterations: xk+ 1 = xk − ηk f ′(xk), where xk is the current estimate of the optimal solu- tion, and xk+ 1 is the next estimate. ηk is the step size, which is a real number. Notice that in general, if X is n-dimensional, i.e., X ⊆ Rn, then we define the gradient of the function f at x to be: ∇ f (x) = [ ∂ f ∂x 1

∂ f ∂x 2

∂ f ∂xn

]T^.

As iterations progress, with proper step size, f (xk) would decrease. Hence the name Gradient Descent.

Part 1: Gradient Descent (GD) Now generally attributed its invention to Cauchy and Hadamard in the 1800s, gradient descent has been one of the most influential and useful methods in modern mathematical computation. In the era of machine learning, gradient descent has been one of the driving forces behind computational models, including but not restricted to deep neural networks, support vector machines, and maximum likelihood estimation. In this subsection, we first look at two examples of gradient descent, followed by some conceptual questions.

(a) (1 point) Let f (x) = 2 x^2 − 4 x + 5, f : R → R. Suppose xk = 3, and we set constant step size ηk =

, ∀k = 1 , 2 , 3 , ... What is the value of xk+ 1?

(b) (1 point) True or False: for an arbitrary function that does not go to negative infinity, you can always find a global optimal solution by applying gradient descent one time with proper step sizes.

True False

(c) (1 point) True or False: for an arbitrary function that does not go to negative infinity, you can always find a local optimal solution by applying gradient descent with proper step sizes (without restart).

True False

It is known that if Gradient Descent converges, it would converge in sub-linear speed for arbitrary func- tions, that is: f (xk) − f (x∗) ≤

C

k , ∀k = 1 , 2 , 3 , ... where C is a problem dependent constant. It takes more effort to improve precision in later iterations (notice that the ratio k/(k + 1) approaches 1 as k grows). We wish to improve this dreadful result, which follows two variants of Gradient Descent.

(i) (3 points) Let f (x) = 2 x^2 − 4 x + 5, f : R → R. Suppose that x 1 = 3, xk− 1 = 4 and we set constant step size αk = 1 / 4 , ∀k = 1 , 2 , 3 , ... and βk = 1 /3. What is the value of xk+ 1?

Type Your Answer Here:

In his seminal work, Nestrov proposed the Accelerated Gradient Descent (AGD) method, which uses the following update: yk = xk + βk(xk − xk− 1 ) xk+ 1 = yk − αk∇ f (yk) In general, both Polayk’s Heavy Ball method and Nestrov’s Accelerated Gradient Descent method will be faster than vanilla gradient descent, i.e., they require fewer iterations to reach the same level of pre- cision to the optimal solution. Such results would be reflected on convergence speed, often pushing the convergence rate to linear, that is, one requires as many iterations to reach the next digit precision as in pushing previous digit precisions. For example, if we need 3 iterations to drive f (xk − fx∗^ ) ≤ 10 −^1 to 10 −^2 , then we only need roughly three iterations to push from 10−^6 to 10−^7 when using an optimization method with linear convergence speed. This is a significant improvement from a sub-linear rate (hence the name “sub”-linear). Using the Nestrov’s AGD method defined above, solve the following question. Consider the same problem in R^2 min x∈R^2

f (x) = xT^ Ax − bT^ x

where the matrix A = [a 1 a 2 ] ∈ R^2 x^2 , having the first column a 1 = [1 3]T^ , and the second column a 2 = [2 2]T^. Let b = [3 5]T^. Suppose αk = 1 /5, βk = 1 /4, and xk = [2 3]T^ , xk− 1 = [1 0]T^.

(j) (1 point) Compute f (xk)

Type Your Answer Here:

(k) (2 points) What is the value of xk+ 1? Say xk+ 1 = [a b]T^ , then fill up the following blanks:

a:

b:

(l) (2 points) Compute f (xk+ 1 )

Type Your Answer Here:

Hint: To compute the gradient of xT^ Ax − bT^ x, notice that this is a quadratic function plus a linear function. Results follow similar differentiation rules in R, for example, ∇(x^2 + tx) = 2 x + t.

You can add your notes on this page (if any)

There are a few constraints of the ship to consider.

  1. Whoever works in the cannons and in the laser guns need to be great shooters
  2. Whoever works in the navigation needs to have very good reflexes in order to avoid all of the attacks
  3. Whoever is in charge of fixing the ship needs to know how to properly operate the Teletraan II, which is the computer which will help fix different parts of the ship.
  4. The following pairing constraints need to be addressed for easy communication, since they sit next to each other. (a) The bots who take care of the cannons and the laser guns need to be good buddies (b) The bots who take care of the shields and the energon battery cells need to be good buddies (c) The bots who take care of the navigation and the thrusters need to be good buddies

Additionally, the Ploetzobots needed to attend the bot academy before becoming soldiers. For this, they needed to study well or improve their skills well. Next we will cover the Ploetzobots during their time in their academy:

  1. Bumblebee has great reflexes, but it was never good at shooting nor was it good at understanding the technical side of their central computer, the Teletraan II. It was great friends with Jazz, Buckhead, and Arcee.
  2. Wheeljack didn’t have great reflexes, but he was a great shooter and pretty much invented the Teletraan II. But it didn’t really interact with many of his peers, so it was pretty much a great partner with Ratchet and Arcee.
  3. Ratchet was the medic, so it spent a lot of time understanding how to repair its peers using the Teletraan II. Since it was the medic, it took an oath to not engage in battle, so it refuses to use any of the shooters (i.e. cannons or laser guns) and it didn’t have very good reflexes. It was really nice friends with Arcee, Wheeljack, and Jazz, but found Bumblebee’s immaturity hard to deal with, and Blurr spoke too fast for him to understand.
  4. Blurr is a speedster, so he has amazing reflexes. Because of that, it was also a great shooter, but it didn’t really enjoy studying the Teletraan II, so it pretty much doesn’t know much about it. Because it speaks very quickly, not many people could understand him, so pretty much only Arcee learned to work well with him.
  5. Arcee is friendly bot. It worked well with everyone; literally anyone and everyone. Above that, it was top of its class in shooting, although it reflexes weren’t great, and its knowledge in the Teletraan II wasn’t great either.
  6. Jazz was a slick fellow. It was great at shooting, with very good reflexes, but it wasn’t great at operating the Teletraan II. It was a great friend of Bumblebee, Arcee, and Ratchet.
  7. Finally, Buckhead was a very big and friendly fellow, but rather timid. It was great friends with Bumblebee and Arcee. Although he didn’t have the capabilities of having good reflexes or knowl- edge of the Teletraan II, he was an amazing fighter and great shooter.

The information about friendships and skills can also be found in the tables shown in Figure 15.

Figure 15: Friendship and Skill Tables

(a) (0.5 points) Given the listed constraints and the characteristics of each of the Ploetzobots, is it possible to find a solution that satisfies all of the constraints?

Yes No

(b) (3.5 points) If yes, what are the possible bots that can seat in each of the listed roles, listed in alphabetical order and separated by a comma and a space (e.g. Arcee, Bumblebee, Jazz)? If not, leave the fields blank

Cannon:

Laser Gun:

Fixing:

Shield:

Energon: