UNIT 13A AI: Games & Search Strategies. Announcements

Similar documents
UNIT 13A AI: Games & Search Strategies

V. Adamchik Data Structures. Game Trees. Lecture 1. Apr. 05, Plan: 1. Introduction. 2. Game of NIM. 3. Minimax

Adversarial Search (Game Playing)

Foundations of AI. 5. Board Games. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard and Luc De Raedt SA-1

A.M. Turing, computer pioneer, worried about intelligence in humans & machines; proposed a test (1950) thinks with electricity

Progress has been tremendous. Lawrence Snyder University of Washington, Seattle

Monte Carlo Tree Search

Foundations of Artificial Intelligence

Game Playing State-of-the-Art CSE 473: Artificial Intelligence Fall Deterministic Games. Zero-Sum Games 10/13/17. Adversarial Search

CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #5

Foundations of Artificial Intelligence

Foundations of AI. 6. Board Games. Search Strategies for Games, Games with Chance, State of the Art

Adversarial Search Aka Games

CPS331 Lecture: Search in Games last revised 2/16/10

Game Playing. Garry Kasparov and Deep Blue. 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.

CS 188: Artificial Intelligence Spring Announcements

Announcements. CS 188: Artificial Intelligence Spring Game Playing State-of-the-Art. Overview. Game Playing. GamesCrafters

Unit 12: Artificial Intelligence CS 101, Fall 2018

Adversary Search. Ref: Chapter 5

game tree complete all possible moves

CMPUT 396 Tic-Tac-Toe Game

CS 188: Artificial Intelligence

What is Artificial Intelligence? Alternate Definitions (Russell + Norvig) Human intelligence

CS2212 PROGRAMMING CHALLENGE II EVALUATION FUNCTIONS N. H. N. D. DE SILVA

Game Playing AI Class 8 Ch , 5.4.1, 5.5

Foundations of AI. 6. Adversarial Search. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard & Bernhard Nebel

Contents. Foundations of Artificial Intelligence. Problems. Why Board Games?

The Mathematics of Playing Tic Tac Toe

Artificial Intelligence Adversarial Search

Programming Project 1: Pacman (Due )

Artificial Intelligence Search III

GAMES COMPUTERS PLAY

Game-playing AIs: Games and Adversarial Search FINAL SET (w/ pruning study examples) AIMA

CS 4700: Foundations of Artificial Intelligence

Games (adversarial search problems)

mywbut.com Two agent games : alpha beta pruning

CS 331: Artificial Intelligence Adversarial Search II. Outline

Adversarial Search. Human-aware Robotics. 2018/01/25 Chapter 5 in R&N 3rd Ø Announcement: Slides for this lecture are here:

Computer Science and Software Engineering University of Wisconsin - Platteville. 4. Game Play. CS 3030 Lecture Notes Yan Shi UW-Platteville

CS 5522: Artificial Intelligence II

COMP219: Artificial Intelligence. Lecture 13: Game Playing

Artificial Intelligence

Adversarial Search and Game Playing. Russell and Norvig: Chapter 5

Game Playing AI. Dr. Baldassano Yu s Elite Education

Playing Games. Henry Z. Lo. June 23, We consider writing AI to play games with the following properties:

COMP219: COMP219: Artificial Intelligence Artificial Intelligence Dr. Annabel Latham Lecture 12: Game Playing Overview Games and Search

CS 188: Artificial Intelligence Spring Game Playing in Practice

2 person perfect information

CSE 573: Artificial Intelligence Autumn 2010

CSE 473: Artificial Intelligence. Outline

CS 188: Artificial Intelligence. Overview

Outline. Game Playing. Game Problems. Game Problems. Types of games Playing a perfect game. Playing an imperfect game

Announcements. CS 188: Artificial Intelligence Fall Local Search. Hill Climbing. Simulated Annealing. Hill Climbing Diagram

6. Games. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Mechanical Turk. Origins. origins. motivation. minimax search

Local Search. Hill Climbing. Hill Climbing Diagram. Simulated Annealing. Simulated Annealing. Introduction to Artificial Intelligence

Announcements. Homework 1. Project 1. Due tonight at 11:59pm. Due Friday 2/8 at 4:00pm. Electronic HW1 Written HW1

CS 2710 Foundations of AI. Lecture 9. Adversarial search. CS 2710 Foundations of AI. Game search

CITS3001. Algorithms, Agents and Artificial Intelligence. Semester 2, 2016 Tim French

Today. Types of Game. Games and Search 1/18/2010. COMP210: Artificial Intelligence. Lecture 10. Game playing

Artificial Intelligence

CS 1571 Introduction to AI Lecture 12. Adversarial search. CS 1571 Intro to AI. Announcements

CS 771 Artificial Intelligence. Adversarial Search

Game Playing State of the Art

Game Playing. Why do AI researchers study game playing? 1. It s a good reasoning problem, formal and nontrivial.

Conversion Masters in IT (MIT) AI as Representation and Search. (Representation and Search Strategies) Lecture 002. Sandro Spina

