cs171 HW 1 - Solutions



Similar documents
Chapter 2: Intelligent Agents

Measuring the Performance of an Agent

Artificial Intelligence

Introduction to Artificial Intelligence. Intelligent Agents

Agents: Rationality (2)

Intelligent Agents. Chapter 2. Chapter 2 1

Chapter 2 Intelligent Agents

A Client-Server Interactive Tool for Integrated Artificial Intelligence Curriculum

Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

The overall size of these chance errors is measured by their RMS HALF THE NUMBER OF TOSSES NUMBER OF HEADS MINUS NUMBER OF TOSSES

AI: A Modern Approach, Chpts. 3-4 Russell and Norvig

Lecture 1: Introduction to Reinforcement Learning

Blender Notes. Introduction to Digital Modelling and Animation in Design Blender Tutorial - week 9 The Game Engine

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

6.231 Dynamic Programming and Stochastic Control Fall 2008

Robotics. Chapter 25. Chapter 25 1

Linear Programming for Optimization. Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc.

Joint Exam 1/P Sample Exam 1

Designing Behavior-Based Systems

Module1. x y 800.

Betting on Excel to enliven the teaching of probability

MA 1125 Lecture 14 - Expected Values. Friday, February 28, Objectives: Introduce expected values.

1. (First passage/hitting times/gambler s ruin problem:) Suppose that X has a discrete state space and let i be a fixed state. Let

Review of Intermediate Algebra Content

The game of roulette is played by throwing a small ball onto a rotating wheel with thirty seven numbered sectors.

The Basics of Robot Mazes Teacher Notes

Intelligent Agent for Playing Casino Card Games

SIMPLIFYING SQUARE ROOTS

West Virginia University College of Engineering and Mineral Resources. Computer Engineering 313 Spring 2010

Phases of the Moon. Objective. Materials. Procedure. Name Date Score /20

Game playing. Chapter 6. Chapter 6 1

Particles, Flocks, Herds, Schools

National Sun Yat-Sen University CSE Course: Information Theory. Gambling And Entropy

Hoover High School Math League. Counting and Probability

SQUARE-SQUARE ROOT AND CUBE-CUBE ROOT

Elementary Statistics and Inference. Elementary Statistics and Inference. 16 The Law of Averages (cont.) 22S:025 or 7P:025.

arxiv: v1 [math.pr] 5 Dec 2011

Analysis of Micromouse Maze Solving Algorithms

Discrete Optimization

Teaching Introductory Artificial Intelligence with Pac-Man

6.852: Distributed Algorithms Fall, Class 2

E190Q Lecture 5 Autonomous Robot Navigation

Introduction to Artificial Intelligence

Laboratory work in AI: First steps in Poker Playing Agents and Opponent Modeling

Probability and Expected Value

If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C?

VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0

Stat 20: Intro to Probability and Statistics

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

A Review of Intelligent Agents

Econometrics Simple Linear Regression

Flocking and Steering Behaviors : Computer Graphics April 08, 2010

3. Evaluate the objective function at each vertex. Put the vertices into a table: Vertex P=3x+2y (0, 0) 0 min (0, 5) 10 (15, 0) 45 (12, 2) 40 Max

Course Outline Department of Computing Science Faculty of Science. COMP Applied Artificial Intelligence (3,1,0) Fall 2015

Unit 19: Probability Models

Robot Perception Continued

Levels of Analysis and ACT-R

1 Portfolio Selection

Goal Problems in Gambling and Game Theory. Bill Sudderth. School of Statistics University of Minnesota

ExmoR A Testing Tool for Control Algorithms on Mobile Robots

Introduction to Algorithms March 10, 2004 Massachusetts Institute of Technology Professors Erik Demaine and Shafi Goldwasser Quiz 1.

5. Unable to determine m correct. 7. None of these m m m m/s. 2. None of these. 3. Unable to determine. 4.

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

Third Grade Math Games

FINAL EXAM, Econ 171, March, 2015, with answers

About the inverse football pool problem for 9 games 1

INTRODUCTION TO MACHINE LEARNING 3RD EDITION

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

HYBRID GENETIC ALGORITHMS FOR SCHEDULING ADVERTISEMENTS ON A WEB PAGE

AP Stats - Probability Review

Standard 12: The student will explain and evaluate the financial impact and consequences of gambling.

MrMajik s Money Management Strategy Copyright MrMajik.com 2003 All rights reserved.

The 2010 British Informatics Olympiad

Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

Programming LEGO NXT Robots using NXC

Ch. 13.3: More about Probability

6.254 : Game Theory with Engineering Applications Lecture 2: Strategic Form Games

2/26/2008. Sensors For Robotics. What is sensing? Why do robots need sensors? What is the angle of my arm? internal information

Week 5: Expected value and Betting systems

6.042/18.062J Mathematics for Computer Science. Expected Value I

A STRATEGIC PLANNER FOR ROBOT EXCAVATION' by Humberto Romero-Lois, Research Assistant, Department of Civil Engineering

Chapter 4 Lecture Notes

