Artificial Intelligence Test #1

Ace your homework & exams now with Quizwiz!

How is a state represented when using a genetic algorithm to solve the 8-queens problem in the textbook example. A string of integers where each integer represents each column, and the value for that integer is the row location of the queen An integer where each digit represents each column, and the value for that integer is the row location of the queen A two-dimensional list where each element is a pair of integers representing a queen's row and column location respectively A dictionary where each key is the row and each value a column of a queen's coordinate on the board An integer where each digit represents each row, and the value for that integer is the column location of the queen

A string of integers where each integer represents each column, and the value for that integer is the row location of the queen

The _ algorithm expands nodes based on the path cost as well as the heuristic cost.

A*

What component(s) determine(s) the state space of a problem? Initial state Transition model Actions All of the above

All of the above

What is the definition of optimality for local search algorithms? An algorithm that is optimal will always find global max or min State in the most amount of steps An algorithm that is optimal will always find the global max or min State An algorithm that is optimal will always find global max or min State in the least amount of steps An algorithm that is optimal will always find the shortest path to the goal

An algorithm that is optimal will always find the global max or min State

Which of the following algorithms has time complexity O(b^d) BFS DFS Depth-first limited Search

BFS

A genetic algorithm terminates when it finds the best solution (based on fitness). TRUE/FALSE?

FALSE

A complete algorithm will infinitely loop when a path from the start to the goal does not exist. TRUE/FALSE?

FALSE Correct! A complete algorithm is complete because it will not infinitely loop in this scenario. Instead, the algorithm will return that no path exists.

Match the terms that are commonly used to describe values in a Node type when using informed search. PATH COST = ? HEURISTIC COST = ? PATH + HEURISTIC = ?

G(N), H(N), F(N)

_ search always expands the node with the lowest heuristic cost.

Greedy

In simulated annealing, how does the algorithm determine if it moves to the "next" node? If the next node is better, then move to "next". Else, only move to "next" based on a probability that decreases as time goes on Move to "next" only if it is better than the current node. If the next node is better, then move to "next" Else, only move to "next" based on a probability that increases as time goes on If the next node is better, then move to "next" Else, move to a random node.

If the next node is better, then move to "next". Else, only move to "next" based on a probability that decreases as time goes on

Which of the following is a valid function declaration in Python that takes in 3 parameters and returns an integer? A.def myFunc(x, y, z): B.def int myFunc(x, y, z): C.def myFunc(int x, int y, int z): D.def int myFunc(int x, int y, int z): E.def myFunc(x, y, z): F.def int myFunc(x, y, z): G.def myFunc(int x, int y, int z): H.def int myFunc(int x, int y, int z):

A. def myFunc(x, y, z):

Problem formulation defines ____ that an agent can take to explore_______ .

ACTIONS, STATES

Are greedy search algorithms (tree-search version) complete? Why or why not? No. If they hit a local minima they can get caught in a infinite loop. Yes, as long as it uses an admissable heuristic. No. It doesn't always result in an optimal path. Yes. Optimability, admissability, and local minima do not play a role in making an algorithm 'complete'.

No. If they hit a local minima they can get caught in a infinite loop.

What is the space complexity of A* given an admissible heuristic? O(b^(ed)) O(b^m) O(b(em)) (h*-h)/h*

O(b^(ed))

What is the time complexity of A* given an admissible heuristic? O(b^(ed)) O(b^m) O(b(em)) (h*-h)/h*

O(b^(ed))

In ----------- , if a local extrema is found, then the algorithm will start over at a random state. ------- ------ allows down hill moves based on a probability

Random-restart hill climbing, Simulated annealing

Which are advantages of local search over the classical searching algorithms? (MULTIPLE ANSWERS) Paths to the goal are stored more efficiently Reduced space complexity Local Search can find good solutions in infinite state spaces They are systematic

Reduced space complexity Local Search can find good solutions in infinite state spaces

What is a successor node? The goal node A leaf node The root node A child node

Child Node

What is the list of all nodes in the search tree that have been expanded? Open list Closed list Queue Leaf list

Closed List

Which of these is NOT a component of state space problem formulation? Define state representation Define initial state Define transition model Define goal state/condition/test Define step costs for each action

Define goal state/condition/test

What is a strategy for finding admissible heuristics? Designing a heuristic that will always be less than the path cost Designing a heuristic for a relaxed version of the problem Designing a heuristic for a more complicated version of the problem Designing a heuristic that will always be greater than the path cost

Designing a heuristic for a relaxed version of the problem

What is a solution for an uninformed search algorithm? A node A path Breadth-first search A goal

A Path

What data structure should be used to push on and pop off nodes from the open list in Breadth-first search? A tree A stack (LIFO) A priority queue A queue (FIFO)

A queue (FIFO)

What data structure should be used to push on and pop off nodes from the open list in Depth-first search? A tree A stack (LIFO) A priority queue A queue (FIFO)

A stack (LIFO)

