Lec 0 | Search Flashcards

1
Q

Covers a range of techniques that appear as sentient behavior by the computer

A

Artificial Intelligence (AI)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Finding a solution to a problem, like a navigator app that finds the best route from your origin to the destination, or like playing a game and figuring out the next move.

A

Search

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Representing information and drawing inferences from it.

A

Knowledge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Dealing with uncertain events using probability.

A

Uncertainty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Finding not only a correct way to solve a problem, but a better—or the best—way to solve it.

A

Optimization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Improving performance based on access to data and experience. For example, your email is able to distinguish spam from non-spam mail based on past experience.

A

Learning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A program structure inspired by the human brain that is able to perform tasks effectively.

A

Neural Networks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Processing natural language, which is produced and understood by humans.

A

Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Involves an agent that is given an initial state and a goal state, and it returns a solution of how to get from the former to the latter.

A

Search Problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

An entity that perceives its environment and acts upon that environment. In a navigator app, for example, it could be a representation of a car that needs to decide on which actions to take to arrive at the destination.

A

Agent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A configuration of an agent in its environment.

A

State

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The state from which the search algorithm starts. In a navigator app, that would be the current location.

A

Initial State

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Choices that can be made in a state.

A

Actions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The function for action that returns as output the set of actions that can be executed in state s.

A

Actions(s)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A description of what state results from performing any applicable action in any state.

A

Transition Model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Upon receiving state s and action a as input, the function of the transition model returns the state resulting from performing action a in state s.

A

Results(s, a)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

State Space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

It can be visualized as a directed graph with states, represented as nodes, and actions, represented as arrows between nodes.

A

State Space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The condition that determines whether a given state is a goal state. The current location of the agent is at the destination.

A

Goal Test

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

A numerical cost associated with a given path.

A

Path Cost

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

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

A

Solution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

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

A

Optimal Solution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

a data structure that contains the following data:

  • A state
  • Parent ______
  • The action that was applied to the state of the parent to get to the current _______
  • The path cost from the initial state to this ______
A

Node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the Approach?

A

Start with a frontier that contains the initial state.

Repeat:
* If the frontier is empty, then no solution.
* Remove a node from the frontier.
* If node contains goal state, return the solution.
*Expand node, add resulting nodes to the frontier.

24
Q

What is the Revised Approach?

A

Start with a frontier that contains the initial state.
* Start with an empty explored set.

Repeat:
* If the frontier is empty, then no solution.
* Remove a node from the frontier.
* If node contains goal state, return the solution.
* Add the node to the explored set.
*Expand node, add resulting nodes to the frontier if they aren’t already in the frontier or the explored set.

25
Q

What is Stack?

A

last-in first-out data type

26
Q

Which search algorithm uses stack?

A

Depth-First Search (DFS)

27
Q

A search algorithm that always expands the deepest node in the frontier. It exhausts each one direction before trying another direction.

A

Depth-first search (DFS)

28
Q

What are the Pros of using DFS?

A

At best, this algorithm is the fastest. If it “lucks out” and always chooses the right path to the solution (by chance), then depth-first search takes the least possible time to get to a solution.

29
Q

What are the cons of using DFS?

A
  • It is possible that the found solution is not optimal.
  • At worst, this algorithm will explore every possible path before finding the solution, thus taking the longest possible time before reaching the solution.
30
Q

A search algorithm that always expands the shallowest node in the frontier. It will follow multiple directions at the same time, taking one step in each possible direction before taking the second step in each direction.

A

Breadth-first search (BFS)

31
Q

What is queue?

A

first-in first-out data type

32
Q

Which search algorithm uses Queue?

A

Breadth-First Search (BFS)

33
Q

What are the Pros of using BFS?

A

This algorithm is guaranteed to find the optimal solution.

34
Q

What are the cons of using BFS?

A
  • This algorithm is almost guaranteed to take longer than the minimal time to run.
  • At worst, this algorithm takes the longest possible time to run.
35
Q

A search strategy that uses no problem specific knowledge. It does not utilize any knowledge about the problem that they did not acquire through their own exploration.

A

Uninformed Search Algorithms

36
Q

A search strategy that uses problem-specific knowledge to find solutions more efficiently. It considers additional knowledge to try to improve its performance.

A

Informed Search Algorithms

37
Q

A search algorithm that expands the node that is closest to the goal, as estimated by a heuristic function h(n)

A

Greedy Best-First Search

38
Q

It is a function that estimates how close to the goal the next node is.

A

heuristic function h(n)

39
Q

An algorithm can use a heuristic function that relies on the ______________________ between the possible nodes and the end of the maze. It ignores walls and counts how many steps up, down, or to the sides it would take to get from one location to the goal location.

A

Manhattan distance

40
Q