Robot Navigation. Johannes Maurer, Institute for Software Technology TEDUSAR Summerschool u

Notes from Week 1: Algorithms for sequential prediction

c. Given your answer in part (b), what do you anticipate will happen in this market in the long-run?

Factoring Algorithms

Compact Representations and Approximations for Compuation in Games

FAQ: Attack! and Expansion [ ]

Conceptual Questions: Forces and Newton s Laws

Introduction to Discrete Probability. Terminology. Probability definition. 22c:19, section 6.x Hantao Zhang

Game Theory 1. Introduction

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

Minesweeper as a Constraint Satisfaction Problem

Random Variate Generation (Part 3)

Moral Hazard. Itay Goldstein. Wharton School, University of Pennsylvania

Transcription:

1. (Exercise 2.3 from RN) For each of the following assertions, say whether it is true or false and support your answer with examples or counterexamples where appropriate. (a) An agent that senses only partial information about the state cannot be perfectly rational. False. The vacuum-cleaning agent from Section 2.2.1 is rational but doesn t observe the state of the square that is adjacent to it (b) There exist task environments in which no pure reflex agent can behave rationally. True. The card game Concentration or Memory is one. Anything where memory is required to do well will thwart a reflex agent. (c) There exists a task environment in which every agent is rational. True. Consider a task environment in which all actions (including no action) give the same, equal reward (d) The input to an agent program is the same as the input to the agent function. False. The input to a agent function is the percept history. The input to a agent program is only the current percept; it is up to the agent program to record any relevant history needed to make actions. (e) Every agent function is implementable by some program/machine combination. False. Consider an agent whose only action is to return an integer, and who perceives a bit each turn. It gains a point of performance if the integer returned matches the value of the entire bitstring perceived so far. Eventually, any agent program will fail because it will run out of memory. (f) Suppose an agent selects its action uniformly at random from the set of possible actions. There exists a deterministic task environment in which this agent is rational. True. Again consider the all actions always give equal reward case (g) It is possible for a given agent to be perfectly rational in two distinct task environments. True. Consider two environments based on betting on the outcomes of a roll of two dice. In one environment, the dice are fair, in the other, the dice are biased to always give 3 and 4. The agent can bet on what the sum of the dice will be, with equal reward on all possible outcomes for guessing correctly. The agent that always bets on 7 will be rational in both cases. (h) Every agent is rational in an unobservable environment. False. Built-in knowledge can give a rational agent in an unobservable environment. A vacuum-agent that cleans, moves, cleans moves would be rational, but one that never moves would not be. (i) A perfectly playing poker-playing agent never loses. False. Pit two perfectly playing agents against each other. Someone (the one with poorer luck) must lose. 2. (Exercise 2.4) For each of the following activities, give a PEAS description of the task environment and characterize it in terms of the properties listed in Section 2.3.2 (Properties of Task Environments in RN 2nd ed.) Playing soccer. P- Win/Lose E- Soccer field A- Legs,Head,Upper body S- Eyes,Ears. partially observable, multiagent, stochastic, sequential, dynamic, continuous, unknown 1

Exploring the subsurface oceans of Titan. P- Surface area mapped, extraterrestrial life found E- subsurface oceans of Titan A- steering, accelerator, break, probe arm, S- camera, sonar, probe sensors. partially observable, single agent, stochastic, sequential, dynamic, continuous, unknown Shopping for used AI books on the Internet.P- Cost of book, quality/relevance/correct edition E- Internet s used book shops A- key entry, cursor S- website interfaces, browser. partially observable, multiagent, stochastic, sequential, dynamic, continuous, unknown Playing a tennis match. P- Win/Lose E- Tennis court A- Tennis racquet, Legs S- Eyes, Ears. partially observable, multiagent, stochastic, sequential, dynamic, continuous, unknown Practicing tennis against a wall. P- Improved performance in future tennis matches E- Near a wall A- Tennis racquet, Legs S- Eyes, Ears. observable, single agent, stochastic, sequential, dynamic, continuous, unknown Performing a high jump. P- Clearing the jump or not E- Track A- Legs, Body S- Eyes. observable, single agent, stochastic, sequential, dynamic, continuous, unknown Knitting a sweater. P- Quality of resulting sweater E- Rocking chair A- Hands,Needles S- Eyes. observable, single agent, stochastic, sequential, dynamic, continuous, unknown Bidding on an item at an auction. P- Item acquired, Final price paid for item E- Auction House (or online) A- Bidding S- Eyes, Ears. Partially observable, multiagent, stochastic (tie-breaking for two simultaneous bids), episodic, dynamic, continuous, known 3. (Exercise 2.5) Define in your own words the following terms: agent, agent function, agent program, rationality, autonomy, reflex agent, model-based agent, goal-based agent, utility-based agent, learning agent. Agent: An algorithmic entity capable of displaying intelligent-like behavior. Agent function: a mapping from input-sequences to actions defining the behavior of an agent. Agent program: physical program implementing or approximating an agent function. Rationality: the behavior of maximizing one s own reward or performance. Reflex agent: agent only capable of considering it s current perception of the world. Model-based agent: agent that attempt to internalize aspects of the world through an approximating model. Goal-based agent: agent whose performance measure does not directly depend on local actions but on some (potentially) distant goal. Utility-based agent: agent whose performance measure is given by a utility function which determines which states are preferable and which are not on a continuous or many-valued scale. Learning agent: An agent whose performance can improve with experience. 4. (Exercise 2.6) This exercise explores the differences between agent functions and agent programs. (a) Can there be more than one agent program that implements a given agent function? Give an example, or show why one is not possible. Yes. Assume we are 2

