game search problems Flashcards

1
Q

formalise a game problem

A

States : 𝑆 (Start State 𝑠0)
β—† Actions: 𝐴 (may depend on player/state)
β—† Transition function: 𝑆 Γ— 𝐴 β†’ 𝑆
β—† Terminal test: 𝑆 β†’ (π‘‘π‘’π‘Ÿπ‘’, π‘“π‘Žπ‘™π‘ π‘’)
β—† Players: 𝑃 = (1, … , 𝑁) (usually take turns)
β—† Utilities: π‘†π‘‘π‘’π‘Ÿπ‘šπ‘–π‘›π‘Žπ‘™ Γ— 𝑃 β†’ 𝑅 (values on outcomes)

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

what is a utility function

A

utility function is the function that defines the final numeric value of a game that ends in a terminal state S for player P
(also known as objective function or payoff function)

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

what is a transition function in a game problem

A

s ->. state
a -> action
tf : s * a –> s

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

what is the terminal test in a game problem

A

s –> (true,false)

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

what is the uility in a game problem

A

p -> players
R –> results
can usually be 1… n
U: S terminal * p –> R (values on outcome)

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

what are other names the utitlity function can be called

A

objective function
payoff function

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

what is minimax

A

Minimax value of a node is the utility of the terminal state to
which both players play optimally from that node.

So the process of a two-player game is that one player (called
player Max) is to maximise its utility whereas its opponent
(called player Min) is to minimise the utility of Max

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

how would minimax affect a two player game

A

find a node where thea player can maxmise the utiltiy whereas the opponent can minimse the other player’s utiltity

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

write the code for the minimax function

A

function minimax_value (state) return its minimax value
if state is a terminal state
return its utility
if state is for agent Max to take an action
return max_value(state)
if state is for agent Min to take an action
return min_value(state)

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

write the code for function max_value in the minimax function

A

function max_value (state) return its minimax value 𝑣
initialise 𝑣 = βˆ’βˆž
for each successor of state
𝑣 = max(𝑣, π‘šπ‘–π‘›π‘–π‘šπ‘Žπ‘₯ _π‘£π‘Žπ‘™π‘’π‘’(π‘ π‘’π‘π‘π‘’π‘ π‘ π‘œπ‘Ÿ))
return 𝑣

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

write the code for function min_value in the minimax function

A

function min_value (state) return its minimax value 𝑣
initialise 𝑣 = +∞
for each successor of state
𝑣 = min(𝑣, π‘šπ‘–π‘›π‘–π‘šπ‘Žπ‘₯ _π‘£π‘Žπ‘™π‘’π‘’(π‘ π‘’π‘π‘π‘’π‘ π‘ π‘œπ‘Ÿ))
return 𝑣

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

what type of games is minimax used for

A

deterministic
zero sum games

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

how efficient is minimax

A

it uses depth first search which is exhaustive
time complexity is O(b^m)
b -> branching factor
m -> maximum depth of the tree
space : O(bm)
Solving them is completely infeasible in most cases

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

what is the time complexity for minimax algorithm

A

O(b^m)
b -> branching factor
m -> maximum depth of node

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

what is the space complexity for minimax algorithm

A

O(bm)
b -> branching factor
m -> maximum depth of node

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

what is the general configuration for alpha - beta pruning

A

Let π‘Ž be the value that Max can currently get at least.
β—† We are now computing the min_value at some node 𝑛
β—† When we explore 𝑛’s children, if we find that the value
of 𝑛 will never be better than π‘Ž (for agent Max), then
we can stop considering 𝑛’s other children