Lecture 5CSE 140 - Intro to Cognitive Science1 Algorithmic Thinking III.

Slides:



Advertisements
Similar presentations
Solving N+k Queens Using Dancing Links Matthew A. Wolff Morehead State University May 19, 2006.
Advertisements

Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
BackTracking Algorithms
Place captured red pieces below Place captured blue pieces below Rules New Game Exit Left mouse click on piece – drag to desired location - left mouse.
CS 484 – Artificial Intelligence
Tic Tac Toe Architecture CSE 5290 – Artificial Intelligence 06/13/2011 Christopher Hepler.
September 26, 2012Introduction to Artificial Intelligence Lecture 7: Search in State Spaces I 1 After our “Haskell in a Nutshell” excursion, let us move.
Table of Contents Why Play Chess? Setting Up the Board Get to Know the Pieces Check and Checkmate What the Chess Pieces Are Worth Opening Goals Endgame.
Application of Artificial intelligence to Chess Playing Capstone Design Project 2004 Jason Cook Bitboards  Bitboards are 64 bit unsigned integers, with.
Welcome to the basics of chess. This is a graphically designed program that will help you learn how to play chess. By Amir and Mike, 9B.
Announcements Assignment #4 is due tonight. Last lab program is going to be assigned this Wednesday. ◦ A backtracking problem.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
Place captured red pieces here Place captured yellow pieces here To use as Kings Rules New Game Exit Left mouse click on piece – drag to desired location.
This time: Outline Game playing The minimax algorithm
CS 206 Introduction to Computer Science II 10 / 31 / 2008 Happy Halloween!!! Instructor: Michael Eckmann.
November 10, 2009Introduction to Cognitive Science Lecture 17: Game-Playing Algorithms 1 Decision Trees Many classes of problems can be formalized as search.
CS 206 Introduction to Computer Science II 11 / 03 / 2008 Instructor: Michael Eckmann.
MAE 552 – Heuristic Optimization Lecture 28 April 5, 2002 Topic:Chess Programs Utilizing Tree Searches.
CS 206 Introduction to Computer Science II 03 / 25 / 2009 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 11 / 09 / 2009 Instructor: Michael Eckmann.
Adversarial Search: Game Playing Reading: Chess paper.
S L E O A V S L I M P E R P R O B E L M
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Chess Merit Badge Chess Basics: Set Up the Board & Basic Rules by Joseph L. Bell © 2011.
Final Exam Chess Game.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Lecture 5 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
Game Playing.
AD FOR GAMES Lecture 4. M INIMAX AND A LPHA -B ETA R EDUCTION Borrows from Spring 2006 CS 440 Lecture Slides.
Agents that can play multi-player games. Recall: Single-player, fully-observable, deterministic game agents An agent that plays Peg Solitaire involves.
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
How to Play Chess By: John. Dedication I dedicate this project to my family because we all love chess.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
HPC Checkers By Andy Block Ryan Egan. Table of Contents Overview of Checkers ▫Overview of Checkers ▫Rules of the Game AI Theory The Program ▫Board ▫Sample.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
How to Play Chess. Name of Each Piece The relative values of the chess pieces 9 points 5 points 3+ points 3 points 1 point.
Summary of the Moves of Chess
Rules Of Chess!!!!!! By: Caylin Stappenbeck. Table Of Contents!!!! Rules*** Conclusion***
A game based off of the esteemed classic By: Tadziu Kosiara.
Today’s Topics Playing Deterministic (no Dice, etc) Games –Mini-max –  -  pruning –ML and games? 1997: Computer Chess Player (IBM’s Deep Blue) Beat Human.
Quoridor and Artificial Intelligence
Tessellations You will need two pieces of computer paper and a small piece of thick paper and your final paper.
Every chess master was once a beginner. Irving Chernev
Chess Strategies Component Skills Strategies Prototype Josh Waters, Ty Fenn, Tianyu Chen.
Game tree search Chapter 6 (6.1 to 6.3 and 6.6) cover games. 6.6 covers state of the art game players in particular. 6.5 covers games that involve uncertainty.
CHESS Basics for Beginners. BOARD SET-UP The letters go across the board in front of you. “White on right!” Each player has a white square in their right.
A Levoy PowerPoint Presentation
Pedagogical Possibilities for the 2048 Puzzle Game Todd W. Neller.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Search in State Spaces Problem solving as search Search consists of –state space –operators –start state –goal states A Search Tree is an efficient way.
Lecture 8CSE Intro to Cognitive Science1 Interpreting Line Drawings II.
CHESS Club.  The game of chess is over 1300 years old and is one of the most popular games in the world. It has received more total thought time than.
Adversarial Search 2 (Game Playing)
Some counting questions with the Rules of Chess. Chessboard and Chess pieces The game of chess is played on an 8-by-8 grid of alternately colored squares.
Last time: search strategies
Intro to Computer Science II
CS Fall 2016 (Shavlik©), Lecture 11, Week 6
Pengantar Kecerdasan Buatan
How To Play Chess (And other Information)
CHESS.
CPSC 322 Introduction to Artificial Intelligence
NIM - a two person game n objects are in one pile
The Alpha-Beta Procedure
Haskell Tips You can turn any function that takes two inputs into an infix operator: mod 7 3 is the same as 7 `mod` 3 takeWhile returns all initial.
Minimax strategies, alpha beta pruning
Minimax strategies, alpha beta pruning
Announcements Assignment #4 is due tonight. Last lab program is going to be assigned this Wednesday. ◦ A backtracking problem.
Unit II Game Playing.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Lecture 5CSE Intro to Cognitive Science1 Algorithmic Thinking III

