Solving Problems by Searching

Similar documents
Problem Solving and Search

Homework #1-19: Use the Counting Principle to answer the following questions.

Foundations of AI. 3. Solving Problems by Searching. Problem-Solving Agents, Formulating Problems, Search Strategies

Lesson 10: Using Simulation to Estimate a Probability

Math 146 Statistics for the Health Sciences Additional Exercises on Chapter 3

STAT 430/510 Probability Lecture 3: Space and Event; Sample Spaces with Equally Likely Outcomes

Foundations of AI. 3. Solving Problems by Searching. Problem-Solving Agents, Formulating Problems, Search Strategies

Solving Problems by Searching

CS 361: Probability & Statistics

Spring 06 Assignment 2: Constraint Satisfaction Problems

Spring 06 Assignment 2: Constraint Satisfaction Problems

Name: Class: Date: Probability/Counting Multiple Choice Pre-Test

Grade 6 Math Circles Fall Oct 14/15 Probability

Chapter 8: Probability: The Mathematics of Chance

UNIT 4 APPLICATIONS OF PROBABILITY Lesson 1: Events. Instruction. Guided Practice Example 1

Probability and Statistics. Copyright Cengage Learning. All rights reserved.

Counting methods (Part 4): More combinations

FALL 2012 MATH 1324 REVIEW EXAM 4

A Historical Example One of the most famous problems in graph theory is the bridges of Konigsberg. The Real Koningsberg

1. Compare between monotonic and commutative production system. 2. What is uninformed (or blind) search and how does it differ from informed (or

Probability Assignment

1) What is the total area under the curve? 1) 2) What is the mean of the distribution? 2)

Probability of Independent and Dependent Events

: Principles of Automated Reasoning and Decision Making Midterm

In how many ways can the letters of SEA be arranged? In how many ways can the letters of SEE be arranged?

EECS 203 Spring 2016 Lecture 15 Page 1 of 6

Probability: Terminology and Examples Spring January 1, / 22

Chapter 4: Introduction to Probability

Adversarial Search. Rob Platt Northeastern University. Some images and slides are used from: AIMA CS188 UC Berkeley

Practice Session 2. HW 1 Review

CPS331 Lecture: Heuristic Search last revised 6/18/09

Homework Assignment #1

= = 0.1%. On the other hand, if there are three winning tickets, then the probability of winning one of these winning tickets must be 3 (1)

NumberSense Companion Workbook Grade 4

Math 147 Elementary Probability/Statistics I Additional Exercises on Chapter 4: Probability

Fdaytalk.com. Outcomes is probable results related to an experiment

heads 1/2 1/6 roll a die sum on 2 dice 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1, 2, 3, 4, 5, 6 heads tails 3/36 = 1/12 toss a coin trial: an occurrence

Section Marks Agents / 8. Search / 10. Games / 13. Logic / 15. Total / 46

3. a. P(white) =, or. b. ; the probability of choosing a white block. d. P(white) =, or. 4. a. = 1 b. 0 c. = 0

MATH CALCULUS & STATISTICS/BUSN - PRACTICE EXAM #1 - SPRING DR. DAVID BRIDGE

TJP TOP TIPS FOR IGCSE STATS & PROBABILITY

AIMA 3.5. Smarter Search. David Cline

CS 171, Intro to A.I. Midterm Exam Fall Quarter, 2016

Informed search algorithms. Chapter 3 (Based on Slides by Stuart Russell, Richard Korf, Subbarao Kambhampati, and UW-AI faculty)

STOR 155 Introductory Statistics. Lecture 10: Randomness and Probability Model

Combinatorics: The Fine Art of Counting

b. 2 ; the probability of choosing a white d. P(white) 25, or a a. Since the probability of choosing a

Probability Exercise 2

Search then involves moving from state-to-state in the problem space to find a goal (or to terminate without finding a goal).

Class XII Chapter 13 Probability Maths. Exercise 13.1

Algebra I Notes Unit One: Real Number System

Outline for today s lecture Informed Search Optimal informed search: A* (AIMA 3.5.2) Creating good heuristic functions Hill Climbing

STAT 155 Introductory Statistics. Lecture 11: Randomness and Probability Model

UNIVERSITY of PENNSYLVANIA CIS 391/521: Fundamentals of AI Midterm 1, Spring 2010

Probability --QUESTIONS-- Principles of Math 12 - Probability Practice Exam 1

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

UMBC 671 Midterm Exam 19 October 2009

UMBC CMSC 671 Midterm Exam 22 October 2012

Game Playing State of the Art

Informed Search. Read AIMA Some materials will not be covered in lecture, but will be on the midterm.

CHAPTER 2 PROBABILITY. 2.1 Sample Space. 2.2 Events

Heuristics & Pattern Databases for Search Dan Weld

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

Searching for Solu4ons. Searching for Solu4ons. Example: Traveling Romania. Example: Vacuum World 9/8/09

Artificial Intelligence Uninformed search

Probability: Part 1 1/28/16

CS188: Section Handout 1, Uninformed Search SOLUTIONS

Probability Theory. POLI Mathematical and Statistical Foundations. Sebastian M. Saiegh

CS61B Lecture #33. Today: Backtracking searches, game trees (DSIJ, Section 6.5)

CSE 473 Midterm Exam Feb 8, 2018

Lecture 7. Review Blind search Chess & search. CS-424 Gregory Dudek

Simple Search Algorithms

Exercise Class XI Chapter 16 Probability Maths

CS 188: Artificial Intelligence Spring 2007

Use a tree diagram to find the number of possible outcomes. 2. How many outcomes are there altogether? 2.

Problem. Operator or successor function - for any state x returns s(x), the set of states reachable from x with one action

