Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two...
-
date post
19-Dec-2015 -
Category
Documents
-
view
230 -
download
0
Transcript of Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two...
![Page 1: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/1.jpg)
Computer Simulation (2)Game Playing
![Page 2: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/2.jpg)
Different Types of Games
• How many players?– One– Two
• Element of chance?– Deterministic– Nondeterministic
• Outcome– Zero sum (what one player wins, the other loses)– Non-zero sum
![Page 3: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/3.jpg)
Different types of Games
Tower of Hanoi Solitaire
Chess
Tic-Tac-Toe
Go
Backgammon
Poker
Deterministic Nondeterministic
One Player
TwoPlayer
![Page 4: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/4.jpg)
Using hill climbing for one player games
17 38 49 30 68 7 4 18
17 20 8 9
15 7
12
5
18 11 9 25 7 10 32 28
13 6 6 15
12 18
11
Start
(higher = better)
![Page 5: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/5.jpg)
Game Tree for two person game
My Turn
Your Turn
My Turn
Your Turn
![Page 6: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/6.jpg)
Game TreeMy
Turn = ??
Your Turn
My Turn
Your Turn
+1 +1 +1 +1 +1 +1 +1 +1 -1 +1 -1 +1 +1 -1 +1 -1
a1 a2
+1 = I win -1 = you win
![Page 7: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/7.jpg)
Perfect decisions with two player games
• Each player will make the best decisions possible:
Player A: maximize score (higher scores better for A)
Player B: minimize score (lower scores better for B)
7 6 5 68
A
B
a1 a2
b1 b2 b3 b4
![Page 8: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/8.jpg)
The Minimax Procedure
8 13 11 25 21 5 17 19
A
B
A
B
a1 a2
b1b2 b3
b4
a1 a2 a3 a4 a5 a6 a7 a8
1) Work upwards, 2) B will always pick minimum, and 3) A will always pick maximum
![Page 9: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/9.jpg)
What does Minimax predict A will do?
17 38 49 30 68 7 4 18 18 11 9 25 7 10 32 28
A
B
A
B
a1 a2
b1b2 b3
b4
![Page 10: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/10.jpg)
Fighting Combinatorial Explosion
limit branching factor
pruning the search tree
![Page 11: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/11.jpg)
Depth-First Search
A
B
![Page 12: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/12.jpg)
Depth-First Search & Minimax
7
A
9 8 7
4
6 5 4
1
3 2 1
7
B
![Page 13: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/13.jpg)
Alpha-Beta Pruning
7
A
9 8 7
6
6 ? ?
?
? ? ?
7
B
AT LEAST 7
AT MOST 6no need to visit other branchesbelow this node
![Page 14: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/14.jpg)
Alpha-Beta Pruning
7
A
9 8 7
6
6 ? ?
3
3 ? ?
7
B
Some states do not need to be searched!The alpha-beta method cleverly eliminates large part of the search space
![Page 15: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/15.jpg)
Perfect Play with Connect 4
• Play the game against the computer– http://www.farfarfar.com/games/connect_four/– http://www.pomakis.com/c4/
• Perfect play – the game of Connect 4 can be planned to the end
• the first player can force a win by starting in the middle column. Starting in the two adjacent columns allows the second player to reach a draw; starting with the border columns even allows the second player to force a win.
• Why play the game if the outcome is already known (assuming perfect play)?
(content copied from http://encyclopedia.thefreedictionary.com/Connect%20Four)
![Page 16: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/16.jpg)
Complexity of Game Trees
• Most games cannot be planned to the end -> combinatorial explosion
• Number of states to search = (N)D
– Branching factor (N):number of legal moves at each position (on average)
– Depth (D) = number of moves till the end
![Page 17: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/17.jpg)
Branching factor
• Chess:
Branching factor = about 35 moves/ positions
Depth = about 100 moves total
(35)100 ≈ (10)120 number of positions to search
• Intelligent Search: decrease the branching factor
(35)2=1225 (35)6=1,838,265,625 vs.:
(5)2=25 (5)6=15,625
![Page 18: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/18.jpg)
Chess Computers
• 1997: IBM’s Deep blue played world champion Gary Kasparov
Deep blue: 250,000,000 positions/sec
Kasparov: ?? positions/sec
• Brute force vs. Intelligent search
![Page 19: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/19.jpg)
Comparing Brains & Computers
BRAINS COMPUTERS
Neurons/organicParallel computationDistributed MemoryUnreliable partsResistant to damageNot understood
Conscious/Intelligent
Silicon/ MetallicSerial ComputationLocalized MemoryReliable partsVulnerableUnderstood
??
![Page 20: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/20.jpg)
Ask Yourself
Do you consider your own mind to be a bunch of software programs? Probably not!
Turing's challenge was this:
Can you really say what the difference is between the mind of a human being and the artificial 'mind' of a computer which simulates a human mind?
![Page 21: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/21.jpg)
Turing Test
1.Interrogator2.Human3.Computer Program
Interrogator tries to determine who is the human and who is theComputer program
![Page 22: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/22.jpg)
Loebner Prize
JUDGE: Is it April or May?ENTRANT: Um. I believe it's April.JUDGE: Why do you say that?ENTRANT: That's a very good question. Because months and days and so on are arbitrary - I suppose.JUDGE: It seems you are taking a certain tone with me. An agitated, human tone.ENTRANT: Really? You are somewhat reticent yourself.JUDGE: I never said you were reticent.ENTRANT: I know.JUDGE: Smug.ENTRANT: Moi*?JUDGE: I think you might be human.
![Page 23: Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.](https://reader030.fdocuments.net/reader030/viewer/2022033103/56649d3a5503460f94a13ff2/html5/thumbnails/23.jpg)
Some clever programs
– Computer therapist ELIZA: • http://www-ai.ijs.si/eliza/eliza.html• http://www.manifestation.com/neurotoys/eliza.php3
– Modern chatter boxes:• http://cogsci.ucsd.edu/~asaygin/tt/ttest.html• http://www.abenteuermedien.de/jabberwock/• http://www.turinghub.com/turinghub.html
– Computer programs that learn: 20 Questions• http://y.20q.net:8095/btest