1. Home
  2. Explore
  3. Computer Science
  4. Introduction to AI

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Introduction to AI

  • 27Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Search Problem Fundamentals

What is an agent in the context of search problems?

27 questions

  1. 1

    What is an agent in the context of search problems?

    1. A

      An entity that perceives its environment and acts on it

    2. B

      The set of all possible states in a problem

    3. C

      A function that maps states to actions

    4. D

      A data structure that stores the current state

    Correct answer
    A

    An entity that perceives its environment and acts on it

    Explanation

    An agent perceives its environment and acts upon it, as described in the lecture.

  2. 2

    What is a state in a search problem?

    1. A

      A function that returns the next state given an action

    2. B

      A configuration of the agent and its environment

    3. C

      The set of all possible actions available

    4. D

      The location of the agent at any given time

    Correct answer
    B

    A 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.

  3. 3

    What does the actions function return?

    1. A

      The result of applying an action to a state

    2. B

      The set of all actions that can be executed in a given state

    3. C

      The action that leads to the goal state

    4. D

      The number of actions available in the entire problem

    Correct answer
    B

    The 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.

  4. 4

    What is the purpose of the transition model in search?

    1. A

      To describe what state results from performing an action in a state

    2. B

      To represent the cost of moving from one state to another

    3. C

      To determine which actions are available in a state

    4. D

      To check whether a state is a goal state

    Correct answer
    A

    To 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.

  5. 5

    What is the state space of a search problem?

    1. A

      The set of all possible states including unreachable ones

    2. B

      The graph of all states and actions in the problem

    3. C

      The set of states that are one action away from the current state

    4. D

      The set of all states reachable from the initial state via any sequence of actions

    Correct answer
    D

    The 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.

  6. 6

    What does a goal test do?

    1. A

      Calculates the cost to reach a goal state

    2. B

      Determines whether a given state is a goal state

    3. C

      Generates all goal states in the problem

    4. D

      Returns the sequence of actions to the goal

    Correct answer
    B

    Determines 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.

  7. 7

    What is the difference between a solution and an optimal solution?

    1. A

      A solution is found by BFS, while an optimal solution is found by DFS

    2. B

      An optimal solution has the lowest path cost among all solutions

    3. C

      A solution is any sequence of actions to the goal, while an optimal solution uses the fewest actions possible

    4. D

      An optimal solution must be unique, while a solution may not be

    Correct answer
    B

    An 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.

  8. 8

    What information does a node in a search tree typically store?

    1. A

      State, frontier, and explored set

    2. B

      State, parent, action, and path cost

    3. C

      State, depth, and number of children

    4. D

      State, goal test result, and heuristic value

    Correct answer
    B

    State, parent, action, and path cost

    Explanation

    A node stores the state, parent node, action taken from parent, and path cost from initial state.

  9. 9

    What is the frontier in a search algorithm?

    1. A

      The set of states that have already been visited

    2. B

      The sequence of actions that leads to the goal

    3. C

      The set of nodes that have not yet been explored but are available for exploration

    4. D

      The set of all nodes that are one step away from the goal

    Correct answer
    C

    The 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.

  10. 10

    In the basic search algorithm, what should the algorithm do if the frontier is empty?

    1. A

      End the algorithm and return the current node

    2. B

      Remove a node from the explored set

    3. C

      Report that there is no solution

    4. D

      Expand the last explored node again

    Correct answer
    C

    Report that there is no solution

    Explanation

    If the frontier is empty, there are no more states to explore, meaning no solution exists.

  11. 11

    Why is an explored set used in search algorithms?

    1. A

      To reduce the memory usage of the frontier

    2. B

      To store all nodes that have been added to the frontier

    3. C

      To keep track of the current best path to the goal

    4. D

      To avoid revisiting previously explored states and prevent infinite loops

    Correct answer
    D

    To 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.

  12. 12

    What data structure does depth-first search (DFS) use for the frontier?

    1. A

      A priority queue based on heuristic

    2. B

      A stack (last-in, first-out)

    3. C

      A queue (first-in, first-out)

    4. D

      A list sorted by path cost

    Correct answer
    B

    A stack (last-in, first-out)

    Explanation

    DFS uses a stack, so the deepest node (most recently added) is explored first.

  13. 13

    What data structure does breadth-first search (BFS) use for the frontier?

    1. A

      A priority queue based on heuristic

    2. B

      A queue (first-in, first-out)

    3. C

      A stack (last-in, first-out)

    4. D

      A list sorted by path cost

    Correct answer
    B

    A queue (first-in, first-out)

    Explanation

    BFS uses a queue, so the shallowest node (least recently added) is explored first.

  14. 14

    Which search algorithm always explores the deepest node in the frontier first?

    1. A

      Breadth-first search (BFS)

    2. B

      Depth-first search (DFS)

    3. C

      Greedy best-first search

    4. D

      A* search

    Correct answer
    B

    Depth-first search (DFS)

    Explanation

    DFS always explores the deepest node in the frontier, going deep until a dead end before backtracking.

  15. 15

    Which search algorithm is guaranteed to find the optimal solution if all step costs are equal?

    1. A

      Both BFS and DFS

    2. B

      Depth-first search (DFS)

    3. C

      Greedy best-first search

    4. D

      Breadth-first search (BFS)

    Correct answer
    D

    Breadth-first search (BFS)

    Explanation

    BFS finds the shallowest goal, which is optimal when all step costs are equal. DFS may find a longer path.

  16. 16

    What is a key disadvantage of depth-first search compared to breadth-first search?

    1. A

      It may not find the optimal solution

    2. B

      It uses more memory in general

    3. C

      It cannot handle infinite state spaces

    4. D

      It always explores more states than BFS

    Correct answer
    A

    It 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.

  17. 17

    What distinguishes informed search from uninformed search?

    1. A

      Informed search uses only the goal test

    2. B

      Informed search does not need a frontier

    3. C

      Informed search uses problem-specific knowledge to guide the search

    4. D

      Informed search always finds the optimal solution

    Correct answer
    C

    Informed search uses problem-specific knowledge to guide the search

    Explanation

    Informed search algorithms use problem-specific knowledge (heuristics) to make decisions, unlike uninformed search.

  18. 18

    What is the heuristic function h(n) in greedy best-first search?

    1. A

      The total cost from start to goal through node n

    2. B

      The actual cost from the start to node n

    3. C

      The depth of node n in the search tree

    4. D

      An estimate of the cost from node n to the goal

    Correct answer
    D

    An 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.

  19. 19

    What does greedy best-first search optimize at each step?

    1. A

      It expands the node with the smallest sum g(n) + h(n)

    2. B

      It expands the node with the smallest heuristic value h(n)

    3. C

      It expands the node with the smallest path cost g(n)

    4. D

      It expands the node with the largest heuristic value h(n)

    Correct answer
    B

    It 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).

  20. 20

    Why is greedy best-first search not guaranteed to find an optimal solution?

    1. A

      Because it explores all nodes at a given depth

    2. B

      Because it only considers local information and may ignore better paths

    3. C

      Because it requires an admissible heuristic

    4. D

      Because it uses too much memory

    Correct answer
    B

    Because 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.

  21. 21

    What function does A* search minimize when selecting a node to expand?

    1. A

      h(n) only, the heuristic estimate to the goal

    2. B

      g(n) + h(n), where g(n) is the cost to reach n and h(n) is the heuristic

    3. C

      g(n) * h(n)

    4. D

      g(n) only, the path cost from the start to n

    Correct answer
    B

    g(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).

  22. 22

    What condition must a heuristic satisfy for A* search to be optimal?

    1. A

      It must be admissible (never overestimates the true cost)

    2. B

      It must be consistent (satisfy h(n) <= cost(n,n') + h(n'))

    3. C

      Both admissibility and consistency are required for optimality

    4. D

      It must be consistent and admissible

    Correct answer
    C

    Both 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).

  23. 23

    In the context of Minimax, what is the role of the max player?

    1. A

      To use a heuristic to evaluate non-terminal states

    2. B

      To minimize the utility value of the game outcome

    3. C

      To maximize the utility value of the game outcome

    4. D

      To expand all possible moves equally

    Correct answer
    C

    To 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.

  24. 24

    What does the terminal test do in a game?

    1. A

      Lists all legal actions in a state

    2. B

      Switches the player to move

    3. C

      Returns the utility of a state

    4. D

      Determines whether a state is a goal state (game over)

    Correct answer
    D

    Determines 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.

  25. 25

    How does MinValue compute the value of a state for the minimizing player?

    1. A

      It returns the maximum of the MinValue of all successor states

    2. B

      It returns the utility directly if terminal, otherwise the minimum of MaxValue of successors

    3. C

      It returns the minimum of the MaxValue of all successor states

    4. D

      It returns the utility directly if terminal, otherwise the maximum of MinValue of successors

    Correct answer
    B

    It 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.

  26. 26

    What optimization does alpha-beta pruning provide to Minimax?

    1. A

      It reduces the number of terminal states considered

    2. B

      It improves the quality of the evaluation function

    3. C

      It prunes branches that cannot affect the final decision, reducing computation

    4. D

      It always finds the optimal solution faster

    Correct answer
    C

    It 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.

  27. 27

    Why is depth-limited Minimax used for games like chess?

    1. A

      Because chess has no terminal states

    2. B

      Because the full game tree is too large to explore exhaustively

    3. C

      Because depth-limited Minimax guarantees optimal play

    4. D

      Because Minimax cannot handle games with more than two players

    Correct answer
    B

    Because 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.

Question 1 of 27
Question 1 of 27

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent