Artificial Intelligence: V Sem Cse
Artificial Intelligence: V Sem Cse
V SEM CSE
There are 3 ways to do this:
• Through Introspection – trying to catch our thoughts as they go by
• Psychological experiments – observing a person in action
• Brain imagining – observing the brain in action
• It is more general than the laws of thought approach, because correct inference
is just one of several possible mechanisms for achieving rationality.
• Robotic vehicles:
• A driverless robotic car named STANLEY sped through the rough terrain of the Mojave dessert at
22 mph, finishing the 132-mile course first to win the 2005 DARPA Grand Challenge.
• STANLEY is a Volkswagen Touareg outfitted with cameras, radar, and laser rangefinders to
sense the environment and onboard software to command the steering, braking, and
acceleration.
• The following year CMU’s BOSS won the Urban Challenge, safely driving in traffic through the
streets of a closed Air Force base, obeying traffic rules and avoiding pedestrians and other
vehicles.
• Speech recognition:
• A traveler calling United Airlines to book a flight can have the entire conversation guided by an
automated speech recognition and dialog management system.
• Autonomous planning and scheduling:
• A hundred million miles from Earth, NASA’s Remote Agent program became the first on-board
autonomous planning program to control the scheduling of operations for a spacecraft.
• REMOTE AGENT generated plans from high-level goals specified from the ground and monitored the
execution of those plans—detecting, diagnosing, and recovering from problems as they occurred.
• Game playing:
• IBM’s DEEP BLUE became the first computer program to defeat the world champion in a chess match
when it bested Garry Kasparov (Russian Chess grand master) by a score of 3.5 to 2.5 in an exhibition
match.
• Spam fighting:
• Each day, learning algorithms classify over a billion messages as spam, saving the recipient from having
to waste time deleting what, for many users, could comprise 80% or 90% of all messages, if not
classified away by algorithms. Because the spammers are continually updating their tactics, it is difficult
for a static programmed approach to keep up, and learning algorithms work best.
• Logistics planning:
• During the Persian Gulf crisis of 1991, U.S. forces deployed a Dynamic Analysis and Replanning Tool,
DART (Cross and Walker, 1994), to do automated logistics planning and scheduling for transportation.
• This involved up to 50,000 vehicles, cargo, and people at a time, and had to account for starting points,
destinations, routes, and conflict resolution among all parameters. The AI planning techniques generated
in hours a plan that would have taken weeks with older methods. The Defense Advanced Research
Project Agency (DARPA) stated that this single application more than paid back DARPA’s 30-year
investment in AI.
• Robotics:
• The iRobot Corporation has sold over two million Roomba robotic vacuum cleaners for home use.
• The company also deploys the more rugged PackBot to Iraq and Afghanistan, where it is used to handle
hazardous materials, clear explosives, and identify the location of snipers.
• Machine Translation:
• A computer program automatically translates from Arabic to English, allowing an English speaker to
see the headline “Ardogan Confirms That Turkey Would Not Accept Any Pressure, Urging Them to
Recognize Cyprus.”
• The program uses a statistical model built from examples of Arabic-to-English translations and from
examples of English text totaling two trillion words (Brants et al., 2007). None of the computer
scientists on the team speak Arabic, but they do understand statistics and machine learning algorithms.
Intelligent Agents
AGENTS AND ENVIRONMENTS
• An agent is anything that can be viewed as perceiving its environment through
sensors and acting upon that environment through actuators.
• A human agent has eyes, ears, and other organs for sensors and hands, legs, vocal
tract, and so on for actuators.
• A robotic agent might have cameras and infrared range finders for sensors and
various motors for actuators.
• A software agent receives keystrokes, file contents, and network packets as
sensory inputs and acts on the environment by displaying on the screen, writing
files, and sending network packets.
• An agent’s choice of action at any given instant can depend on the entire percept
sequence observed to date, but not on anything it hasn’t perceived.
• The term percept to refer to the agent’s perceptual inputs at
any given instant.
• A rational agent is one that does the right thing - every entry in the table for the agent
function is filled out correctly
• doing the right thing is better than doing the wrong thing, but what does it mean to do
the right thing?
• Example: When an agent is plunked down in an environment, it generates a sequence of
actions according to the percepts it receives. This sequence of actions causes the
environment to go through a sequence of states. If the sequence is desirable, then the
agent has performed well. This notion of desirability is captured by a performance
measure that evaluates any given sequence of environment states.
• There is not one fixed performance measure for all tasks and agents; - As a general
rule, it is better to design performance measures according to what one actually wants in
the environment, rather than according to how one thinks the agent should behave. Even
when the obvious pitfalls are avoided, there remain some knotty issues to untangle.
Rationality
What is rational at any given time depends on four things:
• The performance measure that defines the criterion of success.
• The agent’s prior knowledge of the environment.
• The actions that the agent can perform.
• The agent’s percept sequence to date.
Definition:
• For each possible percept sequence, a rational agent should select an action that is
expected to maximize its performance measure, given the evidence provided by the
percept sequence and whatever built-in knowledge the agent has.
Omniscience, learning, and
autonomy
• We need to be careful to distinguish between rationality and omniscience.
• An omniscient agent knows the actual outcome of its actions and can act
accordingly; but omniscience is impossible in reality.
• rationality is not the same as perfection. Rationality maximizes expected
performance, while perfection maximizes actual performance.
• Doing actions in order to modify future percepts—sometimes called information
gathering—is an important part of rationality
• Our definition requires a rational agent not only to gather information but also to
learn as much as possible from what it perceives. The agent’s initial configuration
could reflect some prior knowledge of the environment, but as the agent gains
experience this may be modified and augmented.
AUTONOMY
• To the extent that an agent relies on the prior knowledge of its designer rather than
on its own percepts, we say that the agent lacks autonomy. A rational agent
should be autonomous—it should learn what it can to compensate for partial or
incorrect prior knowledge.
• For example, a vacuum-cleaning agent that learns to foresee where and when
additional dirt will appear will do better than one that does not. As a practical
matter, one seldom requires complete autonomy from the start: when the agent has
had little or no experience, it would have to act randomly unless the designer gave
some assistance.
• So, just as evolution provides animals with enough built-in reflexes to survive
long enough to learn for themselves, it would be reasonable to provide an artificial
intelligent agent with some initial knowledge as well as an ability to learn. After
sufficient experience of its environment, the behavior of a rational agent can
become effectively independent of its prior knowledge. Hence, the incorporation
of learning allows one to design a single rational agent that will succeed in a vast
variety of environments.
THE NATURE OF ENVIRONMENTS
• task environments – Problems
• rational agents – solutions
Specifying the task environment
• task environment. we call PEAS this the PEAS (Performance, Environment, Actuators, Sensors)
description
• In designing an agent, the first step must always be to specify the task environment as fully as
possible.
Properties of task environments
Fully observable vs. partially observable:
• If an agent’s sensors give it access to the complete state of the environment at each point in time, then we
say that the task environment is fully observable.
• A task environment is effectively fully observable if the sensors detect all aspects that are relevant to the
choice of action; relevance, in turn, depends on the performance measure. Fully observable environments
are convenient because the agent need not maintain any internal state to keep track of the world.
• An environment might be partially observable because of noisy and inaccurate sensors or because parts
of the state are simply missing from the sensor data
• for example, a vacuum agent with only a local dirt sensor cannot tell whether there is dirt in other squares,
and an automated taxi cannot see what other drivers are thinking.
• If the agent has no sensors at all then the environment is unobservable. One might think that in such cases
the agent’s plight is hopeless
Single agent vs. multi-agent:
• an agent solving a crossword puzzle by itself is clearly in a single-agent environment, whereas an
agent playing chess is in a two agent environment.
• There are, however, some subtle issues:
• First, we have described how an entity may be viewed as an agent, but we have not explained which
entities must be viewed as agents?
• Does an agent A (the taxi driver for example) have to treat an object B (another vehicle) as an agent,
or can it be treated merely as an object behaving? The key distinction is whether B’s behavior is
best described as maximizing a performance measure whose value depends on agent A’s behavior.
• For example, in chess, the opponent entity B is trying to maximize its performance measure, which,
by the rules of chess, minimizes agent A’s performance measure. Thus, chess is a competitive
multiagent environment.
• In the taxi-driving environment, on the other hand, avoiding collisions maximizes the performance
measure of all agents, so it is a partially cooperative multiagent environment.
• Deterministic vs. stochastic:
• If the next state of the environment is completely determined by the current state and the action
executed by the agent, then we say the environment is deterministic; otherwise, it is stochastic.
• In principle, an agent need not worry about uncertainty in a fully observable, deterministic
environment.
• If the environment is partially observable, however, then it could appear to be stochastic.
• Most real situations are so complex that it is impossible to keep track of all the unobserved
aspects; for practical purposes, they must be treated as stochastic. Taxi driving is clearly stochastic
in this sense, because one can never predict the behavior of traffic exactly;
Episodic vs. sequential:
• In an episodic task environment, the agent’s experience is divided into atomic episodes. In each
episode the agent receives a percept and then performs a single action. Crucially, the next episode
does not depend on the actions taken in previous episodes.
• Many classification tasks are episodic.
• In sequential environments, on the other hand, the current decision could affect all future
decisions.
• Chess and taxi driving are sequential: in both cases, short-term actions can have long-term
consequences.
• Episodic environments are much simpler than sequential environments because the agent does not
need to think ahead.
Static vs. dynamic:
• If the environment can change while an agent is deliberating, then we say the environment is
dynamic for that agent; otherwise, it is static.
• Static environments are easy to deal with because the agent need not keep looking at the world
while it is deciding on an action, nor need it worry about the passage of time.
• Dynamic environments, on the other hand, are continuously asking the agent what it wants to do;
if it hasn’t decided yet, that counts as deciding to do nothing.
• If the environment itself does not change with the passage of time but the agent’s performance
score does, then we say the environment is semi-dynamic.
• Taxi driving is clearly dynamic: the other cars and the taxi itself keep moving while the driving
algorithm dithers about what to do next. Chess, when played with a clock, is semi-dynamic.
Crossword puzzles are static.
Discrete vs. continuous:
• The discrete/continuous distinction applies to the state of the environment, to the way time is
handled, and to the percepts and actions of the agent. For example, the chess environment has a
finite number of distinct states (excluding the clock).
• Chess also has a discrete set of percepts and actions.
• Taxi driving is a continuous-state and continuous-time problem: the speed and location of the taxi
and of the other vehicles sweep through a range of continuous values and do so smoothly over
time. Taxi-driving actions are also continuous (steering angles, etc.).
• Input from digital cameras is discrete, strictly speaking, but is typically treated as representing
continuously varying intensities and locations.
Known vs. unknown:
• In a known environment, the outcomes (or outcome probabilities if the environment is stochastic)
for all actions are given.
• if the environment is unknown, the agent will have to learn how it works in order to make good
decisions.
• the distinction between known and unknown environments is not the same as the one between
fully and partially observable environments. It is quite possible for a known environment to be
partially observable—for example, in solitaire card games, I know the rules but am still unable to
see the cards that have not yet been turned over.
• Conversely, an unknown environment can be fully observable—in a new video game, the screen
may show the entire game state but I still don’t know what the buttons do until I try them.
THE STRUCTURE OF AGENTS
• The job of AI is to design an agent program that implements the agent function—the mapping
from percepts to actions.
• this program will run on some sort of computing device with physical sensors and actuators—
architecture:
agent = architecture + program
• the program we choose has to be one that is appropriate for the architecture. If the program is
going to recommend actions like Walk, the architecture had better have legs.
• the architecture makes the percepts from the sensors available to the program, runs the program,
and feeds the program’s action choices to the actuators as they are generated.
Agent programs
• The agent programs have the same skeleton: they take the current percept as input from the
sensors and return an action to the actuators.
• agent program, takes the current percept as input, and the agent function, takes the entire percept
history.
• The agent program takes just the current percept as input because nothing more is available from
the environment; if the agent’s actions need to depend on the entire percept sequence, the agent
will have to remember the percepts.
• four basic kinds of agent programs that embody the principles underlying almost all intelligent
systems:
• Simple reflex agents;
• Model-based reflex agents;
• Goal-based agents;
• Utility-based agents
Simple reflex agents
• These agents select actions on the basis of the current percept, ignoring the rest of the percept
history.
• For example, the vacuum agent whose agent function is tabulated in Figure 2.3 is a simple reflex
agent, because its decision is based only on the current location and on whether that location
contains dirt. An agent program for this agent is shown in Figure 2.8.
• Simple reflex behaviors occur even in more complex environments. Imagine yourself as the driver
of the automated taxi. If the car in front brakes and its brake lights come on, then you should
notice this and initiate braking. In other words, some processing is done on the visual input to
establish the condition we call “The car in front is braking.” Then, this triggers some established
connection in the agent program to the action “initiate braking.” We call such a connection a
condition–action rule
• if car-in-front-is-braking then initiate-braking.
A simple reflex agent. It acts according to a rule whose
condition matches the current state, as defined by the
percept.