Вы находитесь на странице: 1из 5

CS 4700 HW2

Jonathan Mares
October 18, 2016

Problem 1
Part A
The solution is: A->C->F->L->X The expected value of the move is 3. The next move from A
should be C

Part B
If we use alpha beta pruning, we will prune node S, node, K, node O, and node AA. Since we
prune nodes O and K, we will only evaluate 14- 2*1 -1 -1 = 10 leaves Pruning does not affect final
result, so well get the same result. Figure 1 shows the tree for both left to right and right to left
evaluations.

Part C
When we evaluate from right to left, we will prune D and its subtree as well as the leaf BB

Part D
The effectiveness of alpha beta pruning is dependent on the evaluation order. If the children of
nodes are visited in the worst possible order, no pruning may happen. One thing we can do is for
max nodes, visit the best child first so we dont waste time exploring worse scenarios. Likewise,
for min nodes, we want to visit the worse of the children first to get the best minimum bound. We
can either rank the nodes, or use previous history of algorithm runs to rank nodes.

Part E
Since we are evaluating going forward, we may take advantage of pruning, which limits the number
of nodes we need to visit. If you start from the bottom, youll have to visit all the nodes because
you dont know which ones you wont need to visit.

Figure 1: Alpha Beta Tree for Part B and C. Square nodes indicated pruned nodes/subtrees
(squares include children nodes as well, but not shown) in the left to right direction. Circled
subtrees indicate pruned nodes/subtrees for the right to left evaluation

Problem 2

Part A
The player would not have a reason for making a different move because the goal is to win independent of how many moves made

Part B
Assuming min will act optimally, it doesnt seem to make sense to change moves, since weve
maximized our options based on what min chooses.

Problem 3

Part A
Figure 2 shows the game tree at this point in time. The move with highest expected value is move
3, with E = 0.1666.

Part B
A possible risk of using the expected value (Choice 3) is that if we roll a 1, we will automatically
lose if our current score is 0. An alternative could be to choose Move 2 for a few moves to try to
get a score above 0, followed by choosing choosing move 3 to try to win.

Figure 2: The search tree representing the point in the game

Problem 4
Part A
Part i
The key idea of local search is to greedily try to reach a better state by making local modifications.
You will select a random initiail state, make local modfiications to improve your current state, and
then repeat the previous until goal state is found or time has run out (or you cannot improve your
solution).
Part ii
Hill climbing is a basic greedy algorithm. it is possible for you to get stuck at a local max, trapping
you there, and therefore you may never find the absolute max. Assumming consistent tie breaking
procedures, it is also deterministic given a starting location. With simullated annealing, the basic
idea is that it is a noisy strategy to improve hill climbing. You will occassionally take steps in a
direction away from the solution. The goal here is to avoid getting stuck at a local maximum. It
is possible to vary the rate of randomly choosing a direction by decreasing the temperature slowly
over time.
Part iii
If the temperature is too low, then the ending solution may be close to the starting solution,
and approach a hill climbing algorithm. Having the starting temperature too high may result in
essentially a random search until the temperature is cooled down to a T that would result in a
simulated annealing algorithm.

Part B
Part i
Lets compute Z as T goes to :
X f (s)
X f (s)
4
4
1
2
Z=
e T =
e = e + e + e + e inf = 4 e0 = 4 + e2 = 0.5398
s

Given the stationary distribution from lecture, we have:


P (s) =

ef (s)/T
Z

Plugging in for T = and Z = 4:


e0
1
=
4
4
For all S, we have the probability the same at .25.
P (s) =

Part ii
We now have T = 1 Lets compute Z:
X f (s)
X f (s)
e 1 = e4 + e4 + e1 + e2 = 0.5398
Z=
e T =
s

Given the stationary distribution from lecture, we have:


P (s) =

ef (s)/T
Z

Lets plug in for s = 2 and s = 1


P (2) =

e2/1
= 0.2507
0.5398

e4/1
= 0.03393
0.5398
We can see that P (s1) is not greater than P (2).
P (1) =

Part C
Part i
They crossover producing 2 offspring: 01 101 (I11 + I22 ) 10 010 (I21 + I12 )
Part i
Apply crossover line at every position possible (9 possible positions, 18 total offspring, if we count
n=0 and n=8 as distinct choices) Well get a global optimal only at position 1, so the probaiblity
of getting a global optimal offspring is P = 19

Problem 5
Part A
We need to enforce that at least 1 team plays in a week k and in subslot j:
X1jk OR X2jk ...Xnjk
But we also need to enforce only one team can play in a subslot at a given time b and i are two
teams:
Xbjk OR Xijk
Well have O(n4 ) clauses.

Part B
Xbjk OR Xijk
These expression will all be ANDed. If each team plays at most once a week and every subslot has
exactly one team, then this implies each team plays exactly once a week.

Part C
Xijk AN D Xbjk => Yijk

Part E
All of the sets I provided are not redundant.

Вам также может понравиться