2. Intelligent Agents
Suppose that the performance measure is concerned with just the first $T$ time steps of the environment and ignores everything thereafter. Show that a rational agent’s action may depend not just on the state of the environment but also on the time step it has reached.
Exercise 2.2 [vacuum-rationality-exercise]
Let us examine the rationality of various vacuum-cleaner agent functions.
-
Show that the simple vacuum-cleaner agent function described in Figure vacuum-agent-function-table is indeed rational under the assumptions listed on page vacuum-rationality-page.
-
Describe a rational agent function for the case in which each movement costs one point. Does the corresponding agent program require internal state?
-
Discuss possible agent designs for the cases in which clean squares can become dirty and the geography of the environment is unknown. Does it make sense for the agent to learn from its experience in these cases? If so, what should it learn? If not, why not?
Write an essay on the relationship between evolution and one or more of autonomy, intelligence, and learning.
For each of the following assertions, say whether it is true or false and support your answer with examples or counterexamples where appropriate.
-
An agent that senses only partial information about the state cannot be perfectly rational.
-
There exist task environments in which no pure reflex agent can behave rationally.
-
There exists a task environment in which every agent is rational.
-
The input to an agent program is the same as the input to the agent function.
-
Every agent function is implementable by some program/machine combination.
-
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.
-
It is possible for a given agent to be perfectly rational in two distinct task environments.
-
Every agent is rational in an unobservable environment.
-
A perfectly rational poker-playing agent never loses.
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 env-properties-subsection.
-
Playing soccer.
-
Exploring the subsurface oceans of Titan.
-
Shopping for used AI books on the Internet.
-
Playing a tennis match.
-
Practicing tennis against a wall.
-
Performing a high jump.
-
Knitting a sweater.
-
Bidding on an item at an auction.
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 env-properties-subsection.
-
Performing a gymnastics floor routine.
-
Exploring the subsurface oceans of Titan.
-
Playing soccer.
-
Shopping for used AI books on the Internet.
-
Practicing tennis against a wall.
-
Performing a high jump.
-
Bidding on an item at an auction.
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.
Exercise 2.7 [agent-fn-prog-exercise]
This exercise explores the differences between agent functions and agent programs.
-
Can there be more than one agent program that implements a given agent function? Give an example, or show why one is not possible.
-
Are there agent functions that cannot be implemented by any agent program?
-
Given a fixed machine architecture, does each agent program implement exactly one agent function?
-
Given an architecture with $n$ bits of storage, how many different possible agent programs are there?
-
Suppose we keep the agent program fixed but speed up the machine by a factor of two. Does that change the agent function?
Write pseudocode agent programs for the goal-based and utility-based agents.
Consider a simple thermostat that turns on a furnace when the temperature is at least 3 degrees below the setting, and turns off a furnace when the temperature is at least 3 degrees above the setting. Is a thermostat an instance of a simple reflex agent, a model-based reflex agent, or a goal-based agent?
The following exercises all concern the implementation of environments and agents for the vacuum-cleaner world.
Exercise 2.10 [vacuum-start-exercise]
Implement a performance-measuring environment simulator for the vacuum-cleaner world depicted in Figure vacuum-world-figure and specified on page vacuum-rationality-page. Your implementation should be modular so that the sensors, actuators, and environment characteristics (size, shape, dirt placement, etc.) can be changed easily. (Note: for some choices of programming language and operating system there are already implementations in the online code repository.)
Implement a simple reflex agent for the vacuum environment in Exercise vacuum-start-exercise. Run the environment with this agent for all possible initial dirt configurations and agent locations. Record the performance score for each configuration and the overall average score.
Exercise 2.12 [vacuum-motion-penalty-exercise]
Consider a modified version of the vacuum environment in Exercise vacuum-start-exercise, in which the agent is penalized one point for each movement.
-
Can a simple reflex agent be perfectly rational for this environment? Explain.
-
What about a reflex agent with state? Design such an agent.
-
How do your answers to 1 and 2 change if the agent’s percepts give it the clean/dirty status of every square in the environment?
Exercise 2.13 [vacuum-unknown-geog-exercise]
consider a modified version of the vacuum environment in Exercise vacuum-start-exercise, in which the geography of the environment—its extent, boundaries, and obstacles—is unknown, as is the initial dirt configuration. (The agent can go Up and Down as well as Left and Right.)
-
Can a simple reflex agent be perfectly rational for this environment? Explain.
-
Can a simple reflex agent with a randomized agent function outperform a simple reflex agent? Design such an agent and measure its performance on several environments.
-
Can you design an environment in which your randomized agent will perform poorly? Show your results.
-
Can a reflex agent with state outperform a simple reflex agent? Design such an agent and measure its performance on several environments. Can you design a rational agent of this type?
Exercise 2.14 [vacuum-bump-exercise]
Repeat Exercise vacuum-unknown-geog-exercise for the case in which the location sensor is replaced with a “bump” sensor that detects the agent’s attempts to move into an obstacle or to cross the boundaries of the environment. Suppose the bump sensor stops working; how should the agent behave?
Exercise 2.15 [vacuum-finish-exercise]
The vacuum environments in the preceding exercises have all been deterministic. Discuss possible agent programs for each of the following stochastic versions:
-
Murphy’s law: twenty-five percent of the time, the Suck action fails to clean the floor if it is dirty and deposits dirt onto the floor if the floor is clean. How is your agent program affected if the dirt sensor gives the wrong answer 10% of the time?
-
Small children: At each time step, each clean square has a 10% chance of becoming dirty. Can you come up with a rational agent design for this case?