Lecture 5CSE Intro to Cognitive Science2 Reprise….

Lecture 5CSE Intro to Cognitive Science3 Recursion  Recursion is the ability of an algorithm to be defined in terms of itself.  This may sound paradoxical, but sometimes we can define something in terms of a few base cases, where we just know the answer, and then build up more complex cases from these simple ``atomic'' cases.

Lecture 5CSE Intro to Cognitive Science4 Flood Fill: Recursion on Visual Arrays 1.Define flood(x, y, old_color, new_color) to be 2.if pixel-at(x,y) is old_color then 3.putpixel(x, y, new_color); 4.flood(x + 1, y, old_color, new_color); 5.flood(x, y - 1, old_color, new_color); 6.flood(x - 1, y, old_color, new_color); 7.flood(x, y + 1, old_color, new_color). x,y+1 x-1,yx,yx+1,y x,y-1

Lecture 5CSE Intro to Cognitive Science5 Flood Fill on a Standard Computer Let’s look at the behavior of this algorithm using a simulation from a Computer Graphics Class at MIT (See demo at Slide09.html)

Lecture 5CSE Intro to Cognitive Science6 On a “Serial” Computer, Recursion Is “Depth First” Operations after a recursive call are remembered until the recursive call is finished x+1,y

Lecture 5CSE Intro to Cognitive Science7 Flood Fill in Parallel: The First Point

Lecture 5CSE Intro to Cognitive Science8 Flood Fill in Parallel: The First Step

Lecture 5CSE Intro to Cognitive Science9 Flood Fill in Parallel: Called on X+1

Lecture 5CSE Intro to Cognitive Science10 Flood Fill in Parallel: First Step of x+1

Lecture 5CSE Intro to Cognitive Science11 Flood Fill in Parallel: Called on y-1

Lecture 5CSE Intro to Cognitive Science12 Flood Fill in Parallel: First step of y-1

Lecture 5CSE Intro to Cognitive Science13 Flood Fill in Parallel: Called on x-1

Lecture 5CSE Intro to Cognitive Science14 Flood Fill in Parallel: First step of x-1

Lecture 5CSE Intro to Cognitive Science15 Flood Fill in Parallel: Called on y+1

Lecture 5CSE Intro to Cognitive Science16 Flood Fill in Parallel: First step of y+1

Lecture 5CSE Intro to Cognitive Science17 Flood Fill in Parallel : First Pixel

