1. Home
  2. Explore
  3. Computer Science
  4. State-Based Models: MDPs & Games

Study methods

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

State-Based Models: MDPs & Games

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

What is the primary output of a search problem?

30 questions

  1. 1

    What is the primary output of a search problem?

    1. A

      A set of all possible actions

    2. B

      A sequence of actions

    3. C

      A single action label

    4. D

      A probability distribution over actions

    Correct answer
    B

    A sequence of actions

    Explanation

    Search problems output a sequence of actions (a plan) to achieve a goal, unlike reflex-based models that output a single label.

  2. 2

    Which of the following best describes the key difference between reflex-based models and search-based models?

    1. A

      Reflex models output sequences of actions, search models output single actions

    2. B

      Reflex models consider future consequences, search models do not

    3. C

      Search models consider future consequences of actions, reflex models do not

    4. D

      Search models use gradient descent, reflex models use tree search

    Correct answer
    C

    Search models consider future consequences of actions, reflex models do not

    Explanation

    In search problems, the output action influences future states, requiring consideration of future consequences. Reflex models map input directly to output without considering future effects.

  3. 3

    Which of the following is NOT a standard component of a search problem?

    1. A

      Learning rate

    2. B

      Cost function

    3. C

      Start state

    4. D

      Actions function

    Correct answer
    A

    Learning rate

    Explanation

    Search problems are defined by start state, actions(s), cost(s,a), successor(s,a), and IsEnd(s). Learning rate is used in learning algorithms, not in search problem definition.

  4. 4

    In the farmer, cabbage, goat, and wolf river crossing problem, what is the cost of each crossing?

    1. A

      Variable depending on items carried

    2. B

      1

    3. C

      0

    4. D

      2

    Correct answer
    B

    1

    Explanation

    The lecture states that every crossing takes a cost of one.

  5. 5

    In the tram problem, what are the two possible actions from state s?

    1. A

      Walk to s+2 (cost 1) or take tram to s+1 (cost 2)

    2. B

      Walk to s-1 (cost 1) or take tram to s/2 (cost 2)

    3. C

      Walk to s+1 (cost 1) or take tram to 2s (cost 2)

    4. D

      Walk to s+1 (cost 2) or take tram to 2s (cost 1)

    Correct answer
    C

    Walk to s+1 (cost 1) or take tram to 2s (cost 2)

    Explanation

    From the lecture: walking goes to s+1 costing 1 minute, tram goes to 2s costing 2 minutes.

  6. 6

    In the tram problem, what is the start state?

    1. A

      It depends on N

    2. B

      1

    3. C

      N

    4. D

      0

    Correct answer
    B

    1

    Explanation

    The start state is block 1, as defined in the lecture.

  7. 7

    What is the time complexity of backtracking search in the worst case?

    1. A

      O(n)O(n)O(n)

    2. B

      O(b⋅d)O(b \cdot d)O(b⋅d)

    3. C

      O(d)O(d)O(d)

    4. D

      O(bd)O(b^d)O(bd)

    Correct answer
    D

    O(bd)O(b^d)O(bd)

    Explanation

    Backtracking search explores the entire tree, so time is O(bd)O(b^d)O(bd) where b is branching factor and d is depth.

  8. 8

    What is the space complexity of backtracking search?

    1. A

      O(bd)O(b^d)O(bd)

    2. B

      O(b⋅d)O(b \cdot d)O(b⋅d)

    3. C

      O(n)O(n)O(n)

    4. D

      O(d)O(d)O(d)

    Correct answer
    D

    O(d)O(d)O(d)

    Explanation

    Backtracking search only needs to store the path from root to current node, so space is O(d)O(d)O(d).

  9. 9

    Under what condition does depth-first search (DFS) stop and return a solution?

    1. A

      When it has explored all nodes at the current depth

    2. B

      When it finds the lowest-cost solution

    3. C

      When it finds any solution

    4. D

      When it has explored all nodes

    Correct answer
    C

    When it finds any solution

    Explanation

    DFS stops as soon as it finds a solution because all action costs are zero, so the first solution found is optimal.

  10. 10

    What restriction does depth-first search impose on the cost function?

    1. A

      Costs must be non-negative

    2. B

      Costs must be positive constants

    3. C

      Costs can be any real number

    4. D

      Costs must be zero

    Correct answer
    D

    Costs must be zero

    Explanation

    DFS requires costs to be zero so that the first solution found is optimal (all solutions have equal cost).

  11. 11

    In the worst case, DFS has the same time complexity as backtracking search. What is the reason?

    1. A

      DFS always explores the entire tree even after finding a solution

    2. B

      DFS may need to explore the entire tree if no solution exists early

    3. C

      DFS explores all nodes regardless of solution

    4. D

      DFS has a branching factor of 1

    Correct answer
    B

    DFS may need to explore the entire tree if no solution exists early

    Explanation

    In the worst case, DFS may traverse the entire tree before finding a solution, leading to O(bd)O(b^d)O(bd) time.

  12. 12

    What is the key advantage of breadth-first search (BFS) over DFS when costs are constant?

    1. A

      BFS has lower space complexity

    2. B

      BFS can handle negative costs

    3. C

      BFS finds the shallowest solution first

    4. D

      BFS does not require storing history

    Correct answer
    C

    BFS finds the shallowest solution first

    Explanation

    BFS explores layer by layer, so it finds the shallowest solution (which has smallest depth) first, which is optimal when costs are constant.

  13. 13

    What is the space complexity of breadth-first search?

    1. A

      O(n)O(n)O(n)

    2. B

      O(d)O(d)O(d)

    3. C

      O(b⋅d)O(b \cdot d)O(b⋅d)

    4. D

      O(bd)O(b^d)O(bd)

    Correct answer
    D

    O(bd)O(b^d)O(bd)

    Explanation

    BFS must store all nodes at the current level to expand later, so space is O(bd)O(b^d)O(bd) in the worst case.

  14. 14

    What is the time complexity of breadth-first search when the solution is at depth ddd?

    1. A

      O(d)O(d)O(d)

    2. B

      O(bD)O(b^D)O(bD) where DDD is the maximum depth

    3. C

      O(b⋅d)O(b \cdot d)O(b⋅d)

    4. D

      O(bd)O(b^d)O(bd)

    Correct answer
    D

    O(bd)O(b^d)O(bd)

    Explanation

    BFS explores up to depth ddd, so time is O(bd)O(b^d)O(bd) where d is the solution depth.

  15. 15

    What restriction does BFS impose on costs?

    1. A

      Costs can be any real number

    2. B

      Costs must be positive constants

    3. C

      Costs must be non-negative

    4. D

      Costs must be zero

    Correct answer
    B

    Costs must be positive constants

    Explanation

    BFS requires all edge costs to be the same positive constant so that the shallowest solution is also the lowest-cost solution.

  16. 16

    How does DFS iterative deepening combine the advantages of BFS and DFS?

    1. A

      It alternates between BFS and DFS at each level

    2. B

      It uses BFS to find the solution depth, then runs DFS

    3. C

      It runs DFS repeatedly with increasing depth limits, stopping when a solution is found

    4. D

      It uses a priority queue to order nodes by depth

    Correct answer
    C

    It runs DFS repeatedly with increasing depth limits, stopping when a solution is found

    Explanation

    Iterative deepening runs DFS up to a depth limit, increments the limit, and repeats until a solution is found, giving BFS-like optimality with DFS-like space.

  17. 17

    What is the space complexity of DFS iterative deepening?

    1. A

      O(d)O(d)O(d)

    2. B

      O(b⋅d)O(b \cdot d)O(b⋅d)

    3. C

      O(n)O(n)O(n)

    4. D

      O(bd)O(b^d)O(bd)

    Correct answer
    A

    O(d)O(d)O(d)

    Explanation

    Each DFS run uses space O(d)O(d)O(d) (depth of current limit), so overall space is O(d)O(d)O(d).

  18. 18

    What is the time complexity of DFS iterative deepening when the solution is at depth ddd?

    1. A

      O(bd)O(b^d)O(bd)

    2. B

      O(bd)O(b^d)O(bd) but typically much better than BFS

    3. C

      O(bd)O(b^d)O(bd) ignoring constant factors

    4. D

      O(d⋅bd)O(d \cdot b^d)O(d⋅bd)

    Correct answer
    C

    O(bd)O(b^d)O(bd) ignoring constant factors

    Explanation

    The time is O(bd)O(b^d)O(bd) because the last DFS dominates, and the extra factor of d is usually negligible compared to exponential.

  19. 19

    What assumption does dynamic programming make about the graph of states?

    1. A

      The branching factor must be constant

    2. B

      It must be acyclic

    3. C

      It must be fully connected

    4. D

      Costs must be positive

    Correct answer
    B

    It must be acyclic

    Explanation

    Dynamic programming requires an acyclic graph to compute future costs in a topological order. Cycles would prevent deterministic ordering.

  20. 20

    In dynamic programming, what is the recurrence for future cost of state sss?

    1. A

      f(s)=0f(s) = 0f(s)=0 for all states

    2. B

      f(s)=min⁡a[cost(s,a)+f(succ(s,a))]f(s) = \min_{a}[\text{cost}(s,a) + f(\text{succ}(s,a))]f(s)=mina​[cost(s,a)+f(succ(s,a))]

    3. C

      f(s)=cost(s,a)+f(succ(s,a))f(s) = \text{cost}(s,a) + f(\text{succ}(s,a))f(s)=cost(s,a)+f(succ(s,a)) for the first action

    4. D

      f(s)=max⁡a[cost(s,a)+f(succ(s,a))]f(s) = \max_{a}[\text{cost}(s,a) + f(\text{succ}(s,a))]f(s)=maxa​[cost(s,a)+f(succ(s,a))]

    Correct answer
    B

    f(s)=min⁡a[cost(s,a)+f(succ(s,a))]f(s) = \min_{a}[\text{cost}(s,a) + f(\text{succ}(s,a))]f(s)=mina​[cost(s,a)+f(succ(s,a))]

    Explanation

    The future cost is the minimum over actions of the cost of the action plus the future cost of the resulting state, with base case 0 at end states.

  21. 21

    How does dynamic programming achieve polynomial time?

    1. A

      By exploring the tree in breadth-first order

    2. B

      By assuming all costs are zero

    3. C

      By using a heuristic to prune branches

    4. D

      By using memoization to avoid recomputation of future costs for repeated states

    Correct answer
    D

    By using memoization to avoid recomputation of future costs for repeated states

    Explanation

    Dynamic programming caches the future cost for each state, so each state's value is computed only once, reducing exponential time to polynomial in number of states.

  22. 22

    What is the key requirement for dynamic programming to work?

    1. A

      The branching factor must be at most 2

    2. B

      All costs must be integer

    3. C

      The state must be a sufficient statistic for optimal future decisions

    4. D

      The graph must be a tree

    Correct answer
    C

    The state must be a sufficient statistic for optimal future decisions

    Explanation

    Dynamic programming relies on the property that future cost depends only on the current state, so the state must summarize all past information needed for optimal decisions.

  23. 23

    In the route finding problem with constraint 'no three odd cities in a row', what is a minimal state representation?

    1. A

      Current city and previous city

    2. B

      Current city only

    3. C

      Current city and a flag indicating whether the previous city was odd

    4. D

      Current city and the count of odd cities visited so far

    Correct answer
    C

    Current city and a flag indicating whether the previous city was odd

    Explanation

    Only the parity of the previous city is needed (odd/even) because the constraint cares about consecutive odds. A flag suffices, reducing state space to 2n instead of n^2.

  24. 24

    What is the minimal state representation for the problem 'visit at least three odd cities' while moving forward?

    1. A

      Current city and previous city

    2. B

      Current city and min(number of odd cities, 3)

    3. C

      Current city and total number of odd cities visited

    4. D

      Current city only

    Correct answer
    B

    Current city and min(number of odd cities, 3)

    Explanation

    Only counts up to 3 matter (once you have 3, more don't change anything). So state = (current city, min(oddCount,3)) reduces space to O(3n).

  25. 25

    What is the size of the state space when using (current city, previous parity) for n cities?

    1. A

      nnn

    2. B

      2n2n2n

    3. C

      n2n^2n2

    4. D

      2n2^n2n

    Correct answer
    B

    2n2n2n

    Explanation

    Current city has n possibilities, previous parity (odd/even) has 2, so total 2n2n2n states.

  26. 26

    In uniform cost search, what are the three sets maintained?

    1. A

      Explored, Frontier, Unexplored

    2. B

      Seen, Expanded, Todo

    3. C

      Visited, Processed, Remaining

    4. D

      Open, Closed, Waiting

    Correct answer
    A

    Explored, Frontier, Unexplored

    Explanation

    Uniform cost search uses explored (optimal path known), frontier (seen but not finalized), and unexplored (not yet seen).

  27. 27

    What assumption does uniform cost search make about edge costs?

    1. A

      Costs must be positive integers

    2. B

      Costs must be non-negative

    3. C

      Costs must be constant

    4. D

      Costs must be zero

    Correct answer
    B

    Costs must be non-negative

    Explanation

    Uniform cost search (like Dijkstra's) requires non-negative costs to guarantee optimality when expanding states in order of increasing past cost.

  28. 28

    In uniform cost search, when is a state moved from frontier to explored?

    1. A

      When it is the state with the smallest past cost in the frontier

    2. B

      When it has no successors

    3. C

      When it is first discovered

    4. D

      When all its successors have been explored

    Correct answer
    A

    When it is the state with the smallest past cost in the frontier

    Explanation

    The state with the smallest past cost is popped from the frontier and moved to explored, as its optimal path is now known.

  29. 29

    What happens in uniform cost search when a better path to a frontier state is found?

    1. A

      The state's past cost is updated and its entry remains in frontier

    2. B

      The state is immediately moved to explored

    3. C

      The state is moved back to unexplored

    4. D

      The better path is ignored

    Correct answer
    A

    The state's past cost is updated and its entry remains in frontier

    Explanation

    If a better cost is found for a state already in the frontier, its past cost is updated (the entry is replaced or updated in the priority queue).

  30. 30

    In uniform cost search, what is the initial content of the frontier?

    1. A

      The start state with cost 0

    2. B

      Empty

    3. C

      The start state with cost infinity

    4. D

      All states with infinite cost

    Correct answer
    A

    The start state with cost 0

    Explanation

    The start state is placed in the frontier with past cost 0, as it requires no cost to reach itself.

Question 1 of 30
Question 1 of 30

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent