wrap-up first unit motivating logic in ai
DESCRIPTION
Wrap-up First Unit Motivating Logic in AI. Exam #1. My general impression as I graded the exams: You understood the general idea(s) but not the specifics/details You were able to say things that made sense, but you couldn’t identify the key ideas that show that you GET IT. Exam #1. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/1.jpg)
Game Playing
![Page 2: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/2.jpg)
![Page 3: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/3.jpg)
Pruning
• Pruning is used to narrow the search down– e.g. if we find a branch where we will win no
matter what, we don’t need to search that part of the tree anymore
– And if we find a guaranteed losing line we don’t need to search that part of tree any more
![Page 4: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/4.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2
1-1-1-3 1-1-2-2
2-2-21-2-31-1-4
1-5 2-4
6
3-3
Max moves
Min moves
Max moves
Min moves
![Page 5: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/5.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2
1-1-1-3 1-1-2-2
2-2-21-2-31-1-4
1-5 2-4
6(?)
3-3
Max moves
Min moves
Max moves
Min moves
![Page 6: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/6.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2
1-1-1-3 1-1-2-2
2-2-21-2-31-1-4
1-5(?) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 7: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/7.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2
1-1-1-3 1-1-2-2
2-2-21-2-3(?)1-1-4(?)
1-5(?) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 8: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/8.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2
1-1-1-3(?) 1-1-2-2(?)
2-2-21-2-3(?)1-1-4(?)
1-5(?) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 9: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/9.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2(?)
1-1-1-3(?) 1-1-2-2(?)
2-2-21-2-3(?)1-1-4(?)
1-5(?) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 10: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/10.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2(-1)
1-1-1-3(?) 1-1-2-2(?)
2-2-21-2-3(?)1-1-4(?)
1-5(?) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 11: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/11.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2(-1)
1-1-1-3(-1) 1-1-2-2(?)
2-2-21-2-3(?)1-1-4(?)
1-5(?) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 12: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/12.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2(-1)
1-1-1-3(-1) 1-1-2-2(1)
2-2-21-2-3(?)1-1-4(?)
1-5(?) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 13: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/13.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2(-1)
1-1-1-3(-1) 1-1-2-2(1)
2-2-21-2-3(?)1-1-4(1)
1-5(?) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 14: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/14.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2(-1)
1-1-1-3(-1) 1-1-2-2(1)
2-2-21-2-3(1)1-1-4(1)
1-5(?) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 15: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/15.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2(-1)
1-1-1-3(-1) 1-1-2-2(1)
2-2-21-2-3(1)1-1-4(1)
1-5(1) 2-4(?)
6(?)
3-3(?)
Max moves
Min moves
Max moves
Min moves
![Page 16: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/16.jpg)
MiniMax
• NIM Search tree
1-1-1-1-2(-1)
1-1-1-3(-1) 1-1-2-2(1)
2-2-21-2-3(1)1-1-4(1)
1-5(1) 2-4(?)
6(1)
3-3(?)
Max moves
Min moves
Max moves
Min moves
X X
X
![Page 17: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/17.jpg)
Alpha Beta Pruning
• A generalized pruning procedure– During our depth-first search we remember
• The score of the best choice so far for Max, alpha• And the best score so far for Min, beta
– If we find a point where MIN can choose a move with the utility ≤ alpha. Then we can stop search there since
• MAX will not choose a move since there are a alternative route that is better. (Where alpha was found)
![Page 18: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/18.jpg)
Alpha-Beta (-) Pruning Example
≥ 3
3
3
MAX
MIN
MAX12 8
≤ 2
2 14 5
≤ 14
2
≤5 2
![Page 19: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/19.jpg)
Alpha Beta Pruning
• What can it do for us?– Allows deeper searches without penalty– Allows deeper searches at same time cost
• The result is always the same as without pruning, but a lot faster
![Page 20: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/20.jpg)
Do Exact Values Matter?
![Page 21: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/21.jpg)
MiniMax and Heuristics
• What about more complex games?– If the search space is too large
• We could use a heuristic function to determine which nodes to expand first. (Not very useful though)
• Limit our depth and when we reach a certain depth we evaluate the current standing there
• After evaluating we use MiniMax as usual
![Page 22: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/22.jpg)
MiniMax and heuristics
• Practically, rather than implement MiniMax, we implement MiniCutoff– Don’t build the whole tree. Takes lots of
memory.– Limit the depth of “look ahead”– Use a utility function rather than an evaluation
function.
![Page 23: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/23.jpg)
Cutting Off Search
![Page 24: Wrap-up First Unit Motivating Logic in AI](https://reader036.vdocument.in/reader036/viewer/2022062500/56815b07550346895dc8b6e1/html5/thumbnails/24.jpg)
Cutting Off Search• Issues
– Quiescence• Play has “settled down”• Evaluation function unlikely to exhibit wild swings in value in near
future– Horizon effect
• “Stalling for time”• Postpones inevitable win or damaging move by opponent
• Solutions?– Quiescence search: expand non-quiescent positions further– No general solution to horizon problem at present