Artificial Intelligence. Topic 5. Game playing

Lecture 33: How can computation Win games against you? Chess: Mechanical Turk

Artificial Intelligence. Minimax and alpha-beta pruning

Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur

Game-Playing & Adversarial Search

Google DeepMind s AlphaGo vs. world Go champion Lee Sedol

Adversarial Search. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 9 Feb 2012

CS 188: Artificial Intelligence Spring 2007

Last update: March 9, Game playing. CMSC 421, Chapter 6. CMSC 421, Chapter 6 1

Ar#ficial)Intelligence!!

Computer Science 1400: Part #8: Where We Are: Artificial Intelligence WHAT IS ARTIFICIAL INTELLIGENCE (AI)? AI IN SOCIETY RELATING WITH AI

Welcome to CSC384: Intro to Artificial MAN.

Game Playing. Philipp Koehn. 29 September 2015

Wednesday, February 1, 2017

CS360: AI & Robotics. TTh 9:25 am - 10:40 am. Shereen Khoja 8/29/03 CS360 AI & Robotics 1

Adversarial Search and Game- Playing C H A P T E R 6 C M P T : S P R I N G H A S S A N K H O S R A V I

Announcements. CS 188: Artificial Intelligence Fall Today. Tree-Structured CSPs. Nearly Tree-Structured CSPs. Tree Decompositions*

Artificial Intelligence Lecture 3

Game Playing State-of-the-Art

Game-Playing & Adversarial Search Alpha-Beta Pruning, etc.

: Principles of Automated Reasoning and Decision Making Midterm

Games and Adversarial Search II

Monday, February 2, Is assigned today. Answers due by noon on Monday, February 9, 2015.

CPS 570: Artificial Intelligence Two-player, zero-sum, perfect-information Games

AI in Business Enterprises

Adversarial Search. CMPSCI 383 September 29, 2011

CS 188: Artificial Intelligence

ARTIFICIAL INTELLIGENCE (CS 370D)

Adversarial Search Lecture 7

History and Philosophical Underpinnings

CSC321 Lecture 23: Go

LECTURE 1: OVERVIEW. CS 4100: Foundations of AI. Instructor: Robert Platt. (some slides from Chris Amato, Magy Seif El-Nasr, and Stacy Marsella)

CSC384 Intro to Artificial Intelligence* *The following slides are based on Fahiem Bacchus course lecture notes.

Adversarial Search: Game Playing. Reading: Chapter

Solving Problems by Searching: Adversarial Search

Transcription:

UNIT 13A AI: Games & Search Strategies 1 Announcements Do not forget to nominate your favorite CA bu emailing gkesden@gmail.com, No lecture on Friday, no recitation on Thursday No office hours Wednesday, Thursday and Friday. We will resume on Saturday. We will announce a review session for Sunday. Stay tuned. 2 1

Artificial Intelligence Branch of computer science that studies the use of computers to perform computational processes normally associated with human intellect and skill. Some areas of AI: Game playing Knowledge representation Robotics Machine learning Natural language processing Speech & Vision John McCartrhy, Marvin Minsky (Stanford, MIT) Allen Newell and Herbert Simon (CMU) General Problem Solver (GPS) in 1957 Received the Turing Award in 1975 for "basic contributions to artificial intelligence, the psychology of human cognition, and list processing." Newell Simon 3 A Cynic s View AI is the study of how to get computers to do things we don t understand. thinking, learning, creativity, etc. When we do understand something, it s no longer AI: it s just programming. 4 2

Game Trees For most games, the number of possible moves and potential outcomes is HUGE. An AI technique used to manage this computation is the use of a game tree. A tree is built with a root node representing the current state of the game. Child nodes are generated representing the state of the game for each possible move. The tree is propagated down, building more child nodes for moves allowed by the next move, etc. Leaves are terminal states of the game. 5 Tic Tac Toe A pencil and paper game for two players, and O, who take turns marking the spaces in a 3 3 grid. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game. The following example game is won by the first player, : Source: Wikipedia 6 3

Tic Tac Toe (Not Huge) O O O O O O O O 7 How Big is the Tic Tac Toe Tree? Assuming that all nine positions must be filled before the game ends, how big does this tree get? (The number of possible different games) Of course, in real Tic Tac Toe, a player can win without filling the whole board. What is the first level of the tree where this can occur? How big is this tree up to this level? 8 4

How Big is the Tic Tac Toe Tree? Assuming that all nine positions must be filled before the game ends, how big does this tree get? Bounded above by 9*8*7*6*5*4*3*2*1 = 9! = 362880 Of course, in real Tic Tac Toe, a player can win without filling the whole board. What is the first level of the tree where this can occur? Ending on the 5 th move. 3s, 2 Os How big is this tree up to this level? 9*8*7*6*5 9 More Exact Calculations All games should continue until either all nine squares are filled or someone has three in a row (or both), so there must be at least five marks. So all we have to do is find how many games end with five marks, and similarly how many with six, seven, eight, or nine. For nine, there are two possibilities: either someone has won on their ninth move, or it is a draw with no three in a row. Furthermore, if board symmetries are taken into account, two games are considered the same if rotating and/or reflecting the board makes one of the games into a copy of the other game. 10 5