CS 32 Puzzles, Games & Algorithms Fall 2013

Heuristics, and what to do if you don t know what to do. Carl Hultquist

RANDOM EXPERIMENTS AND EVENTS

CS344: Introduction to Artificial Intelligence (associated lab: CS386)

Artificial Intelligence Adversarial Search

Page 1 of 22. Website: Mobile:

Diamond ( ) (Black coloured) (Black coloured) (Red coloured) ILLUSTRATIVE EXAMPLES

Game Playing State-of-the-Art

XXII Probability. 4. The odds of being accepted in Mathematics at McGill University are 3 to 8. Find the probability of being accepted.

Problem 1. (15 points) Consider the so-called Cryptarithmetic problem shown below.

Midterm Examination. CSCI 561: Artificial Intelligence

Heuristics & Pattern Databases for Search Dan Weld

Experimental Comparison of Uninformed and Heuristic AI Algorithms for N Puzzle Solution

Set 4: Game-Playing. ICS 271 Fall 2017 Kalev Kask

Counting and Probability

Contents Maryland High School Programming Contest 1. 1 Coin Flip 3. 2 Weakest Microbot 5. 3 Digit Product Sequences 7.

CS 5522: Artificial Intelligence II

Adversarial Search 1

CS 188: Artificial Intelligence. Overview

Game Playing State-of-the-Art. CS 188: Artificial Intelligence. Behavior from Computation. Video of Demo Mystery Pacman. Adversarial Search

CS 188 Fall Introduction to Artificial Intelligence Midterm 1

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

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

12 Probability. Introduction Randomness

Transcription:

Solving Problems by Searching 1

Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search 2

Formal State-Space Model Problem = (S, s, A, f, g, c) S = state space s = initial state A = actions f = state change function f: S x A -> S g = goal test function g: S -> {true,false} c = cost function c: S x A x S -> R x a y How do we define a solution? How about an optimal solution? 3

3 Coins Problem A Very Small State Space Problem There are 3 (distinct) coins: coin1, coin2, coin3. The initial state is H H T The legal operations are to turn over exactly one coin. 1 (flip coin1), 2 (flip coin2), 3 (flip coin3) There are two goal states: H H H T T T What are S, s, A, f, g, c? 4

State-Space Graph 2 HHT 1 THT 3 HTT 2 3 THH 1 TTT 3 2 1 HHH 3 2 TTH HTH 1 What are some solutions? What if the problem is changed to allow only 3 actions? 5

Modified State-Space Problem How would you define a state for the new problem? How do you define the operations (1, 2, 3) with this new state definition? What do the paths to the goal states look like now? 6

How do we build a search tree for the modified 3 coins problem? initial state 1 2 3 7

The 8-Puzzle Problem one initial state 7 2 4 5 B 6 8 3 1 goal state B 1 2 3 4 5 6 7 8 B=blank 1. Formalize a state as a data structure 2. Show how start and goal states are represented. 3. How many possible states are there? 4. How would you specify the state-change function? 5. What is the goal test? 6. What is the path cost function? 7. What is the complexity of the search? 8

Search Tree Example: Fragment of 8-Puzzle Problem Space 9

Another Example: N Queens Input: Set of states Operators [and costs] Q Q Q Q Start state Goal state (test) Output 10

Example: Route Planning Input: Set of states Operators [and costs] Start state Goal state (test) Output: 11

Search Strategies Blind Search (Ch 3) Depth first search Breadth first search Depth limited search Iterative deepening search Informed Search (Ch 4) Constraint Satisfaction (Ch 5) 12

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Not for infinite spaces Time Complexity? O(b^d) a b e Space? O(d) c d f g h 13

Breadth First Search Maintain queue of nodes to visit Evaluation Complete? Yes Time Complexity? O(b^d) Space? O(b^d) a b c d e f g h 14

The Missionaries and Cannibals Problem (from text problem 3.9) Three missionaries and three cannibals are on one side of a river, along with a boat that can hold one or two people. If there are ever more cannibals than missionaries on one side of the river, the cannibals will eat the missionaries. (We call this a dead state.) Find a way to get everyone to the other side, without anyone getting eaten. 15

Missionaries and Cannibals Problem 16

Missionaries and Cannibals Problem Left Bank Right Bank River 17

Missionary and Cannibals Notes Define your state as (M,C,S) M: number of missionaries on left bank C: number of cannibals on left bank S: side of the river that the boat is on When the boat is moving, we are in between states. When it arrives, everyone gets out. 18

When is a state considered DEAD? 1. There are more cannibals than missionaries on the left bank. (Bunga-Bunga) 2. There are more cannibals than missionaries on the right bank. (Bunga-Bunga) 3. There is an ancestor state of this state that is exactly the same as this state. (Why?) 19

Assignment (problem 3.9b, which is part of the first homework set) Implement and solve the problem First with a blind depth-first search using a stack and/or recursion. Second with a blind breadth-first search. Definitely avoid repeated states. Keep track of how many states are searched in each. Use the computer language of your choice for this assignment. Java C++ Lisp or Lisp variant 20

Is memory a limitation in search? Suppose: 2 GHz CPU 1 GB main memory 100 instructions / expansion 5 bytes / node 200,000 expansions / sec Memory filled in 100 sec < 2 minutes 21

Iterative Deepening Search DFS with limit; incrementally grow limit Evaluation Complete? a b e Yes Time Complexity? O(b^d) g Space Complexity? O(d) c f h j d i k L 22

Cost of Iterative Deepening b ratio ID to DFS 2 3 3 2 5 1.5 10 1.2 25 1.08 100 1.02 23

Forwards vs. Backwards start end 24

vs. Bidirectional 25

Problem All these methods are too slow for real applications (blind) Solution add guidance informed search 26