given an agent function whose actions only depend on the previous p percepts. One program can remember the previous p percepts to implement the agent function, while another could remember greater than p percepts and still implement the same agent function. (b) Are there agent functions that cannot be implemented by any agent program?yes. See 1 (e) (c) Given a fixed machine architecture, does each agent program implement exactly one agent function? Yes. Given a percept sequence, an agent program will select an action. To implement multiple agent functions this would require the agent program to select different actions (or different distributions of actions) given the same percept sequence. (d) Given an architecture with n bits of storage, how many different possible agent programsarethere? If a is the total number of actions, then the number of possible programs are a 2n, 2 n internal states and a choices for each state (e) Suppose we keep the agent program fixed but speed up the machine by a factor of two. Does that change the agent function? No, not directly. However this may allow the program to compress it s memory further and to retain a better model of the world. 5. (Exercise 3.2) Your goal is to navigate a robot out of a maze. The robot starts in the center of the maze facing north. You can turn the robot to face north, east, south, or west. You can direct the robot to move forward a certain distance, although it will stop before hitting a wall. (a) Formulate the problem. How large is the state space? Initial State: At( (0,0) ), Facing( (0,1) ). Successor Function( At(x), Facing(y) ): <Turn(North), {At(x),Facing( (0,1) )} > <Turn(East), {At(x),Facing( (1,0) )} > <Turn(South), {At(x),Facing( (0,-1) )} > <Turn(West), {At(x),Facing( (-1,0) )} > <Move( k blocks), {At(x+ymin(k,D max (x,y))), Facing(y)}> where D max (x,y) is the maximum distance the robot can move in direction y from point x without hitting a wall. Goal State: At(x), x G, where G is the set of locations outside the maze. If the maze is comprized of S blocks, then the total number of states is 4S. (b) In navigating a maze, the only place we need to turn is at the intersection of two or more corridors. Reformulate this problem using this observation. How large is the state space now? The successor function remains the same for intersections, and for locations x which are straight corridors: Successor Function( At(x), Facing(y) ): <Move( k blocks), {At(x+ymin(k,D max (x,y))), Facing(y)}> Thus if the maze has I intersection blocks then the size of the state space is 4I +2(S I). 3

(c) From each point in the maze, we can move in any of the four directions until we reach a turning point, and this is the only action we need to do. Reformulate the problem using these actions. Do we need to keep track of the robot s orientation now? For intersections x, SucessorFunction( At(x) ): <Move(North), At( x+(0,1)d min (x,(0,1)))> <Move(East), At( x+(1,0)d min (x,(1,0)))> <Move(South), At( x+(0, 1)D min (x,(0, 1)))> <Move(West), At( x+( 1,0)D min (x,( 1,0)))> where D min (x,y) is the minimum distance from x to an intersection in the y direction. We no longer need to keep track of the robot s orientation since the new actions now contain the turning motions within them. The total number of states is now I. (d) In our initial description of the problem we already abstracted from the real world, restricting actions and removing details. List three such simplifications we made. (1) The robot can move only in one of four directions. (2) The robot can sense walls perfectly. (3) After attempting to move a certain distance, the robot knows with certainty how far it has moved. 6. (Exercise 3.5) Consider the n-queens problem using the efficient incremental formulation given on page 72 (page 67 RN 2nd ed.). Explain why the state space has at least 3 n! states and estimate the largest n for which exhaustive exploration is feasible. (Hint: Derive a lower bound on the branching factor by considering the maximum number of squares that a queen can attack in any column.) We want a lower bound on the size of the state space of this formulation of the n-queens problem. In this formulation, each column contains a queen, and queens are filled in neighboring columns in locations that are not attacked by previous queens. Thus, we can lower bound the number of valid states a queen may fit in by assuming each queen from the previous columns attacks exactly 3 squares, and that none of these squares have been attacked by a previous queen (which of course may be true in a real situation, but we are only considering a lowerbound here, ie we know there are at least n 6 squares that the 3rd queen can take on.) Thus there will be n choices for the first queen, n 3 choices for the second, n 6 the third and so on. So if S is the size of the state space, then we have n/3 1 n 3i S. Thus, = n/3 1 n/3 1 (n 3i) (n 3i) 3 1/3 (n 3( n/3 1))! =(n!) 1/3 = 3 n! n/3 2 (n 3i)(n 3i 1)(n 3i 2) 1/3 4

Thus we have 3 n! S. This becomes infeasible around n = 30. 5