A search algorithm that expands node with lowest value of g(n) + h(n)
- g(n) = cost to reach node
- h(n) = estimated cost to goal

A

A* Search

41
Q

How will the A* Search be optimal?

A
  • h(n) is admissible (never overestimates the true cost), and
  • h(n) is consistent (for every node n and successor n’ with step cost c, h(n) ≤ h(n’) + c)
42
Q

The algorithm faces an opponent that tries to achieve the opposite goal.

A

Adversarial Search

43
Q

A type of algorithm in adversarial search, it represents winning conditions as (-1) for one side and (+) for the other side.

A

Minimax

44
Q

MAX (X) aims to?

A

Maximize score

45
Q

MIN (O) aims to?

A

Minimize score

46
Q

In a Tic-Tac-Toe game,

What does the following do?
* S0
* Player(s)
* Action(s)
* Results(s,a)
* Terminal(s)
* Utility(s)

gitapol kog gama new cards maong giusa

very skippable bc niagi nanis search problems

A
  • S₀: Initial state (in our case, an empty 3X3 board)
  • Players(s): a function that, given a state s, returns which player’s turn it is (X or O).
  • Actions(s): a function that, given a state s, return all the legal moves in this state (what spots are free on the board).
  • Result(s, a): a function that, given a state s and action a, returns a new state. This is the board that resulted from performing the action a on state s (making a move in the game).
  • Terminal(s): a function that, given a state s, checks whether this is the last step in the game, i.e. if someone won or there is a tie. Returns True if the game has ended, False otherwise.
  • Utility(s): a function that, given a terminal state s, returns the utility value of the state: -1, 0, or 1.
47
Q

How does minimax work?

A
  • Recursively, the algorithm simulates all possible games that can take place beginning at the current state and until a terminal state is reached.
  • Each terminal state is valued as either (-1), 0, or (+1).
48
Q

In Minimax,

Given state s, how does MAX and MIN work?

A
  • MAX picks action a in ACTIONS(s) that produces highest value of MIN-VALUE(RESULT(s, a))
  • MIN picks action a in ACTIONS(s) that produces smallest value of MAX-VALUE(RESULT(s, a)
49
Q

function MAX-VALUE(s) code?

di pud dagay sir huhuhuhhuhu

A
function MAX-VALUE(state): 
    if TERMINAL(state): 
        return UTILITY(state) 
    v = -∞ 
    for action in ACTIONS(state): 
         v = MAX(v, MIN-VALUE(RESULT(state, action))) 
    return v
50
Q

function MIN-VALUE(s) code?

di pud dagay sir(2) huhuhuhuhuhu

A
function MIN-VALUE(state): 
    if TERMINAL(state): 
         return UTILITY(state) 
    v = ∞ 
    for action in ACTIONS(state): 
         v = MIN(v, MAX-VALUE(RESULT(state, action))) 
    return v
51
Q

How to Optimize minimax?

ambot lang optimizations ra ang naas slide

A

Alpha-Beta Pruning

52
Q

This skips some of the recursive computations that are decidely unfavorable

apilon pa ba ni?

A

Alpha-Beta Pruning

53
Q

It considers only a pre-defined number of moves before it stops, without ever getting to a terminal state.

mao ray definition nga nakita nako para ani

A

Depth-limited Minimax

54
Q

A function that estimates the expected utility of the game from a given state, or, in other words, assigns values to states.

A

Evaluation function

55
Q

Depth-limited Minimax relies on ?

A

evaluation function

56
Q

trivia ata

How many possible games are there in:
* Tic Tac Toe?
* Chess games after 4 moves?
* chess games (lower bound)?

apil pa ba ni

apilon nalang

A

There is a total of 255,168 possible Tic Tac Toe games, 280,000,000,000 possible chess games after 4 moves, and 10²⁹⁰⁰⁰ possible games in Chess(lower bound)

57
Q

CS50 QUIZ

Between depth first search (DFS) and breadth first search (BFS), which will find a shorter path through a maze?
A. DFS will always find a shorter path than BFS
B. BFS will always find a shorter path than DFS
C. DFS will sometimes, but not always, find a shorter path than BFS
D. BFS will sometimes, but not always, find a shorter path than DFS
E. Both algorithms will always find paths of the same length

A

D. BFS will sometimes, but not always, find a shorter path than DFS

58
Q

CS50 QUIZ

Why is depth-limited minimax sometimes preferable to minimax without a depth limit?
A. Depth-limited minimax can arrive at a decision more quickly because it explores fewer states
B. Depth-limited minimax will achieve the same output as minimax without a depth limit, but can sometimes use less memory
C. Depth-limited minimax can make a more optimal decision by not exploring states known to be suboptimal
D. Depth-limited minimax is never preferable to minimax without a depth limit

A

A. Depth-limited minimax can arrive at a decision more quickly because it explores fewer states