Tic Tac Toe Is Completely Searchable For the first move, pick a square at random. (Always picking the same square would be boring.) For subsequent moves: Using recursion, grow the entire game tree with the current board state as the root For each child of the root, count how many games below that child end in a win. Pick the child with the most wins. 11 For the Enthusiast If you are interested in optimal strategies see the next 9 slides. 12 6

KCD s Optimal Tic Tac Toe http://xkcd.com/832 13 14 7

Move 1 15 O Move 1 16 8

Move 2 17 O Move 2 18 9

Move 3 19 O Move 3 20 10

Move 4 To Win 21 Dealing With Huge Search Spaces How does a computer program that plays chess or go deal with the huge size of the game trees that can be generated? In chess, the average number of possible next moves is around 35, and the average number of moves in a chess game is around 100, so the number of possibilities a computer must check is about 35 100, which is beyond hope, even for our fastest computers! These programs use heuristics to narrow the search space in the tree that must be examined 22 11

Heuristics Human thought is not purely deductive. It often relies on approximations or analogies. A heuristic is a rule of thumb that may not always be correct but usually gives useful results. Heuristic algorithms are helpful because they can find a reasonably good solution to a problem without requiring excessive search. 23 AI Opponents Consider the game of Pente. Players alternate, placing their stones on the game board at the intersection of lines, one at a time. The object of the game is to be the first player to either get five stones in a straight line or capture 5 pairs of stones of the other player. Capture means two adjacent stones surrounded by opponent stones. Captured stones are removed. If we were write a computer program to play Pente against a human player, how does the computer calculate its moves when there are a huge amount of possibilities to consider? 24 12

Black Wins With 5 In A Row 25 Capture in Pente 26 13

Black To Move; White Will Win 27 Heuristics Important board features to look for in Pente: Check for x pieces in a row. Check for capture possibilities. Check for x pieces in a row for opponent. Check for opponent s potential to make a capture. Where is the opponent likely to put a stone? http://www.generation5.org/content/2000/boardai.asp 28 14

Heuristics Important board features to look for in Pente: Check for x pieces in a row. Check for capture possibilities. Check for x pieces in a row for opponent. Check for opponent s potential to make a capture. Compute a feature score and choose squares with high value: Example: threat score. Code each cell based on number of opponent pieces in same row, column and diagonal. http://www.generation5.org/content/2000/boardai.asp 29 Deep Blue IBM's "Deep Blue" computer beats Gary Kasparov in a chess match in 1997. Heuristics values: The value of each piece. (1 for pawn up to 9 for queen) The amount of control each side has over the board. The safety of the king. The quickness that pieces move into fighting position. For more info: http://www.research.ibm.com/deepblue/home/html/b.html Is Deep Blue intelligent? 30 15

Chinook Created by computer scientists from the University of Alberta to play checkers (draughts) in 1989. In 2007, the team led by Jonathan Schaeffer announced that Chinook could never lose a game. Checkers had been solved: the best a player playing against Chinook can achieve is a draw. Chinook's algorithms featured: a library of opening moves from games played by grandmasters a deep search algorithm a good move evaluation function (based on piece count, kings count, trapped kings, player s turn, runaway checkers, etc.) an end game database for all positions with eight pieces or fewer. and other minor factors. Is Chinook intelligent? 31 The Imitation Game (Turing Test) Proposed by Alan Turing in 1948. A human interrogator communicates with two players via teletype. One player is human, the other a machine. Each tries to convince the interrogator that he is the human. If the interrogator can t tell which player is human, the machine must be intelligent. 32 16

From Turing s Paper Shakespeare s Sonnet 18 Interrogator: In the first line of your sonnet which reads Shall I compare thee to a summer s day, would not a spring day do as well or better? Computer: It wouldn t scan. Interrogator: How about a winter s day? That would scan all right. Computer: Yes, but nobody wants to be compared to a winter s day. 33 Interrogator: Would you say Mr. Pickwick reminded you of Christmas? Computer: In a way. Interrogator: Yet Christmas is a winter s day, and I do not think Mr. Pickwick would mind the comparison. Computer: I don t think you re serious. By a winter s day one means a typical winter s day, not a special one like Christmas. Dickens character 34 17

Watson IBM's Watson" computer beats champions Ken Jennings and Brad Rutter in a 2 game match on Jeopardy! in 2011. Watson parsed clues into different keywords and fragments. Watson had 4TB of data content but was not connected to the Internet during the game. Watson executed 1000s of proven language analysis algorithms concurrently. The more algorithms that pointed to the same answer, the more confident Watson was and the more likely it would buzz in. Is Watson intelligent? 35 Consumer Robotics DARPA Urban Challenge Google Driverless Car Now legal in Nevada, Florida, and California 36 18