pre reading review search the core idea
play

Pre-Reading Review Search: The Core Idea What is search (a.k.a. - PDF document

Bookkeeping Artificial Intelligence Class 3: Search (Ch. 3.13.3) TA Office hours: M 3-4, W 2-3 General HW 1 questions? Basic Python Sets, Tuples, Lists, Dictionaries, https://www.tutorialspoint.com/python


  1. Bookkeeping Artificial Intelligence Class 3: Search (Ch. 3.1–3.3) • TA Office hours: M 3-4, W 2-3 • General HW 1 questions? • Basic Python • Sets, Tuples, Lists, Dictionaries, … • https://www.tutorialspoint.com/python • http://tiny.cc/concise-python-guide • http://www.w3resource.com/python/python-tutorial.php • https://docs.python.org/3 • Especially Library Reference à Built-in Functions Some material adopted from notes by Charles R. Dyer, University of Wisconsin-Madison, with thanks Dr. Cynthia Matuszek – CMSC 671 Slides adapted with thanks from: Dr. Marie desJardin 2 Bits From Last Time What’s a “State”? • Sequential: Require memory of past actions to • The current state of the agent’s environment determine next best action • Everything in the problem representation • Or: current action can influence all future actions • Values of all parameters at a particular point in time • Episodic: A series of one-shot actions • Examples: • Only the current percept(s) are relevant • Chess board: 8x8 grid, location of all pieces • Sensing/acting in episode(t) is independent of episode(t-1) • Tic-tac-toe: 3x3 grid, whether each is X , O , or open • Robot soccer: Location of all players, location of ball, possibly • Single- vs. multi-agent: Is “your” agent the only last known trajectory of all players (if sequential) one affecting the world? • Travel: Cities, distances between cities, agent’s current city en.wikibooks.org/wiki/Artificial_Intelligence/AI_Agents_and_their_Environments jeffclune.com/courses/media/courses/2014-Fall-AI/lectures/L04-AI-2014.pdf 4 Some Examples Today’s Class Agent Type Performance Environment Actuators Sensors • Goal-based agents Measure Robot soccer Winning game, Field, ball, Devices (e.g., Camera, touch player goals own team, legs) for sensors, for/against other team, locomotion accelerometers, • Representing states and operators own body and kicking orientation sensors, PEAS wheel/joint encoders • Example problems Internet Obtain Internet Follow link, Web pages, book-shopping requested/ enter/submit user requests agent Interesting data in fields, • Generic state-space search algorithm books, display to user minimize expenditure Task Observable Deterministic Episodic Static Discrete Agents Environment Environment Everything in AI comes down to search. Robot Partially Stochastic Sequential Dynamic Continuous Multi soccer Internet Partially Deterministic Sequential Static Discrete Single book- Goal: understand search, and understand why. shopping 6 1

  2. Pre-Reading Review Search: The Core Idea • What is search (a.k.a. state-space search )? • For any problem: • What are these concepts in search? • World is (always) in some state • Initial state • Transition model • Agents take actions, which some other some • State space graph • Step cost action change the state A 1 A4 A2 action • Goal test (cf. goal) • Path cost • Actions • Solution / optimal solution • We need a sequence of • What is an open-loop system ? actions that gets the world A3 A5 A6 A7 into a particular goal state . • What is the difference between expanding and generating a state? • To find it, we search the • What is the frontier (a.k.a. open list )? space of actions and states. 7 8 Building Goal-Based Agents What is the Goal? • A situation we want to achieve • To build a goal-based agent we need to decide: • A set of properties that we want to hold • What is the goal to be achieved? • What are the possible actions? • Must define a “goal test” • What relevant information must be encoded? • What does it mean to achieve it? • Have we done so? • To describe the state of the world • To describe the available transitions • This is a hard question that is rarely tackled in AI! • To solve the problem • Often, we assume the system designer or user will specify the goal • For people, we stress the importance of establishing clear goals for as the first step towards solving a problem. Initial Goal • What are your goals? state state Actions • What problem(s) are you trying to solve? 9 10 What Are Actions? Actions and Determinism • Primitive actions or events: • In a deterministic world there is no uncertainty in an action’s effects • Make changes in the world • In order to achieve a (sub)goal • Current world state + chosen action fully specifies: • Actions are also known as operators or moves 1. Whether that action can be done in current world • Examples: • Is it applicable? ( E.g. : Do I own any of stock X to sell?) Low-level: High-level : • Is it legal? ( E.g. : Can’t just move a pawn sideways.) • Chess: “advance a pawn” • Chess: “clear a path for a queen” • Navigation: “take a step” • Navigation: “go home” 2. World state after action is performed • Finance: “sell 10% of stock X” • Finance: “sell best-return shares” 11 12 2

  3. Representing Actions Sliding Tile Puzzles • 15-puzzles, 8-puzzles • Actions here are: • Discrete events • How do we represent states? • That occur at an instant of time • How do we represent actions? A 1 A4 A2 • For example: • Tile-1 moves north • Tile-1 moves west • State: “Mary is in class” • Tile-1 moves east • Action “Go home” • Tile-1 moves south • New state: “Mary is at home” • Tile-2 moves north • There is no representation of a state where she is in • Tile-2 moves west between (i.e., in the state of “going home”). • … 13 commons.wikimedia.org/wiki/File:15-puzzle-shuf;led.svg, commons.wikimedia.org/wiki/File:15-puzzle-loyd-bis2.svg Representing Actions Representing States • Number of actions / operators depends on • What information about the world sufficiently describes all aspects relevant to solving the goal? representation used in describing a state • That is: what knowledge must be in a state description to • 8-puzzle: adequately describe the current state of the world? • Could specify 4 possible … moves (actions) for each • The size of a problem is usually described in terms of the of the 8 tiles: number of states that are possible 4*8=32 operators . • Tic-Tac-Toe has about 3 9 states. • Or, could specify four moves for the “blank” square: • Checkers has about 10 40 states. 4 operators! • Rubik’s Cube has about 10 19 states. • Chess has about 10 120 states in a typical game. • Careful representation can simplify a problem! 15 16 Closed World Assumption Some Example Problems • We generally use the Closed World Assumption : • Toy problems and micro-worlds • 8-Puzzle “All necessary information about a problem • Boat Problems domain is available in each percept so that each state is a complete description of the world.” • Cryptarithmetic • Remove 5 Sticks • No incomplete information at any point in time. • Water Jug Problem • A statement that is true is always known to be true. ∴ If we do not know something is true, it is false. • Real-world problems 17 18 en.wikipedia.org/wiki/Closed-world_assumption 3

  4. 8-Puzzle 8-Puzzle • State: 3 x 3 array describing where tiles Given an initial configuration of 8 numbered tiles on are a 3 x 3 board, move the tiles in such a way so as to produce a desired goal configuration of the tiles. • Operators: Move blank square Left, Right, Up or Down • This is a more efficient encoding of the operators! • Initial State: Starting configuration of the board • Goal: Some configuration of the board 19 20 The 8-Queens Problem Boat Problems 1 sheep, 1 wolf, 1 cabbage, 1 boat Place eight (or • Goal : Move everything across the river. N) queens on a • Constraints: chessboard such • The boat can hold you plus one thing. • Wolf can never be alone with sheep. that no queen • Sheep can never be alone with cabbage. can reach any • State: location of sheep, wolf, cabbage on shores and boat. other • Operators: Move ferry containing some set of occupants across the river (in either direction) to the other side. 21 22 Mathematical operations Remove 5 Sticks • Proposed by Knuth (R&N p 73) • Compute any positive integer, starting with the integer 4, using only factorial, square root, and floor operations Infinite state space! • • Given the following configuration of sticks, ⎢ ⎥ remove exactly 5 sticks ( 4 ! )! 5 ⎢ ⎥ = in such a way that the • States: Positive numbers ⎢ ⎥ ⎣ ⎦ remaining • Initial state: 4 configuration forms • Actions: Factorial (of integer states), square root, floor exactly 3 squares. • Transition model: Using mathematical definitions of actions • Goal test: State is the desired positive integer 23 24 4

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend