Introduction to AI
- 27Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is an agent in the context of search problems?
What is an agent in the context of search problems?
27 questions
- 1
What is an agent in the context of search problems?
- A
An entity that perceives its environment and acts on it
- B
The set of all possible states in a problem
- C
A function that maps states to actions
- D
A data structure that stores the current state
Correct answer
AAn entity that perceives its environment and acts on it
Explanation
An agent perceives its environment and acts upon it, as described in the lecture.
- A
- 2
What is a state in a search problem?
- A
A function that returns the next state given an action
- B
A configuration of the agent and its environment
- C
The set of all possible actions available
- D
The location of the agent at any given time
Correct answer
BA configuration of the agent and its environment
Explanation
A state is a configuration of the agent in its environment, e.g., a specific arrangement in the 15 puzzle.
- A
- 3
What does the actions function return?
- A
The result of applying an action to a state
- B
The set of all actions that can be executed in a given state
- C
The action that leads to the goal state
- D
The number of actions available in the entire problem
Correct answer
BThe set of all actions that can be executed in a given state
Explanation
The actions function takes a state and returns the set of all actions that can be executed in that state.
- A
- 4
What is the purpose of the transition model in search?
- A
To describe what state results from performing an action in a state
- B
To represent the cost of moving from one state to another
- C
To determine which actions are available in a state
- D
To check whether a state is a goal state
Correct answer
ATo describe what state results from performing an action in a state
Explanation
The transition model, defined by the result function, describes the state resulting from an action in a state.
- A
- 5
What is the state space of a search problem?
- A
The set of all possible states including unreachable ones
- B
The graph of all states and actions in the problem
- C
The set of states that are one action away from the current state
- D
The set of all states reachable from the initial state via any sequence of actions
Correct answer
DThe set of all states reachable from the initial state via any sequence of actions
Explanation
The state space is the set of all states reachable from the initial state via any sequence of actions.
- A
- 6
What does a goal test do?
- A
Calculates the cost to reach a goal state
- B
Determines whether a given state is a goal state
- C
Generates all goal states in the problem
- D
Returns the sequence of actions to the goal
Correct answer
BDetermines whether a given state is a goal state
Explanation
The goal test checks whether a given state is a goal state, e.g., if all tiles are in order in the 15 puzzle.
- A
- 7
What is the difference between a solution and an optimal solution?
- A
A solution is found by BFS, while an optimal solution is found by DFS
- B
An optimal solution has the lowest path cost among all solutions
- C
A solution is any sequence of actions to the goal, while an optimal solution uses the fewest actions possible
- D
An optimal solution must be unique, while a solution may not be
Correct answer
BAn optimal solution has the lowest path cost among all solutions
Explanation
A solution is any sequence of actions from initial state to goal, while an optimal solution minimizes path cost.
- A
- 8
What information does a node in a search tree typically store?
- A
State, frontier, and explored set
- B
State, parent, action, and path cost
- C
State, depth, and number of children
- D
State, goal test result, and heuristic value
Correct answer
BState, parent, action, and path cost
Explanation
A node stores the state, parent node, action taken from parent, and path cost from initial state.
- A
- 9
What is the frontier in a search algorithm?
- A
The set of states that have already been visited
- B
The sequence of actions that leads to the goal
- C
The set of nodes that have not yet been explored but are available for exploration
- D
The set of all nodes that are one step away from the goal
Correct answer
CThe set of nodes that have not yet been explored but are available for exploration
Explanation
The frontier contains all nodes that could be explored next, representing the boundary of the search.
- A
- 10
In the basic search algorithm, what should the algorithm do if the frontier is empty?
- A
End the algorithm and return the current node
- B
Remove a node from the explored set
- C
Report that there is no solution
- D
Expand the last explored node again
Correct answer
CReport that there is no solution
Explanation
If the frontier is empty, there are no more states to explore, meaning no solution exists.
- A
- 11
Why is an explored set used in search algorithms?
- A
To reduce the memory usage of the frontier
- B
To store all nodes that have been added to the frontier
- C
To keep track of the current best path to the goal
- D
To avoid revisiting previously explored states and prevent infinite loops
Correct answer
DTo avoid revisiting previously explored states and prevent infinite loops
Explanation
The explored set prevents cycles by ensuring states are not revisited, as in the A-B-A loop example.
- A
- 12
What data structure does depth-first search (DFS) use for the frontier?
- A
A priority queue based on heuristic
- B
A stack (last-in, first-out)
- C
A queue (first-in, first-out)
- D
A list sorted by path cost
Correct answer
BA stack (last-in, first-out)
Explanation
DFS uses a stack, so the deepest node (most recently added) is explored first.
- A
- 13
What data structure does breadth-first search (BFS) use for the frontier?
- A
A priority queue based on heuristic
- B
A queue (first-in, first-out)
- C
A stack (last-in, first-out)
- D
A list sorted by path cost
Correct answer
BA queue (first-in, first-out)
Explanation
BFS uses a queue, so the shallowest node (least recently added) is explored first.
- A
- 14
Which search algorithm always explores the deepest node in the frontier first?
- A
Breadth-first search (BFS)
- B
Depth-first search (DFS)
- C
Greedy best-first search
- D
A* search
Correct answer
BDepth-first search (DFS)
Explanation
DFS always explores the deepest node in the frontier, going deep until a dead end before backtracking.
- A
- 15
Which search algorithm is guaranteed to find the optimal solution if all step costs are equal?
- A
Both BFS and DFS
- B
Depth-first search (DFS)
- C
Greedy best-first search
- D
Breadth-first search (BFS)
Correct answer
DBreadth-first search (BFS)
Explanation
BFS finds the shallowest goal, which is optimal when all step costs are equal. DFS may find a longer path.
- A
- 16
What is a key disadvantage of depth-first search compared to breadth-first search?
- A
It may not find the optimal solution
- B
It uses more memory in general
- C
It cannot handle infinite state spaces
- D
It always explores more states than BFS
Correct answer
AIt may not find the optimal solution
Explanation
DFS can find a longer path than the optimal one, as shown in the maze example where DFS found a suboptimal solution.
- A
- 17
What distinguishes informed search from uninformed search?
- A
Informed search uses only the goal test
- B
Informed search does not need a frontier
- C
Informed search uses problem-specific knowledge to guide the search
- D
Informed search always finds the optimal solution
Correct answer
CInformed search uses problem-specific knowledge to guide the search
Explanation
Informed search algorithms use problem-specific knowledge (heuristics) to make decisions, unlike uninformed search.
- A
- 18
What is the heuristic function h(n) in greedy best-first search?
- A
The total cost from start to goal through node n
- B
The actual cost from the start to node n
- C
The depth of node n in the search tree
- D
An estimate of the cost from node n to the goal
Correct answer
DAn estimate of the cost from node n to the goal
Explanation
h(n) estimates how close node n is to the goal, e.g., Manhattan distance in a maze.
- A
- 19
What does greedy best-first search optimize at each step?
- A
It expands the node with the smallest sum g(n) + h(n)
- B
It expands the node with the smallest heuristic value h(n)
- C
It expands the node with the smallest path cost g(n)
- D
It expands the node with the largest heuristic value h(n)
Correct answer
BIt expands the node with the smallest heuristic value h(n)
Explanation
Greedy best-first search always picks the node it thinks is closest to the goal, i.e., with smallest h(n).
- A
- 20
Why is greedy best-first search not guaranteed to find an optimal solution?
- A
Because it explores all nodes at a given depth
- B
Because it only considers local information and may ignore better paths
- C
Because it requires an admissible heuristic
- D
Because it uses too much memory
Correct answer
BBecause it only considers local information and may ignore better paths
Explanation
Greedy best-first search can be misled by a heuristic that seems good locally but leads to a suboptimal overall path.
- A
- 21
What function does A* search minimize when selecting a node to expand?
- A
h(n) only, the heuristic estimate to the goal
- B
g(n) + h(n), where g(n) is the cost to reach n and h(n) is the heuristic
- C
g(n) * h(n)
- D
g(n) only, the path cost from the start to n
Correct answer
Bg(n) + h(n), where g(n) is the cost to reach n and h(n) is the heuristic
Explanation
A* search expands the node with the smallest sum of g(n) (cost to node) and h(n) (estimated cost to goal).
- A
- 22
What condition must a heuristic satisfy for A* search to be optimal?
- A
It must be admissible (never overestimates the true cost)
- B
It must be consistent (satisfy h(n) <= cost(n,n') + h(n'))
- C
Both admissibility and consistency are required for optimality
- D
It must be consistent and admissible
Correct answer
CBoth admissibility and consistency are required for optimality
Explanation
A* is optimal if the heuristic is both admissible (never overestimates) and consistent (satisfies the triangle inequality).
- A
- 23
In the context of Minimax, what is the role of the max player?
- A
To use a heuristic to evaluate non-terminal states
- B
To minimize the utility value of the game outcome
- C
To maximize the utility value of the game outcome
- D
To expand all possible moves equally
Correct answer
CTo maximize the utility value of the game outcome
Explanation
The max player (typically X) aims to maximize the score, e.g., 1 for win, 0 for draw, -1 for loss.
- A
- 24
What does the terminal test do in a game?
- A
Lists all legal actions in a state
- B
Switches the player to move
- C
Returns the utility of a state
- D
Determines whether a state is a goal state (game over)
Correct answer
DDetermines whether a state is a goal state (game over)
Explanation
The terminal test checks if the game is over, e.g., three in a row in tic-tac-toe.
- A
- 25
How does MinValue compute the value of a state for the minimizing player?
- A
It returns the maximum of the MinValue of all successor states
- B
It returns the utility directly if terminal, otherwise the minimum of MaxValue of successors
- C
It returns the minimum of the MaxValue of all successor states
- D
It returns the utility directly if terminal, otherwise the maximum of MinValue of successors
Correct answer
BIt returns the utility directly if terminal, otherwise the minimum of MaxValue of successors
Explanation
MinValue returns the utility if terminal, else the minimum over all actions of the MaxValue of the resulting state.
- A
- 26
What optimization does alpha-beta pruning provide to Minimax?
- A
It reduces the number of terminal states considered
- B
It improves the quality of the evaluation function
- C
It prunes branches that cannot affect the final decision, reducing computation
- D
It always finds the optimal solution faster
Correct answer
CIt prunes branches that cannot affect the final decision, reducing computation
Explanation
Alpha-beta pruning skips evaluation of moves that cannot be better than the current best, saving time.
- A
- 27
Why is depth-limited Minimax used for games like chess?
- A
Because chess has no terminal states
- B
Because the full game tree is too large to explore exhaustively
- C
Because depth-limited Minimax guarantees optimal play
- D
Because Minimax cannot handle games with more than two players
Correct answer
BBecause the full game tree is too large to explore exhaustively
Explanation
Chess has an enormous state space, so the search is limited to a certain depth and an evaluation function estimates the utility.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.