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

  • 40Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Search Problem Fundamentals
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is an agent in the context of search problems?

Tap to flipClick to flipspace

An entity that perceives its environment and acts upon that environment.

Or swipe the card

40 cards

  1. What is an agent in the context of search problems?

    An entity that perceives its environment and acts upon that environment.

  2. Define a state in a search problem.

    A configuration of the agent and its environment.

  3. What is the initial state?

    The state from which the agent begins its search.

  4. Define the actions function in a search problem.

    A function actions(s)\text{actions}(s)actions(s) that takes a state sss and returns the set of all actions that can be executed in that state.

  5. What is a transition model?

    A description of what state results from performing an action in a state, often defined by the function result(s,a)\text{result}(s, a)result(s,a).

  6. Define the state space of a search problem.

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

  7. What is a goal test?

    A function that determines whether a given state is a goal state.

  8. What is path cost?

    A numerical cost assigned to each path (sequence of actions), often used to find the cheapest solution.

  9. Define a solution in a search problem.

    A sequence of actions that takes the agent from the initial state to the goal state.

  10. What is an optimal solution?

    A solution that has the lowest path cost among all possible solutions.

  11. What information does a node in a search algorithm typically store?

    State, parent (node that generated it), action taken from parent, and path cost from initial state.

  12. What is the frontier in a search algorithm?

    A data structure containing all nodes that are available to be explored next (not yet visited).

  13. Why do we keep an explored set in a search algorithm?

    To avoid revisiting states that have already been explored, preventing infinite loops.

  14. Describe the generic search algorithm loop.

    1. If frontier empty, no solution. 2. Remove a node from frontier. 3. If node is goal, return solution. 4. Add node to explored set. 5. Expand node: for each resulting node not in frontier or explored, add to frontier. Repeat.
  15. How does depth‑first search (DFS) choose which node to explore next?

    It uses a stack (last‑in, first‑out) and always explores the deepest node in the frontier.

  16. How does breadth‑first search (BFS) choose which node to explore next?

    It uses a queue (first‑in, first‑out) and always explores the shallowest node in the frontier.

  17. Is depth‑first search guaranteed to find an optimal solution?

    No, DFS may find a suboptimal (longer) solution because it doesn't consider path costs and can get stuck in deep branches.

  18. Is breadth‑first search guaranteed to find an optimal solution when all step costs are equal?

    Yes, BFS finds the shallowest (fewest steps) solution, which is optimal if each step has the same cost.

  19. Compare memory usage of DFS and BFS.

    DFS generally uses less memory than BFS because it only needs to store one path at a time, while BFS may store many nodes at the frontier.

  20. What is the main trade‑off between DFS and BFS?

    DFS may find a solution quickly but not optimally; BFS finds the optimal solution but may explore many states and use more memory.

  21. What is an uninformed search algorithm?

    A search strategy that uses no problem‑specific knowledge beyond the problem definition (e.g., DFS, BFS).

  22. What is an informed search algorithm?

    A search strategy that uses problem‑specific knowledge (heuristics) to guide the search, often more efficient than uninformed search.

  23. Define a heuristic function h(n) in search.

    A function that estimates the cost from a given state n to the goal state.

  24. What is the Manhattan distance heuristic?

    For grid navigation, the sum of the absolute differences in x and y coordinates between the current cell and the goal, ignoring obstacles.

  25. How does greedy best‑first search work?

    At each step, it expands the node with the smallest heuristic value h(n) (estimated closest to goal).

  26. Is greedy best‑first search optimal?

    No, it is not optimal; it can choose a path that looks good locally but leads to a longer overall solution.

  27. What is the evaluation function for A* search?

    f(n)=g(n)+h(n)f(n) = g(n) + h(n)f(n)=g(n)+h(n) where g(n)g(n)g(n) is the cost from start to node n, and h(n)h(n)h(n) is the heuristic estimate to goal.

  28. What is an admissible heuristic?

    A heuristic that never overestimates the true cost to the goal. It is optimistic.

  29. What is a consistent heuristic?

    For every node n and its successor n' with step cost c, the heuristic satisfies h(n)≤h(n′)+ch(n) \leq h(n') + ch(n)≤h(n′)+c.

  30. What condition makes A* search optimal?

    A* is optimal if the heuristic is admissible (and consistent for graph search).

  31. What is the minimax algorithm?

    A recursive algorithm for two‑player deterministic games where the max player maximizes the score and the min player minimizes it. It considers all possible moves until terminal states.

  32. Define the utility function in game theory for minimax.

    A function that assigns a numerical value to a terminal state. For tic‑tac‑toe: X win = 1, O win = -1, tie = 0.

  33. What is the terminal test in a game?

    A function that checks whether the game is over (e.g., three in a row or board full for tic‑tac‑toe).

  34. In minimax, which player is the max player and which is the min player?

    Max player tries to maximize the score (e.g., X in tic‑tac‑toe). Min player tries to minimize the score (e.g., O in tic‑tac‑toe).

  35. Describe the maxValue function in minimax pseudocode.

    If state is terminal, return utility. Otherwise, set v = -infinity. For each action in actions(state): v = max(v, minValue(result(state, action))). Return v.

  36. Describe the minValue function in minimax pseudocode.

    If state is terminal, return utility. Otherwise, set v = +infinity. For each action in actions(state): v = min(v, maxValue(result(state, action))). Return v.

  37. What is alpha‑beta pruning?

    An optimization of minimax that prunes branches that cannot affect the final decision, based on two values: alpha (best for max so far) and beta (best for min so far).

  38. Why is alpha‑beta pruning useful?

    It reduces the number of nodes evaluated without affecting the final decision, allowing deeper search in complex games.

  39. What is depth‑limited minimax?

    A variant of minimax that stops searching after a fixed depth (e.g., 10 moves) and uses an evaluation function to estimate the utility of non‑terminal states.

  40. What is an evaluation function in depth‑limited minimax?

    A function that estimates the expected utility of a game state from a given perspective, used when search depth limit is reached.

Card 1 of 40
Card 1 of 40

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent