Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome.

Similar presentations


Presentation on theme: "Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome."— Presentation transcript:

1 Computer Simulation (2) Game Playing

2 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

3 Different types of Games Tower of HanoiSolitaire Chess Tic-Tac-Toe Go Backgammon Poker Deterministic Nondeterministic One Player Two Player

4 Using hill climbing for one player games 17384930687418 172089 15 7 12 5 18119257103228 136615 12 18 11 Start (higher = better)

5 Game Tree for two person game My Turn Your Turn My Turn Your Turn

6 Game Tree My Turn = ?? Your Turn My Turn Your Turn +1 +1+1 +1 a1a1 a2a2 +1 = I win -1 = you win

7 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 a1a1 a2a2 b1b1 b2b2 b3b3 b4b4

8 The Minimax Procedure 81311252151719 A B A B a1a1 a2a2 b1b1 b2b2 b3b3 b4b4 a1a1 a2a2 a3a3 a4a4 a5a5 a6a6 a7a7 a8a8 1) Work upwards, 2) B will always pick minimum, and 3) A will always pick maximum

9 What does Minimax predict A will do? 17384930687418 119257103228 A B A B a1a1 a2a2 b1b1 b2b2 b3b3 b4b4

10 Fighting Combinatorial Explosion  limit branching factor  pruning the search tree

11 Depth-First Search A B

12 Depth-First Search & Minimax 7 A 9 87 4 6 54 1 3 21 7 B

13 Alpha-Beta Pruning 7 A 9 87 6 6 ?? ? ? ?? 7 B AT LEAST 7 AT MOST 6 no need to visit other branches below this node

14 Alpha-Beta Pruning 7 A 9 87 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

15 Perfect Play with Connect 4 Play the game against the computer –http://www.farfarfar.com/games/connect_four/http://www.farfarfar.com/games/connect_four/ –http://www.pomakis.com/c4/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)http://encyclopedia.thefreedictionary.com/Connect%20Four

16 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

17 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

18 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

19 Comparing Brains & Computers BRAINSCOMPUTERS Neurons/organic Parallel computation Distributed Memory Unreliable parts Resistant to damage Not understood Conscious/Intelligent Silicon/ Metallic Serial Computation Localized Memory Reliable parts Vulnerable Understood ??

20 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?

21 Turing Test 1.Interrogator 2.Human 3.Computer Program Interrogator tries to determine who is the human and who is the Computer program

22 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.

23 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


Download ppt "Computer Simulation (2) Game Playing. Different Types of Games How many players? –One –Two Element of chance? –Deterministic –Nondeterministic Outcome."

Similar presentations


Ads by Google