Lecture 5CSE Intro to Cognitive Science18 Flood Fill in Parallel: First Step

Lecture 5CSE Intro to Cognitive Science19 Flood Fill in Parallel: Second Step

Lecture 5CSE Intro to Cognitive Science20 Flood Fill in Parallel: Third Step

Lecture 5CSE Intro to Cognitive Science21 Flood Fill in Parallel: Fourth Step

Lecture 5CSE Intro to Cognitive Science22 Flood Fill in Parallel: 5 th Step

Lecture 5CSE Intro to Cognitive Science23 Flood Fill in Parallel: 6 th Step

Lecture 5CSE Intro to Cognitive Science24 Flood Fill in Parallel: 7 th Step

Lecture 5CSE Intro to Cognitive Science25 Flood Fill in Parallel: 8 th Step

Lecture 5CSE Intro to Cognitive Science26 Flood Fill in Parallel: 9 th Step

Lecture 5CSE Intro to Cognitive Science27 Flood Fill in Parallel: 10 th Step

Lecture 5CSE Intro to Cognitive Science28 Flood Fill in Parallel: 11 th Step

Lecture 5CSE Intro to Cognitive Science29 Flood Fill in Parallel: 12 th Step

Lecture 5CSE Intro to Cognitive Science30 Flood Fill in Parallel: 13 th Step

Lecture 5CSE Intro to Cognitive Science31 Trees I think that I shall never see…..

Lecture 5CSE Intro to Cognitive Science32 Trees  Trees are one of the most important data structures available. We can use trees to represent any sort of hierarchical information: Flightless Flying Animal Mammal Bird Penguin Ostrich PigeonSparrow Dog ….. …

Lecture 5CSE Intro to Cognitive Science33 Tree Vocabulary  Trees are organized into:  Nodes: The points in the tree that bear labels;  Branches: The edges that connect the nodes;  Offspring: A node connected to another node by a downward path along a branch;  The Root: The node at the top of the tree. It is the offspring of no other node;  Leaves: Nodes that have no offspring are leaves.

Lecture 5CSE Intro to Cognitive Science34 Example: Game Trees We can represent a game like chess as a tree:  The root is the initial setup of the chess board; all the pieces are in their start position;  The offspring of a node are the board positions one legal move away from the position represented by the node;  The leaves are final game positions (checkmate, draw);  A legal game is a path along the nodes of the tree, starting from the root. The computer might play chess by representing the above tree and searching it for the best move given the current board position.

Lecture 5CSE Intro to Cognitive Science35 Hexapawn: A very Simple Game  Hexapawn is played on a chessboard cut down to 3x3 squares. A player can move a pawn directly forward one square onto an empty square or move a pawn diagonally forward one square, provided that square contains an opponents pawn. The opponents pawn is removed from the board.  A player wins the game when: One of that players pawns reaches the far side of the board. The player’s opponent cannot move because no legal move is possible. The player’s opponent has no pawns left.

Lecture 5CSE Intro to Cognitive Science36 Hexapawn: Three Possible First Moves  A game tree represents each option           

Lecture 5CSE Intro to Cognitive Science37 Hexapawn: The Game Tree for 2 Moves                    

Lecture 5CSE Intro to Cognitive Science38 Hexapawn: The Game Tree for 2 Moves                       

Lecture 5CSE Intro to Cognitive Science39 Hexapawn: The Game Tree for 2 Moves                                

Lecture 5CSE Intro to Cognitive Science40 How Good Is This Response?                                 ?

Lecture 5CSE Intro to Cognitive Science41 Hexapawn: Third Move Options I             WIN!

Lecture 5CSE Intro to Cognitive Science42 Hexapawn: Third Move Options I             WIN! X From the Game Tree analysis, we learn that black must take the pawn.

Lecture 5CSE Intro to Cognitive Science43 Hexapawn: Third Move Options II             WIN! X                Black to win!

Lecture 5CSE Intro to Cognitive Science44 Hexapawn: Third Move Options II             WIN! X                Black to win! XX