An optimal solution for an uninformed search problem is a solution that has the lowest____ cost

path

A state space path is a ____ of _____ connected by ___

sequence, states, actions

When using cost functions, _____ values are better. When using objective functions,_____ values are better.

smaller, larger

Successor nodes are generated by ____ nodes.

state, expanding or expand

BFS and Uniform-cost Search will behave the same if the _____ _____ are equal.

step costs

The A* algorithm is optimal if and only if... the heuristic function is admissible. the heuristic function is NOT admissible. the path costs are uniform. the solution is found before the depth limit.

the heuristic function is admissible.

Which of the following is a correct command to create a variable in Python? x = 0 int x = 0; x; int x;

x = 0 Correct! You do not need to specify a type when declaring a variable in Python because you must initialize the variable when it is declared. Python will infer the type based on whatever you set it equal to.

Given a list titled 'x' that contains 5 integers, how can you add a new element with value 0 to x? x.add(0) x[5]=0 x.append(0)

x.append(0)

What is the list of all nodes in the search tree that have NOT been expanded? Open list Closed list Queue Leaf list

Open List

The d term in the time complexity formulas is the depth of (if it is two words, then put both words into the blank):

goal state, goal or goal node

A different state representation leads to a different state space size. TRUE/FALSE?

True

Given the following list: x = [ [1, 2, 3], 0, 'myStrElement', [4, 5, 6] ] What will be printed by: a) x[3] b) x[2] c) x[0][1]

a: [4,5,6] b: 'myStrElement' c: 2

The m term in the time complexity formulas is the maximum depth of (if it is two words, then put both words into the blank):

any node, searching tree or tree

The b term in the time complexity formulas is (if it is two words, then put both words into the blank):

branch factpr

When a heuristic function is more accurate, the value of epsilon in A* time complexity decreases

decreases

If I have a class titled MyClass, then which of the following is a valid constructor header? def __init__(self): def MyClass(self): def __MyClass__(self): def __create__(self):

def __init__(self):

Which of the following is a valid function declaration in Python? def myFunc(): public static void myFunc(): def int myFunc(): def myFunc(int x, int y)

def myFunc():

In genetic algorithms, each state is rated by the ____ _____. It should return higher values for better states.

fitness function

_________ is considered complete.

Random-restart hill climbing

Which of the following algorithms has time complexity O(b^m) BFS DFS UCS

DFS

A ______ ____ is a peak that is higher than each of its neighboring states but lower than the _____ ______.

Local Maximum, Global Maximum

What is the difference between local search and the previous searching algorithms covered (classical search algorithms)? Local search takes both path cost and the herustic function into account. Local search systematically explores paths from an initial state. Local Search only stores the current state. Local search only searches a limited amount of the state space.

Local Search only stores the current state.

If we wanted to find the best route for a taxi driver to use, what would be the best heuristic?

Manhattan Distance, Euclidean Distance

What keyword must always be the first parameter in a Python class method? self init this while

SELF

For the n-queens problem, what is the advantage of a complete-state formulation over an incremental formulation? Larger state space Smaller state space Simpler goal condition Simpler actions

Smaller state space

What is the main drawback of the A* algorithm? Space complexity Time complexity Designing heuristics Optimality

Space complexity

A Hill Climbing algorithm may give a different goal for different initial states. TRUE/FALSE?

TRUE

A different set of actions can lead to a different state space size. TRUE/FALSE?

TRUE

Local search algorithms are suitable for optimization problems because they are only concerned with finding extrema values. TRUE/FALSE?

TRUE

Whitespace matters in Python. TRUE FALSE

TRUE Python requires blocks of code to have the same indentation level. Improper indentation will crash Python scripts. This is a frustrating aspect of learning Python for many people so keep it in mind.

In a genetic algorithm what is the population? The state space The set of individuals The testing set The set of all data

The set of individuals

In each iteration, a reproduction operation is performed. How are the individuals for that chosen? They are chosen randomly with probabilities proportional to their relative fitness in the population. They are chosen from the population based solely on the fitness function Each selection is based on finding an individual based on the fitness function, unless a better individual can't be found. If this is the case, then the individual is chosen at random. They are chosen randomly with each having an equal probability of being chosen

They are chosen randomly with probabilities proportional to their relative fitness in the population.

Why are informed search algorithms considered faster than uninformed search algorithms? They expand fewer nodes. They avoid expanding nodes altogether. They don't need to account for a branching factor They only work on simpler problems

They expand fewer nodes.

___ problems must visit each node in a graph, wheras ___ problems only need to visit the goal node.

Touring, Route-Finding


Related study sets

6.1 Structure and Functions of the Lungs

View Set

Mental Health: Personality Disorders

View Set

Self-Check: 7.1-7.8, APES Unit 7, Chapters 12, 13, and 19 MCQs

View Set

CCNA Introduction to Networks Chapter 3

View Set

Public Speaking: Final Study Guide

View Set

TX Boater Education Certification Exam Review

View Set