CS 188 Introduction to Artificial Intelligence hw1
人工智能作业代写 Q1 Search Trees 4 Points How many nodes are in the complete search tree for the given state space graph? The start state is S.
Q1 Search Trees
4 Points
How many nodes are in the complete search tree for the given state space graph? The start state is S. You may find it helpful to draw out the search tree on a piece of paper.
人工智能作业代写
Q2 Depth-First Graph Search
4 Points
Consider a depth-first graph search on the graph below, where S is the start and G is the goal state. Assume that ties are broken alphabetically (so a partial plan S->X->A would be expanded before S->X->B and S->A->Z would be expanded before S->B->A). You may find it helpful to execute the search on scratch paper.
Please enter the final path returned by depth-first graph search in the box below. Your answer should be a string with S as your first character and G as your last character. Don’t include arrows or spaces in your submission. For example, if you believe the path is S->X->G, please enter SXG in the box.
Consider a breadth-first graph search on the graph below, where S is the start and G is the goal state. Assume that ties are broken alphabetically (so a partial plan S->X->A would be expanded before S->X->B and S->A->Z would be expanded before S->B->A). You may find it helpful to execute the search on scratch paper.
Please enter the final path returned by breadth-first graph search in the box below. Your answer should be a string with S as your first character and G as your last character. Don’t include arrows or spaces in your submission.
For example, if you believe the path is S->X->G, please enter SXG in the box.
人工智能作业代写
Q4 A* Graph Search
4 Points
Consider A* graph search on the graph below. Arcs are labeled with action costs and states are labeled with heuristic values. Assume that ties are broken alphabetically (so a partial plan S->X->A would be expanded before S->X->B and S->A->Z would be expanded before S->B->A.
Q4.1
2 Points
In what order are states expanded by A* graph search? You may find it helpful to execute the search on scratch paper.
Consider the graph below. Arcs are labeled with their weights. Assume that ties are broken alphabetically (so a partial plan S->X->A would be expanded before S->X->B and S->A->Z would be expanded before S->B->A.
Q5.1
2 Points
In what order are states expanded by Uniform Cost Search? You may find it helpful to execute the search on scratch paper.
The next five questions share a common setup. You control one or more insects in a rectangular maze-like environment with dimensions M times N , as shown in the figure below.
At each time step, an insect can either (a) move into an adjacent square if that square is currently free, or (b) stay in its current location. Squares may be blocked by walls, but the map is known. Optimality is always in terms of time steps; all actions have cost 1 regardless of the number of insects moving or where they move.
For each of the five questions, you should answer for a general instance of the problem, not simply for the example maps shown.
Problems
For this problem, you control a single insect as shown in the maze above, which must reach a designated target location X, also known as the hive. There are no other insects moving around.
Q6.1
3 Points
Which of the following is a minimal correct state space representation?
An integer (d) encoding the Manhattan distance to the hive.
A tuple ((x, y)) encoding the (x) and (y) coordinates of the insect.
A tuple ((x, y, d)) encoding the insect’s (x) and (y) coordinates as well as the Manhattan distance to the hive.
This cannot be represented as a search problem.
Q6.2
2 Points
What is the size of the state space?
(MN)
((MN)^2)
(2^{MN})
(M^N)
(N^M)
(\max(M, N))
Q6.3
2 Points
Which of the following heuristics are admissible (if any)?
Manhattan distance from the insect’s location to the hive.
Euclidean distance from the insect’s location to the hive.
You control K insects, each of which has a specific target ending location Xk . No two insects may occupy the same square. In each time step all insects move simultaneously to a currently free square (or stay in place); adjacent insects cannot swap in a single time step.
人工智能作业代写
Q7.1
2 Points
Which of the following is the smallest correct state space representation?
Ktuples ((x1, y1 ),(x2, y2 ),…,(xK, yK)) encoding the x and ycoordinates of each insect.
Ktuples ((x1, y1 ),(x2, y2 ),…,(xK, yK)) encoding the x and ycoordinates of each insect, plus K boolean variables indicating whether each insect is next to another insect.
Ktuples ((x1, y1 ),(x2, y2 ),…,(xK, yK)) encoding the x and ycoordinates of each insect, plus MN booleans indicating which squares are currently occupied by an insect.
MN booleans ,(b1, b2,…,bMN ) encoding whether or not an insect is in each square.
Q7.2
2 Points
What is the size of the above state space?
MN
2MN
KMN
(MN)K
(MN)K2K
(MN)K2MN
2KMN
2MNK
Q7.3
2 Points
Which of the following heuristics are admissible (if any)?
Sum of Manhattan distances from each insect’s location to its target location.
Sum of costs of optimal paths for each insect to its goal if it were acting alone in the environment, unobstructed by the other insects.
Max of Manhattan distances from each insect’s location to its target location.
Max of costs of optimal paths for each insect to its goal if it were acting alone in the environment, unobstructed by the other insects.
Number of insects that have not yet reached their target location.
You again control a single insect, but there are B birds flying along known paths. Specifically, at time t each bird b will be at position (xb(t), yb(t)) . The tuple of bird positions repeats with period T . Birds might move up to 3 squares per time step. An example is shown below, but keep in mind that you should answer for a general instance of the problem, not simply the map and path shown below.
Your insect can share squares with birds and it can even hitch a ride on them!
On any time step that your insect shares a square with a bird, the insect may either move as normal or move directly to the bird’s next location (either action has cost 1, even if the bird travels farther than one square).
人工智能作业代写
Q8.1
2 Points
Which of the following is a minimal state representation?
A tuple (x, y) giving the position of the insect.
A tuple (x, y) giving the position of the insect, plus a tuple of bird Positions (xb, yb) giving the location of each bird.
A tuple (x, y) giving the position of the insect, plus an integer r = t mod Twhere t is the time step.
A tuple (x, y) giving the position of the insect, plus B boolean variables indicating whether each of the birds is carrying an insect passenger.
A tuple (x, y) giving the position of the insect, plus a tuple of bird positions (xb, yb) giving the location of each bird, plus B boolean variables indicating whether each of the birds is carrying an insect passenger.
Q8.2
2 Points
Which of the following is the size of the state space?
MN
MNT
MNB
MNTB
(MN)B+1
2MNMN
(MN)B+1 2B
Q8.3
2 Points
Which of the following heuristics are admissible (if any)?
Cost of optimal path to target in the simpler problem that has no birds.
Manhattan distance from the insect’s current position to the target.
Manhattan distance from the insect’s current position to the nearest bird.
Manhattan distance from the insect’s current position to the target divided by three.
Your single insect is alone in the maze again. This time, it has super legs that can take it as far as you want in a straight line in each time step. The disadvantage of these legs is that they make turning slower, so now it takes the insect a time step to change the direction it is facing. Moving v squares requires that all intermediate squares passed through, as well as the vth square, currently be empty. The cost of a multi-square move is still 1 time unit, as is a turning move. As an example, the arrows in the maze below indicate where the insect will be and which direction it is facing after each time step in the optimal (fewest time steps) plan (cost 5):
Q9.1
2 Points
Which of the following is a minimal state representation?
A tuple (x, y) giving the position of the insect.
A tuple (x, y) giving the position of the insect, plus the direction the insect is facing.
A tuple (x, y) giving the position of the insect, plus an integer representing the number of direction changes necessary on the optimal path from the insect to the goal.
A tuple (x, y) giving the position of the insect, plus an integer trepresenting the number of time steps that have passed.
Q9.2
2 Points
What is the size of the state space?
MN
max(M, N)
min(M, N)
4MN
(MN)2
(MN)4
4MN
Q10 Hive Minds: Lost at Night
6 Points
It is night and you control a single insect. You know the maze, but you do not know what square the insect will start in. You must pose a search problem whose solution is an all-purpose sequence of actions such that, after executing those actions, the insect is guaranteed to be on the exit square, regardless of initial position. The insect executes the actions mindlessly and does not know whether its moves succeed: if it uses an action which would move it in a blocked direction, it will stay where it is. For example, in the maze below, moving right twice guarantees that the insect will be at the exit regardless of its starting position.
人工智能作业代写
Q10.1
2 Points
Which of the following state representations could be used to solve this
problem?
A tuple (x, y) representing the position of the insect.
A tuple (x, y) representing the position of the insect, plus a list of all squares visited by the insect.
An integer t representing how many time steps have passed, plus an Integer b representing how many times the insect’s motion has been blocked by a wall.
A list of boolean variables, one for each position in the maze, indicating whether the insect could be in that position.
A list of all positions the insect has been in so far.
Q10.2
2 Points
What is the size of the state space?
MN
MNT
2MN
(MN)T
e2MN
The state space is infinite.
Q10.3
2 Points
Which of the following are admissible heuristics?
Total number of possible locations the insect might be in.
The maximum of Manhattan distances to the exit square from each possible location the insect could be in.
The minimum of Manhattan distances to the exit square from each possible location the insect could be in.
Q11 Hive Minds: Time Limit
7 Points
In this problem, the ladybug has a limited number of timesteps remaining. For each timestep, there is no moving penalty, but the remaining time will decrease by one. The ladybug will gain or lose points when it lands on positive or negative values, respectively. The ladybug must move to a new square for each timestamp, and the ladybug cannot move to a square that it has already visited.
Your goal in this problem is to find the optimal score (higher is better) for a given timestep limit.
Recall from lecture the general algorithm for GRAPH-SEARCH reproduced below.
With the above implementation a node that reaches a goal state may sit on the fringe while the algorithm continues to search for a path that reaches a goal state.
Let’s consider altering the algorithm by testing whether a node reaches a goal state when inserting into the fringe.
Concretely, we add the line of code highlighted below:
Now, we’ve produced a graph search algorithm that can find a solution faster.
However, In doing so we might have affected some properties of the algorithm. To explore the possible differences, consider the example graph below.
人工智能作业代写
Q12.1
1 Point
If using EARLY-GOAL-CHECKING-GRAPH-SEARCH with a Uniform Cost node expansion strategy, which path, if any, will the algorithm return?
S-G
S-A-G
EARLY-GOAL-CHECKING-GRAPH-SEARCH will not find a solution path.
Q12.2
1 Point
If using EARLY-GOAL-CHECKING-GRAPH-SEARCH with an A* node expansion strategy, which path, if any, will the algorithm return?
S-G
S-A-G
EARLY-GOAL-CHECKING-GRAPH-SEARCH will not find a solution path.
Q12.3
2 Points
Assume you run EARLY-GOAL-CHECKING-GRAPH-SEARCH with the Uniform Cost node expansion strategy, select all statements that are true.
The EXPAND function can be called at most once for each state.
The algorithm is complete.
The algorithm will return an optimal solution.
Q12.4
2 Points
Assume you run EARLY-GOAL-CHECKING-GRAPH-SEARCH with the A* node expansion strategy and a consistent heuristic, select all statements that are true.
The EXPAND function can be called at most once for each state.
Recall from lecture the general algorithm for Graph Search reproduced below.
Using GRAPH-SEARCH, when a node is expanded it is added to the closed set.
This means that even if a node is added to the fringe multiple times it will not be expanded more than once. Consider an alternative version of GRAPH-SEARCH, LOOKAHEAD-GRAPH-SEARCH, which saves memory by using a “fringe-closed-set” keeping track of which states have been on the fringe and only adding a child node to the fringe if the state of that child node has not been added to it at some point. Concretely, we replace the highlighted block above
with the highlighted block below.
Now, we’ve produced a more memory efficient graph search algorithm.
However, in doing so, we might have affected some properties of the algorithm. To explore the possible differences, consider the example graph below.
人工智能作业代写
Q13.1
2 Points
If using LOOKAHEAD-GRAPH-SEARCH with an A* node expansion strategy, which path will this algorithm return? (We strongly encourage you to step through the execution of the algorithm on a scratch sheet of paper and keep track of the fringe and the search tree as nodes get added to the fringe.)
S → A → D → G
S → B → G
S → A → C → G
S → B → D → G
S → A → B → D → G
Q13.2
3 Points
Assume you run LOOKAHEAD-GRAPH-SEARCH with the A* node expansion strategy and a consistent heuristic, select all statements that are true.
The EXPAND function can be called at most once for each state.
Recall from lecture the general algorithm for GRAPH-SEARCH reproduced below.
Using GRAPH-SEARCH, when a node is expanded it is added to the closed set. This means that even if a node is added to the fringe multiple times it will not be expanded more than once. Consider an alternate version of GRAPH-
SEARCH, MEMORY-EFFICIENT-GRAPH-SEARCH, which saves memory by
(a) not adding node n to the fringe if STATE[n] is in the closed set, and
(b) checking if there is already a node in the fringe with last state equal to STATE[n]. If so, rather than simply inserting, it checks whether the old node or the new node has the cheaper path and then accordingly leaves the fringe unchanged or replaces the old node by the new node.
By doing this the fringe needs less memory, however insertion becomes more computationally expensive.
More concretely, MEMORY-EFFICIENT-GRAPH-SEARCH is shown below with the changes highlighted.
人工智能作业代写
Now, we’ve produced a more memory efficient graph search algorithm.
However, in doing so, we might have affected some properties of the algorithm. Assume you run MEMORY-EFFICIENT-GRAPH-SEARCH with the A* node expansion strategy and a consistent heuristic, select all statements that are true.
The EXPAND function can be called at most once for each state.
COMP 424 Final Project Game: Colosseum Survival!
AI算法代写 1.Goal The main goal of the project for this course is to give you a chance to play around with some of the AI algorithms discuss...
XML
信息检索代写 Question 1. Choose concept(s) from below that are useful in discretionary access control. Explain their usefulness. (a) roles, (b) security classes,
Question 1.
C...
CSCI-570 Analysis of Algorithms
Practice Exam - 2
算法分析代写 True/False Problems 1. For every graph G and every maximum flow on G, there always exists an edge such that increasing the ...
CSE 158/258: Homework 3
机器学习课业代做 Instructions These homework exercises are intended to help you get started on potential solutions to Assignment 1. We’ll work directly with the
Instr...