Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

AI Module1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

Artificial Intelligence (BAD402)

1.1 INTRODUCTION

What is Artificial Intelligence?


It is a branch of Computer Science that pursues creating the computers or machines as
intelligent as human beings.
It is the science and engineering of making intelligent machines, especially intelligent
computer programs.
It is related to the similar task of using computers to understand human intelligence,
but AI does not have to confine itself to methods that are biologically observable
Definition: Artificial Intelligence is the study of how to make computers do things, which, at
the moment, people do better.
According to the father of Artificial Intelligence, John McCarthy, it is “The science and
engineering of making intelligent machines, especially intelligent computer programs”.
Artificial Intelligence is a way of making a computer, a computer-controlled
robot, or a software think intelligently, in the similar manner the intelligent humans think.
AI is accomplished by studying how human brain thinks and how humans learn, decide, and
work while trying to solve a problem, and then using the outcomes of this study as a basis of
developing intelligent software and systems.
It has gained prominence recently due, in part, to big data, or the increase in speed, size and
variety of data businesses are now collecting. AI can perform tasks such as identifying
patterns in the data more efficiently than humans, enabling businesses to gain more insight
out of their data. From a business perspective AI is a set of very powerful tools, and
methodologies for using those tools to solve business problems. From a programming
perspective, AI includes the study of symbolic programming, problem solving, and search.

OR

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 1


Artificial Intelligence (BAD402)

Building AI Systems:
1) Perception
Intelligent biological systems are physically embodied in the world and experience the world
through their sensors (senses). For an autonomous vehicle, input might be images from a
camera and range information from a rangefinder. For a medical diagnosis system, perception
is the set of symptoms and test results that have been obtained and input to the system
manually.
2) Reasoning
Inference, decision-making, classification from what is sensed and what the internal "model"
is of the world. Might be a neural network, logical deduction system, Hidden Markov Model
induction, heuristic searching a problem space, Bayes Network inference, genetic algorithms,
etc. Includes areas of knowledge representation, problem solving, decision theory, planning,
game theory, machine learning, uncertainty reasoning, etc.
3) Action
Biological systems interact within their environment by actuation, speech, etc. All behavior is
centered around actions in the world. Examples include controlling the steering of a Mars
rover or autonomous vehicle, or suggesting tests and making diagnoses for a medical
diagnosis system. Includes areas of robot actuation, natural language generation, and speech
synthesis.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 2


Artificial Intelligence (BAD402)

Intelligent Systems:

In order to design intelligent systems, it is important to categorize them into four categories
(Luger and Stubberfield 1993), (Russell and Norvig, 2003)
1. Systems that think like humans
2. Systems that think rationally
3. Systems that behave like humans
4. Systems that behave rationally

 Acting humanly: The Turing Test approach:


The Turing Test, proposed by Alan Turing (1950), was designed to provide a satisfactory
operational definition of intelligence.

The computer would need to possess the following capabilities:


• natural language processing to enable it to communicate successfully in English;
• knowledge representation to store what it knows or hears;
• automated reasoning to use the stored information to answer questions and to draw new
conclusions;
• machine learning to adapt to new circumstances and to detect and extrapolate patterns.

a. The art of creating machines that performs functions requiring intelligence when
performed by people; that it is the study of, how to make computers do things which, at the
moment, people do better.
b. Focus is on action, and not intelligent behaviour cantered around the representation of the
world
c. Example: Turing Test
 3 rooms contain: a person, a computer and an interrogator.
 The interrogator can communicate with the other 2 by teletype (to avoid the Machine
imitate the appearance of voice of the person)

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 3


Artificial Intelligence (BAD402)

 The interrogator tries to determine which the person is and which the machine is.
 The machine tries to fool the interrogator to believe that it is the human, and the
person also tries to convince the interrogator that it is the human.
 If the machine succeeds in fooling the interrogator, then conclude that the machine is
intelligent.
 Thinking humanly: The cognitive modelling approach

If we are going to say that a given program thinks like a human, we must have some way
of determining how humans think. We need to get inside the actual workings of human
minds. There are three ways to do this: through introspection—trying to catch our own
thoughts as they go by; through psychological experiments—observing a person in action;
and through brain imaging—observing the brain in action.
a. Requires a model for human cognition. Precise enough models allow simulation by
computers.
b. Focus is not just on behaviour and I/O, but looks like reasoning process.
c. Goal is not just to produce human-like behaviour but to produce a sequence of steps of the
reasoning process, similar to the steps followed by a human in solving the same task.

 Thinking rationally: The “laws of thought” approach


The Greek philosopher Aristotle was one of the first to attempt to codify “right thinking,” that
is, irrefutable reasoning processes. His syllogisms provided patterns for argument structures
SYLLOGISM that always yielded correct conclusions when given correct premises—for
example, “Socrates is a man; all men are mortal; therefore, Socrates is mortal.” These laws of
thought were supposed to govern the operation of the mind; their study initiated the field
called logic.
Logicians in the 19th century developed a precise notation for statements about all kinds of
objects in the world and the relations among them. solve any solvable problem described in
logical notation. The so-called logicist tradition within artificial intelligence hopes to build on
such programs to create intelligent systems. There are two main obstacles to this approach.
First, it is not easy to take informal knowledge and state it in the formal terms required by
logical notation, particularly when the knowledge is less than 100% certain. Second, there is
a big difference between solving a problem “in principle” and solving it in practice. Even
problems with just a few hundred facts can exhaust the computational resources of any
computer unless it has some guidance as to which reasoning steps to try first.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 4


Artificial Intelligence (BAD402)

 Acting rationally: The rational agent approach


An agent is just something that acts (agent comes from the Latin agere, to do). Of course, all
computer programs do something, but computer agents are expected to do more: operate
Autonomously, perceive their environment, persist over a prolonged time period, adapt to
change, and create and pursue goals. A rational agent is one that acts so as to achieve the
best outcome or, when there is uncertainty, the best expected outcome.
a. The study of mental faculties through the use of computational models; that it is, the study
of computations that make it possible to perceive reason and act.
b. Focus is on inference mechanisms that are probably correct and guarantee an optimal
solution.
c. Goal is to formalize the reasoning process as a system of logical rules and procedures of
inference.
d. Develop systems of representation to allow inferences to be like “Socrates is a man. All
men are mortal. Therefore Socrates is mortal”
1.2 THE FOUNDATIONS OF ARTIFICIAL INTELLIGENCE
Philosophy
e.g., foundational issues (can a machine think?), issues of knowledge and believe, mutual
knowledge
sychology and Cognitive Science
e.g., problem solving skills
 Neuro-Science
e.g., brain architecture
 Computer Science And Engineering
e.g., complexity theory, algorithms, logic and inference, programming languages, and system
building.
 Mathematics and Physics
e.g., statistical modeling, continuous mathematics,
Economics
 How should we make decisions so as to maximize payoff?
 How should we do this when others may not go along?
 How should we do this when the payoff may be far in the future?
operations research, The work of

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 5


Artificial Intelligence (BAD402)

Richard Bellman (1957) formalized a class of sequential decision problems called Markov
decision processes, satisficing—making decisions that are “good enough,”

 Statistical Physics, and Complex Systems.


Sub Areas of AI:
1) Game Playing
Deep Blue Chess program beat world champion Gary Kasparov
2) Speech Recognition
PEGASUS spoken language interface to American Airlines' EAASY SABRE reseration
system, which allows users to obtain flight information and make reservations over the
telephone. The 1990s has seen significant advances in speech recognition so that limited
systems are now successful.
3) Computer Vision
Face recognition programs in use by banks, government, etc. The ALVINN system from
CMU autonomously drove a van from Washington, D.C. to San Diego (all but 52 of 2,849
miles), averaging 63 mph day and night, and in all weather conditions. Handwriting
recognition, electronics and manufacturing inspection, photo interpretation, baggage
inspection, reverse engineering to automatically construct a 3D geometric model.
4) Expert Systems
Application-specific systems that rely on obtaining the knowledge of human experts in an
area and programming that knowledge into a system.
a. Diagnostic Systems : MYCIN system for diagnosing bacterial infections of the blood and
suggesting treatments. Intellipath pathology diagnosis system (AMA approved). Pathfinder
medical diagnosis system, which suggests tests and makes diagnoses. Whirlpool customer
assistance centre.
b. System Configuration
DEC's XCON system for custom hardware configuration. Radiotherapy treatment planning.
c. Financial Decision Making
Credit card companies, mortgage companies, banks, and the U.S. government employ AI
systems to detect fraud and expedite financial transactions. For example, AMEX credit
check.
d. Classification Systems
Put information into one of a fixed set of categories using several sources of information.
E.g., financial decision making systems. NASA developed a system for classifying very faint

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 6


Artificial Intelligence (BAD402)

areas in astronomical images into either stars or galaxies with very high accuracy by learning
from human experts' classifications.
5) Mathematical Theorem Proving
Use inference methods to prove new theorems.
6) Natural Language Understanding
AltaVista's translation of web pages. Translation of Catepillar Truck manuals into 20
languages.
7) Scheduling and Planning
Automatic scheduling for manufacturing. DARPA's DART system used in Desert Storm and
Desert Shield operations to plan logistics of people and supplies. American Airlines rerouting
contingency planner. European space agency planning and scheduling of spacecraft
assembly, integration and verification.
8) Artificial Neural Networks:
 How do brains process information?
Neuroscience is the study of the nervous system, particularly the brain. Although the exact
NEUROSCIENCE
way in which the brain enables thought is one of the great mysteries of science, the fact that it
does enable thought has been appreciated for thousands of years because of the evidence that
strong blows to the head can lead to mental incapacitation. It has also long been known that
human brains are somehow different.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 7


Artificial Intelligence (BAD402)

The truly amazing conclusion is that a collection of simple cells can lead to thought,
action, and consciousness or, in the pithy words of John Searle (1992), brains cause minds.

9) Machine Learning
Machine learning is an application of AI. It's the process of using mathematical models of
data to help a computer learn without direct instruction. This enables a computer system to
continue learning and improving on its own, based on experience.
 Control theory and cybernetics
How can artifacts operate under their own control?

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 8


Artificial Intelligence (BAD402)

Ktesibios of Alexandria (c. 250 B.C.) built the first self-controlling machine: a water clock
with a regulator that maintained a constant flow rate. This invention changed the definition
of what an artifact could do. Wiener was a brilliant mathematician who worked with Bertrand
Rus-sell,, among others, before developing an interest in biological and mechanical control
systems and their connection to cognition. The idea that intelligence could be created by the
use of homeostatic devices containing appropriate feedback loops to achieve stable adaptive
behavior. Modern control theory, especially the branch known as stochastic optimal control,
has as its goal the design of systems that maximize an objective function over time.

 Linguistics

• How does language relate to thought?

This was a comprehensive, detailed account of the behaviorist approach to language learning,
written by the foremost expert in the field. But curiously, a review of the book became as
well known as the book itself, and served to almost kill off interest in behaviorism. Modern
linguistics and AI, then, were “born” at about the same time, and grew up together,
intersecting in a hybrid field called computational linguistics or natural language
processing. Much of the early work in knowledge representation (the study of how to put
knowledge into a form that a computer can reason with) was tied to language and informed
by research in linguistics, which was connected in turn to decades of work on the
philosophical analysis of language.

1.3 THE HISTORY OF ARTIFICIAL INTELLIGENCE


Important research that laid the groundwork for AI:
 In 1931, Goedel layed the foundation of Theoretical Computer Science1920-30s:
He published the first universal formal language and showed that math itself is either
flawed or allows for unprovable but true statements.
 In 1936, Turing reformulated Goedel’s result and church’s extension thereof. In 1956,
John McCarthy coined the term "Artificial Intelligence" as the topic of the Dartmouth
Conference, the first conference devoted to the subject.
 In 1957, The General Problem Solver (GPS) demonstrated by Newell, Shaw & Simon
 In 1958, John McCarthy (MIT) invented the Lisp language.
 In 1959, Arthur Samuel (IBM) wrote the first game-playing program, for checkers, to
achieve sufficient skill to challenge a world champion.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 9


Artificial Intelligence (BAD402)

 In 1963, Ivan Sutherland's MIT dissertation on Sketchpad introduced the idea of


interactive graphics into computing.
 In 1966, Ross Quillian (PhD dissertation, Carnegie Inst. of Technology; now CMU)
demonstrated semantic nets.
 In 1967, Dendral program (Edward Feigenbaum, Joshua Lederberg, Bruce Buchanan,
Georgia Sutherland at Stanford) demonstrated to interpret mass spectra on organic chemical
compounds.
First successful knowledge-based program for scientific reasoning.
 In 1967, Doug Engelbart invented the mouse at SRI
 In 1968, Marvin Minsky & Seymour Papert publish Perceptrons, demonstrating limits of
simple neural nets.
 In 1972, Prolog developed by Alain Colmerauer.
 In Mid 80’s, Neural Networks become widely used with the Back propagation algorithm
(first described by Werbos in 1974).
 1990, Major advances in all areas of AI, with significant demonstrations in machine
learning, intelligent tutoring, case-based reasoning, multi-agent planning, scheduling,
uncertain reasoning, data mining, natural language understanding and translation, vision,
virtual reality, games, and other topics.
 In 1997, Deep Blue beats the World Chess Champion Kasparov
 In 2002, iRobot, founded by researchers at the MIT Artificial Intelligence Lab, introduced
Roomba, a vacuum cleaning robot. By 2006, two million had been sold.
Tom Evans’s ANALOGY program (1968) solved geo-metric analogy problems that appear in
IQ tests. Daniel Bobrow’s STUDENT program (1967) solved algebra story problems, such as
the following:
If the number of customers Tom gets is twice the square of 20 percent of the number of
advertisements he runs, and the number of advertisements he runs is 45, what is the number
of customers Tom gets?
The most famous micro world was the blocks world, which consists of a set of solid blocks
placed on a tabletop (or more often, a simulation of a tabletop), as shown in Figure 1.4. A
typical task in this world is to rearrange the blocks in a certain way, using a robot hand that
can pick up one block at a time. The blocks world was home to the vision project of David
Huffman (1971), the vision and constraint-propagation work of David Waltz (1975), the

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 10


Artificial Intelligence (BAD402)

learning theory of Patrick Winston (1970), the natural-language-understanding program of


Terry Winograd (1972), and the planner of Scott Fahlman (1974).

1.3 THE STATE OF THE ART


What can AI do today? A concise answer is difficult because there are so many activities in
so many subfields. Here we sample a few applications;
 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 (Thrun, 2006). 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 traveller 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

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 11


Artificial Intelligence (BAD402)

program to control the scheduling of operations for a spacecraft (Jonsson et al., 2000).
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 by a score of 3.5 to
2.5 in an exhibition match (Goodman and Keene, 1997). Kasparov said that he felt a
“new kind of intelligence” across the board from him. Newsweek magazine described
the match as “The brain’s last stand.” The value of IBM’s stock increased by $18
billion. Human champions studied Kasparov’s loss and were able to draw a few
matches in subsequent years, but the most recent human-computer matches have been
won convincingly by the computer.
 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 (Sahami et al.,
1998; Goodman and Heckerman, 2004).
 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

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 12


Artificial Intelligence (BAD402)

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. These are just a few examples of artificial
intelligence systems that exist today.

The difference between strong AI and weak AI:


Strong AI makes the bold claim that computers can be made to think on a level (at least)
equal to humans.
Weak AI simply states that some "thinking-like" features can be added to computers to make
them more useful tools... and this has already started to happen (witness expert systems,
drive-by-wire cars and speech recognition software).
AI Problems:
AI problems (speech recognition, NLP, vision, automatic programming, knowledge
representation, etc.) can be paired with techniques (NN, search, Bayesian nets, production
systems, etc.). AI problems can be classified in two types:
1. Common-place tasks(Mundane Tasks)
2. Expert tasks
Common-Place Tasks:
1. Recognizing people, objects.
2. Communicating (through natural language).
3. Navigating around obstacles on the streets. Artificial Intelligence
These tasks are done matter of factly and routinely by people and some other animals.
Expert tasks:
1. Medical diagnosis.
2. Mathematical problem solving
3. Playing games like chess
These tasks cannot be done by all people, and can only be performed by skilled specialists.
Clearly tasks of the first type are easy for humans to perform, and almost all are able to
master them. The second range of tasks requires skill development and/or intelligence and
only some specialists can perform them well. However, when we look at what computer

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 13


Artificial Intelligence (BAD402)

systems have been able to achieve to date, we see that their achievements include performing
sophisticated tasks like medical diagnosis, performing symbolic integration, proving
theorems and playing chess.

INTELLIGENT AGENTS
2.1 AGENTS AND ENVIRONMENTS

Agent:

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, mouth,
and other body parts 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.
Percept:

We use the term percept to refer to the agent's perceptual inputs at any given instant.
Percept Sequence:

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 14


Artificial Intelligence (BAD402)

An agent's percept sequence is the complete history of everything the agent has ever
perceived.
Agent function:
Mathematically speaking, we say that an agent's behavior is described by the agent function
that maps any given percept sequence to an action.
Agent program
Internally, the agent function for an artificial agent will be implemented by an agent program.
It is important to keep these two ideas distinct. The agent function is an abstract mathematical
Description, the agent program is a concrete implementation, running on the agent
architecture. To illustrate these ideas, we will use a very simple example-the vacuum-cleaner
world shown in Fig 2.2. This particular world has just two locations: squares A and B. The
vacuum agent perceives which square it is in and whether there is dirt in the square. It can
choose to move left, move right, suck up the dirt, or do nothing. One very simple agent
function is the following: if the current square is dirty, then suck, otherwise move to the other
square. A partial tabulation of this agent function is shown in Fig 2.3.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 15


Artificial Intelligence (BAD402)

2.2 GOOD BEHAVIOR: THE CONCEPT OF RATIONALITY


A rational agent is one that does the right thing—conceptually speaking, every entry in the
table for the agent function is filled out correctly. Obviously, doing the right thing is better
than doing the wrong thing, but what does it mean to do the right thing?
When an agent is plunked down in an environment, it generates a sequence of actions
according to the precepts 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; typically, a designer will
devise one appropriate to the circumstances. This is not as easy as it sounds. Consider, for
example, the vacuum-cleaner agent from the preceding section. We might propose to measure
performance by the amount of dirt cleaned up in a single eight-hour shift.
With a rational agent, of course, what you ask for is what you get. A rational agent
can maximize this performance measure by cleaning up the dirt, then dumping it all on the
floor, then cleaning it up again, and so on. A more suitable performance measure would
reward the agent for having a clean floor. For example, one point could be awarded for each
clean square at each time step (perhaps with a penalty for electricity consumed and noise
generated). 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.
Which is better— a reckless life of highs and lows, or a safe but humdrum existence?
Which is better—an economy where everyone lives in moderate poverty, or one in which
some live in plenty while others are very poor? We leave these questions as an exercise for
the diligent reader.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 16


Artificial Intelligence (BAD402)

2.2.1 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.
rational agent:
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.
Consider the simple vacuum-cleaner agent that cleans a square if it is dirty and moves to the
other square if not; this is the agent function tabulated in Figure 2.3.
Let us assume the following:
• The performance measure awards one point for each clean square at each time step,
over a “lifetime” of 1000 time steps.
• The “geography” of the environment is known a priori (Figure 2.2) but the dirt distribution
and the initial location of the agent are not. Clean squares stay clean and sucking cleans the
current square. The Left and Right actions move the agent left and right except when this
would take the agent outside the environment, in which case the agent remains where it is.
• The only available actions are Left, Right, and Suck.
• The agent correctly perceives its location and whether that location contains dirt.
2.2.2 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.
Consider the following example: I am walking along the Champs Elyse’s one day and I see
an old friend across the street. There is no traffic nearby and I’m not otherwise engaged, so,
being rational, I start to cross the street. Meanwhile, at 33,000 feet, a cargo door falls off a
passing airliner,2 and before I make it to the other side of the street I am flattened. Was I
irrational to cross the street? It is unlikely that my obituary would read “Idiot attempts to
cross street.” This example shows that rationality is not the same as perfection. Rationality
maximizes expected performance, while perfection maximizes actual performance.
Retreating from a requirement of perfection is not just a question of being fair to agents. The

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 17


Artificial Intelligence (BAD402)

point is that if we expect an agent to do what turns out to be the best action after the fact, it
will be impossible to design an agent to fulfil this specification—unless we improve the
performance of crystal balls or time machines.
Doing actions in order to modify future percents—sometimes called information
gathering—is an important part of rationality. A second example of information gathering is
provided by the exploration that must be undertaken by a vacuum-cleaning agent in an
initially unknown environment.
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
behaviour 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.
Now that we have a definition of rationality, we are almost ready to think about
building rational agents. First, however, we must think about task environments, which are
essentially the “problems” to which rational agents are the “solutions.” We begin by showing
how to specify a task environment, illustrating the process with a number of examples. We
then show that task environments come in a variety of flavours. The flavour of the task
environment directly affects the appropriate design for the agent program.

2.3 THE NATURE OF ENVIRONMENTS


we must think about task environments, which are essentially the “problems” to which
rational agents are the “solutions.” We begin by showing how to specify a task environment,
illustrating the process with a number of examples.

2.3.1 Specifying the task environment


The rationality of the simple vacuum-cleaner agent, we had to specify the performance
measure, the environment, and the agent’s actuators and sensors. We group all these under

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 18


Artificial Intelligence (BAD402)

the heading of the task environment. For the acronymically minded, we call 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. Figure 2.4 summarizes
the PEAS description for the taxi’s task environment. We discuss each element in more detail in the
following paragraphs.

We need to describe the PEAS for the “bidding on an item at an auction” activity. PEAS
stands for Performance measures, Environment, Actuators, and Sensors. We shall see
what these terms mean individually.
 Performance measures: These are the parameters used to measure the performance of
the agent. How well the agent is carrying out a particular assigned task.
 Environment: It is the task environment of the agent. The agent interacts with its
environment. It takes perceptual input from the environment and acts on the
environment using actuators.
 Actuators: These are the means of performing calculated actions on the environment.
For a human agent; hands and legs are the actuators.
 Sensors: These are the means of taking the input from the environment. For a human
agent; ears, eyes, and nose are the sensors.
2.3.2 Properties of task environments
The range of task environments that might arise in AI is obviously vast. We can, however,
identify a fairly small number of dimensions along which task environments can be categorized.
These dimensions determine, to a large extent, the appropriate agent design and the applicability
of each of the principal families of techniques for agent implementation.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 19


Artificial Intelligence (BAD402)

Features of Environment

As per Russell and Norvig, an environment can have various features from the point of view
of an agent:
1. Fully observable vs Partially Observable
2. Static vs Dynamic
3. Discrete vs Continuous
4. Deterministic vs Stochastic
5. Single-agent vs Multi-agent
6. Episodic vs sequential
7. Known vs Unknown

1. Fully observable vs Partially Observable:

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 20


Artificial Intelligence (BAD402)

o If an agent sensor can sense or access the complete state of an environment at each
point of time then it is a fully observable environment, else it is partially
observable.
o A fully observable environment is easy as there is no need to maintain the internal
state to keep track history of the world.
o An agent with no sensors in all environments then such an environment is called
as unobservable.
2. Deterministic vs Stochastic:
o If an agent's current state and selected action can completely determine the next state
of the environment, then such environment is called a deterministic environment.
o A stochastic environment is random in nature and cannot be determined completely
by an agent.
o In a deterministic, fully observable environment, agent does not need to worry about
uncertainty.
3. Episodic vs Sequential:
o In an episodic environment, there is a series of one-shot actions, and only the current
percept is required for the action.
o However, in Sequential environment, an agent requires memory of past actions to
determine the next best actions.
4. Single-agent vs Multi-agent
o If only one agent is involved in an environment, and operating by itself then such an
environment is called single agent environment.
o However, if multiple agents are operating in an environment, then such an
environment is called a multi-agent environment.
o The agent design problems in the multi-agent environment are different from single
agent environment.
5. Static vs Dynamic:
o If the environment can change itself while an agent is deliberating then such
environment is called a dynamic environment else it is called a static environment.
o Static environments are easy to deal because an agent does not need to continue
looking at the world while deciding for an action.
o However for dynamic environment, agents need to keep looking at the world at each
action.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 21


Artificial Intelligence (BAD402)

o Taxi driving is an example of a dynamic environment whereas Crossword puzzles are


an example of a static environment.
6. Discrete vs Continuous:
o If in an environment there are a finite number of percepts and actions that can be
performed within it, then such an environment is called a discrete environment else it
is called continuous environment.
o A chess gamecomes under discrete environment as there is a finite number of moves
that can be performed.
o A self-driving car is an example of a continuous environment.
7. Known vs Unknown
o Known and unknown are not actually a feature of an environment, but it is an agent's
state of knowledge to perform an action.
o In a known environment, the results for all actions are known to the agent. While in
unknown environment, agent needs to learn how it works in order to perform an
action.
o It is quite possible that a known environment to be partially observable and an
Unknown environment to be fully observable.
8. Accessible vs Inaccessible
o If an agent can obtain complete and accurate information about the state's
environment, then such an environment is called an Accessible environment else it is
called inaccessible.
o An empty room whose state can be defined by its temperature is an example of an
accessible environment.
o Information about an event on earth is an example of Inaccessible environment.
As one might expect, the hardest case is partially observable, multiagent, stochastic,
sequential, dynamic, continuous, and unknown. Taxi driving is hard in all these senses,
except that for the most part the driver’s environment is known. Driving a rented car in a
new country with unfamiliar geography and traffic laws is a lot more exciting. Figure 2.6
lists the properties of a number of familiar environments. Note that the answers are not
always cut and dried. For example, we describe the part-picking robot as episodic,
because it normally considers each part in isolation. But if one day there is a large batch

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 22


Artificial Intelligence (BAD402)

of defective parts, the robot should learn from several observations that the distribution of
defects has changed, and should modify its behaviour for subsequent parts. We have not
included a “known/unknown” column because, as explained earlier, this is not strictly a
property of the environment. For some environments, such as chess and poker, it is quite easy
to supply the agent with full knowledge of the rules, but it is nonetheless interesting to
consider how an agent might learn to play these games without such knowledge.
Several of the answers in the table depend on how the task environment is defined.
We have listed the medical-diagnosis task as single-agent because the disease process in a
patient is not profitably modeled as an agent; but a medical-diagnosis system might also have
to deal with recalcitrant patients and skeptical staff, so the environment could have a
multiagent aspect. Furthermore, medical diagnosis is episodic if one conceives of the task as
selecting a diagnosis given a list of symptoms; the problem is sequential if the task can
include proposing a series of tests, evaluating progress over the course of treatment, and so
on. Also, many environments are episodic at higher levels than the agent’s individual actions.
For example, a chess tournament consists of a sequence of games; each game is an episode
because (by and large) the contribution of the moves in one game to the agent’s overall
performance is not affected by the moves in its previous game. On the other hand, decision
making within a single game is certainly sequential.
A general-purpose environment simulator that places one or more agents in a
simulated environment, observes their behavior over time, and evaluates them according to a
given performance measure. Such experiments are often carried out not for a single
environment but for many environments drawn from an environment class. For example, to
evaluate a taxi driver in simulated traffic, we would want to run many simulations with

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 23


Artificial Intelligence (BAD402)

different traffic, lighting, and weather conditions. If we designed the agent for a single
scenario, we might be able to take advantage of specific properties of the particular case but
might not identify a good design for driving in general.
The code repository also includes an environment generator for each environment class that
selects particular environments (with certain likelihoods) in which to run the agent. For
example, the vacuum environment generator initializes the dirt pattern and agent location
randomly. We are then interested in the agent’s average performance over the environment
class. A rational agent for a given environment class maximizes this average performance.

2.4 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. We assume this program will run on some sort of
computing device with physical sensors and actuators—we call this the architecture:
agent = architecture + program
2.4.1 Agent programs
The agent programs that all have the same skeleton: they take the current percept as input from the
sensors and return an action to the actuators

We describe the agent programs in the simple pseudo code language that is defined for
example, Figure 2.7 shows a rather trivial agent program that keeps track of the percept
sequence and then uses it to index into a table of actions to decide what to do. The table—an
example of which is given for the vacuum world in Figure 2.3—represents explicitly the
agent function that the agent program embodies. To build a rational agent in

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 24


Artificial Intelligence (BAD402)

It is instructive to consider why the table-driven approach to agent construction is doomed to


failure. Let P be the set of possible percepts and let T be the lifetime of the agent (the total

number of percepts it will receive). The lookup table will contain T entries.
Consider the automated taxi: the visual input from a single camera comes in at the ate of
roughly 27 megabytes per second (30 frames per second, 640 × 480 pixels with 24 bits of
color information). This gives a lookup table with over 10250,000,000,000 entries for an
hour’s driving. Even the lookup table for chess—a tiny, well-behaved fragment of the real
world—would have at least 10150 entries. The daunting size of these tables (the number of
atoms in the observable universe is less than 1080) means that (a) no physical agent in this
universe will have the space to store the table, (b) the designer would not have time to create
the table, (c) no agent could ever learn all the right table entries from its experience, and (d)
even if the environment is simple enough to yield a feasible table size, the designer still has
no guidance about how to fill in the table entries.
at most all intelligent systems:
• Simple reflex agents;
• Model-based reflex agents;
• Goal-based agents; and
• Utility-based agents
Each kind of agent program combines particular components in particular ways to generate
actions. Section 2.4.6 explains in general terms how to convert all these agents into learning

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 25


Artificial Intelligence (BAD402)

2.4.2 Simple reflex agents

The simplest kind of agent is the simple reflex agent. 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, 5 written as if car-in-front-is-braking then initiate-
braking.
Humans also have many such connections, some of which are learned responses (as for
driving) and some of which are innate reflexes (such as blinking when something approaches
the eye). In the course of the book, we show several different ways in which such connections
can be learned and implemented.
The program in Figure 2.8 is specific to one particular vacuum environment. A more general
and flexible approach is first to build a general-purpose interpreter for condition– action rules
and then to create rule sets for specific task environments. Figure 2.9 gives the structure of
this general program in schematic form, showing how the condition–action rules allow the
agent to make the connection from percept to action. (Do not worry if this seems trivial; it gets
more interesting shortly.) We use rectangles to denote the current internal state of the agent’s
decision process, and ovals to represent the background information used in the process. The
agent program, which is also very simple, is shown in Figure 2.10. The INTERPRET-INPUT
function generates an abstracted description of the current state from the percept, and the
RULE-MATCH function returns the first rule in the set of rules that matches the given state

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 26


Artificial Intelligence (BAD402)

description. Note that the description in terms of “rules” and “matching” is purely conceptual;
actual implementations can be as simple as a collection of logic gates implementing a
Boolean circuit.

Simple reflex agents have the admirable property of being simple, but they turn out to be of
limited intelligence. The agent in Figure 2.10 will work only if the correct decision can be
made on the basis of only the current percept—that is, only if the environment is fully
observable. Even a little bit of un-observability can cause serious trouble. For example, the
braking rule given earlier assumes that the condition car-in-front-is-braking can be
determined from the current percept—a single frame of video. This works if the car in front
has a centrally mounted brake light. Unfortunately, older models have different
configurations of taillights, brake lights, and turn-signal lights, and it is not always possible to
tell from a single image whether the car is braking. A simple reflex agent driving behind such
a car would either brake continuously and unnecessarily, or, worse, never brake at all.
2.4.3 Model-based reflex agents

The most effective way to handle partial observability is for the agent to keep track of the
part of the world it can’t see now. That is, the agent should maintain some sort of internal
state that depends on the percept history and thereby reflects at least some of the unobserved
INTERNAL STATE aspects of the current state. For the braking problem, the internal state is
not too extensive— just the previous frame from the camera, allowing the agent to detect
when two red lights at the edge of the vehicle go on or off simultaneously. For other driving
tasks such as changing lanes, the agent needs to keep track of where the other cars are if it
can’t see them all at once. And for any driving to be possible at all, the agent needs to keep
track of where its keys are. This knowledge about “how the world works”—whether
implemented in simple Boolean circuits or in complete scientific theories—is called a model
of the world. An agent that uses such a model is called a model-based agent.
MODEL-BASED AGENT Figure 2.11 gives the structure of the model-based reflex agent
with internal state, showing how the current percept is combined with the old internal state to
generate the updated description of the current state, based on the agent’s model of how the
world works. The agent program is shown in Figure 2.12. The interesting part is the function
UPDATE-STATE, which

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 27


Artificial Intelligence (BAD402)

is responsible for creating the new internal state description. The details of how models and
states are represented vary widely depending on the type of environment and the particular
technology used in the agent design.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 28


Artificial Intelligence (BAD402)

example, the taxi may be driving back home, and it may have a rule telling it to fill up with
gas on the way home unless it has at least half a tank. Although “driving back home” may
seem to an aspect of the world state, the fact of the taxi’s destination is actually an aspect of
the agent’s internal state. If you find this puzzling, consider that the taxi could be in exactly
the same place at the same time, but intending to reach a different destination.
2.4.4 Goal-based agents

Knowing something about the current state of the environment is not always enough to
decide what to do. For example, at a road junction, the taxi can turn left, turn right, or go
straight on. The correct decision depends on where the taxi is trying to get to. In other words,
as well as a current state description, the agent needs some sort of goal information that
describes situations that are desirable—for example, , being at the passenger’s destination.
The agent program can combine this with the model (the same information as was used in the
model based reflex agent) to choose actions that achieve the goal. Figure 2.13 shows the
goal-based agent’s structure. Sometimes goal-based action selection is straightforward—for
example, when goal state Is faction results immediately from a single action. Sometimes it
will be more tricky—for example, when the agent has to consider long sequences of twists
and turns in order to find a way to achieve the goal.
Although the goal-based agent appears less efficient, it is more flexible because the
knowledge that supports its decisions is represented explicitly and can be modified. If it starts
to rain, the agent can update its knowledge of how effectively its brakes will operate; this will
automatically cause all of the relevant behaviours to be altered to suit the new conditions. For
the reflex agent, on the other hand, we would have to rewrite many condition–action rules.
2.4.5 Utility-based agents

Goals alone are not enough to generate high-quality behavior in most environments. For example,
many action sequences will get the taxi to its destination (thereby achieving the goal) but some are
quicker, safer, more reliable, or cheaper than others. Goals just provide a crude binary distinction
between “happy” and “unhappy” states. A more general performance measure should allow a
comparison of different world states according to exactly how happy they would make the agent.
Because “happy” does not sound very scientific, economists and computer scientists use the term
utility An agent’s utility function is essentially an internalization of the performance measure. If the
internal utility function and the external performance measure are in agreement, then an agent that
chooses actions to maximize its utility will be rational according to the external performance measure.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 29


Artificial Intelligence (BAD402)

Let us emphasize again that this is not the only way to be rational—we have already seen a
rational agent program for the vacuum world (Figure 2.8) that has no idea what its utility
function is—but, like goal-based agents, a utility-based agent has many advantages in terms
of flexibility and learning. Furthermore, in two kinds of cases, goals are inadequate but a
utility-based agent can still make rational decisions. First, when there are conflicting goals,
only some of which can be achieved (for example, speed and safety), the utility function
specifies the appropriate tradeoff. Second, when there are several goals that the agent can aim
for, none of which can be achieved with certainty, utility provides a way in which the
likelihood of success can be weighed against the importance of the goals.
Partial observability and stochasticity are ubiquitous in the real world, and so, therefore, is
decision making under uncertainty. Technically speaking, a rational utility-based agent
chooses the action that maximizes the expected utility of the action outcomes—that is, the
EXPECTED UTILITY utility the agent expects to derive, on average, given the probabilities
and utilities of each.

An agent that possesses an explicit utility function can make rational decisions with a
general-purpose algorithm that does not depend on the specific utility function being
maximized. In this way, the “global” definition of rationality—designating as rational those
agent functions that have the highest performance—is turned into a “local” constraint on
rational-agent designs that can be expressed in a simple program. The utility-based agent
structure appears in Figure 2.14. Utility-based agent programs appear in Part IV, where we

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 30


Artificial Intelligence (BAD402)

design decision-making agents that must handle the uncertainty inherent in stochastic or
partially observable environments.
2.4.6 Learning agents

We have described agent programs with various methods for selecting actions. We have not,
so far, explained how the agent programs come into being. In his famous early paper, Turing
(1950) considers the idea of actually programming his intelligent machines by hand.

He estimates how much work this might take and concludes “Some more expeditious method
seems desirable.” The method he proposes is to build learning machines and then to teach
them. In many areas of AI, this is now the preferred method for creating state-of-the-art
systems. Learning has another advantage, as we noted earlier: it allows the agent to operate in
initially unknown environments and to become more competent than its initial knowledge
alone might allow. In this section, we briefly introduce the main ideas of learning agents.
Throughout the book, we comment on opportunities and methods for learning in particular
kinds of agents. Part V goes into much more depth on the learning algorithms themselves. A
learning agent can be divided into four conceptual components, as shown in Figure 2.15. The
most important distinction is between the learning element, which is responsible for making
improvements, and the performance element, which is responsible for selecting external
actions. The performance element is what we have previously considered to be the entire
agent: it takes in precepts and decides on actions. The learning element uses feedback from
the critic on how the agent is doing and determines how the performance element should be
modified to do better in the future.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 31


Artificial Intelligence (BAD402)

The critic tells the learning element how well the agent is doing with respect to a fixed
performance standard. The critic is necessary because the precepts themselves provide no
indication of the agent’s success. For example, a chess program could receive a percept
indicating that it has checkmated its opponent, but it needs a performance standard to know
that this is a good thing.

The last component of the learning agent is the problem generator. It is responsible for
suggesting actions that will lead to new and informative experiences. The point is that if the
performance element had its way, it would keep doing the actions that are best, given what it
knows. But if the agent is willing to explore a little and do some perhaps suboptimal actions
in the short run, it might discover much better actions for the long run. The problem
generator’s job is to suggest these exploratory actions. This is what scientists do when they
carry out experiments. Galileo did not think that dropping rocks from the top of a tower in
Pisa was valuable in itself.
To make the overall design more concrete, let us return to the automated taxi example. The
performance element consists of whatever collection of knowledge and procedures the taxi
has for selecting its driving actions. The taxi goes out on the road and drives, using this
performance element. The critic observes the world and passes information along to the
learning element. For example, after the taxi makes a quick left turn across three lanes of
traffic, the critic observes the shocking language used by other drivers. From this experience,
the learning element is able to formulate a rule saying this was a bad action, and the
performance element is modified by installation of the new rule. The problem generator
might identify certain areas of behaviour in need of improvement and suggest experiments,
such as trying out the brakes on different road surfaces under different conditions.
2.4.7 How the components of agent programs work

We have described agent programs (in very high-level terms) as consisting of various
components, whose function it is to answer questions such as: “What is the world like now?”
“What action should I do now?” “What do my actions do?” The next question for a student of
AI is, “How on earth do these components work?” It takes about a thousand pages to begin to
answer that question properly, but here we want to draw the reader’s attention to some basic
distinctions among the various ways that the components can represent the environment that
the agent inhabits. Roughly speaking, we can place the representations along an axis of
increasing complexity and expressive power—atomic, factored, and structured. To
illustrate these ideas, it helps to consider a particular agent component, such as the one that

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 32


Artificial Intelligence (BAD402)

deals with “What my actions do.” This component describes the changes that might occur in
the environment as the result of taking an action, and Figure 2.16 provides schematic
depictions of how those transitions might be represented.

In an atomic representation each state of the world is indivisible—it has no internal


structure. Consider the problem of finding a driving route from one end of a country to the
other via some sequence of cities (we address this problem in Figure 3.2 on page 68). For the
purposes of solving this problem, it may suffice to reduce the state of world to just the name
of the city we are in—a single atom of knowledge; a “black box” whose only discernible
property is that of being identical to or different from another black box. The
algorithmsunderlying search and game-playing (Chapters 3–5), Hidden Markov models
(Chapter 15), and Markov decision processes (Chapter 17) all work with atomic
representations—or, at least, they treat representations as if they were atomic.
Now consider a higher-fidelity description for the same problem, where we need to be
concerned with more than just atomic location in one city or another; we might need to pay
attention to how much gas is in the tank, our current GPS coordinates, whether or not the oil
warning light is working, how much spare change we have for toll crossings, what station is
on the radio, and so on. A factored representation splits up each state into a fixed set of
variables or attributes, each of which can have a value. While two different atomic states
have nothing in common—they are just different black boxes—two different factored states
can share some attributes (such as being at some particular GPS location) and not others
(such as having lots of gas or having no gas); this makes it much easier to work out how to
turn one state into another. With factored representations, we can also represent

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 33


Artificial Intelligence (BAD402)

uncertainty—for example, ignorance about the amount of gas in the tank can be represented
by leaving that attribute blank.
For many purposes, we need to understand the world as having things in it that are
related to each other, not just variables with values. For example, we might notice that a large
truck ahead of us is reversing into the driveway of a dairy farm but a cow has got loose and is
blocking the truck’s path. A factored representation is unlikely to be pre-equipped with the
attribute Truck Ahead Backing Into Dairy Farm Drive way Blocked By Loose Cow with
value true or false. Instead, we would need a structured representation, in which objects
such as cows and trucks and their various and varying relationships can be described
explicitly. (See Figure 2.16(c).)
As we mentioned earlier, the axis along which atomic, factored, and structured
representations lie is the axis of increasing expressiveness. Roughly speaking, a more
expressive representation can capture, at least as concisely, everything a less expressive one
can capture, plus some more. Often, the more expressive language is much more concise; for
example, the rules of chess can be written in a page or two of a structured-representation
language such as first-order logic but requires thousands of pages when written in a factored-
representation language such as propositional logic. On the other hand, reasoning and
learning become more complex as the expressive power of the representation increases. To
gain the benefits of expressive representations while avoiding their drawbacks, intelligent
systems for the real world may need to operate at all points along the axis simultaneously.

Summary:
This chapter has been something of a whirlwind tour of AI, which we have conceived of as
the science of agent design. The major points to recall are as follows:
• An agent is something that perceives and acts in an environment. The agent function
for an agent specifies the action taken by the agent in response to any percept sequence.
• The performance measure evaluates the behaviour of the agent in an environment. A
rational agent acts so as to maximize the expected value of the performance measure,
given the percept sequence it has seen so far.
• A task environment specification includes the performance measure, the external
environment, the actuators, and the sensors. In designing an agent, the first step must always
be to specify the task environment as fully as possible.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 34


Artificial Intelligence (BAD402)

• Task environments vary along several significant dimensions. They can be fully or partially
observable, single-agent or multi agent, deterministic or stochastic, episodic or sequential,
static or dynamic, discrete or continuous, and known or unknown.
• The agent program implements the agent function. There exists a variety of basic agent-
program designs reflecting the kind of information made explicit and used in the decision
process. The designs vary in efficiency, compactness, and flexibility. The appropriate design
of the agent program depends on the nature of the environment.
• Simple reflex agents respond directly to precepts, whereas model-based reflex agents
maintain internal state to track aspects of the world that are not evident in the current percept.
Goal-based agents act to achieve their goals, and utility-based agents try to maximize their
own expected “happiness.”
• All agents can improve their performance through learning.

AI offers numerous benefits across various domains:

1. Automation: AI can automate repetitive tasks, increasing efficiency and reducing human
error.
2. Decision Making: AI systems can analyze vast amounts of data to aid in decision-making
processes, often leading to more informed and accurate decisions.
3. Personalization: AI algorithms can tailor experiences and recommendations to individual
preferences, enhancing user satisfaction.
4. Predictive Analytics: AI can forecast trends and behaviors, enabling organizations to
anticipate future needs and plan accordingly.
5. Improved Healthcare: AI applications in healthcare can lead to early disease detection,
personalized treatment plans, and better patient outcomes.
6. Enhanced Safety: AI-powered systems can improve safety in various settings, such as
autonomous vehicles reducing road accidents or AI-based surveillance systems identifying
potential threats.
7. Efficient Resource Utilization: AI can optimize resource allocation in sectors like energy,
agriculture, and manufacturing, leading to cost savings and reduced waste.
8. Innovation: AI fosters innovation by enabling the development of new products, services,
and solutions that were previously impossible or impractical.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 35


Artificial Intelligence (BAD402)

However, AI also comes with certain drawbacks and challenges:

1. Job Displacement: Automation driven by AI technologies may lead to job losses in certain
sectors, requiring retraining and adaptation for the workforce.
2. Bias and Fairness: AI systems can inherit biases present in training data, leading to unfair
or discriminatory outcomes, particularly in areas like hiring or lending.
3. Privacy Concerns: AI applications often require access to vast amounts of personal data,
raising concerns about privacy and data security.
4. Ethical Dilemmas: AI raises complex ethical questions, such as the use of autonomous
weapons, algorithmic decision-making in critical areas, and the impact on human autonomy.
5. Lack of Transparency: Some AI algorithms operate as "black boxes," making it difficult to
understand how they reach their conclusions, which can undermine trust and accountability.
6. Dependency on Data: AI systems heavily rely on data for training and operation, and the
quality of outcomes depends on the quality and relevance of this data.
7. Regulatory Challenges: The rapid advancement of AI technology often outpaces regulatory
frameworks, leading to uncertainties regarding legal and ethical responsibilities.
8. Security Risks: AI systems can be vulnerable to attacks and manipulation, posing risks
such as data breaches, algorithmic manipulation, and adversarial attacks.

Probable Questions

Q1.Explainthefourcategoriesofdefinitionofartificialintelligence.(Ans.Hint:defineThinking
Humanly,ThinkingRationally,ActingHumanly,ActingRationally).

Q2. Explain the contribution of Mathematics, Psychology, Linguistics

Q3. Explain Artificial Intelligence with Turing Test Approach.

Q.4. Explain the following terms: Agent, Agent Functions , Agent Program, Rationality,
Autonomy, Performance Measure.

Q.5. Explain the components of learning agent.

Q.6. Explain the following properties of task environments:

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 36


Artificial Intelligence (BAD402)

a. Fully observable vs partially observable


b. Single agent Vs Multi agent
c. Deterministic vs stochastic
d. Episodic vs sequential
e. Static vs Dynamic
f. Discrete vs Continuous
g. Known vs Unknown
Q.7. Describe the following agents:
a. Reflex agent
b. Model-based agent
c. Goal-based agent
d. Utility-based agent
e. Learning agent

Excises problems with solutions

1. Read Turing’s original paper on AI (Turing, 1950). In the paper, he discusses several
objections to his proposed enterprise and his test for intelligence. Which objections still carry
weight? Are his refutations valid? Can you think of new objections arising from developments
since he wrote the paper? In the paper, he predicts that, by the year 2000, a computer will have
a 30% chance of passing a five-minute Turing Test with an unskilled interrogator. What chance
do you think a computer would have today? In another 50 years?

Chance of Passing the Turing Test:


Turing predicted a 30% chance of a computer passing a five-minute Turing Test by the year
2000. However, as of today, no AI system has convincingly passed the Turing Test in its
original form. The chance of passing depends on various factors, including the complexity of
the task, the sophistication of AI systems, and the criteria for passing the test.

Future Speculation:
Predicting the chance of passing the Turing Test in the future is speculative. With ongoing
advancements in AI, including natural language processing, machine learning, and cognitive
modelling, it's conceivable that AI systems may achieve higher levels of conversational
sophistication. However, achieving genuine understanding and human-like intelligence
remains a formidable challenge.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 37


Artificial Intelligence (BAD402)

In another 50 years, the chance of passing the Turing Test could increase significantly,
especially with potential breakthroughs in AI research, computational power, and
understanding of cognition. Nevertheless, it's uncertain whether passing the Turing Test alone
would signify true human-like intelligence or merely sophisticated mimicry

2. Is AI a science, or is it engineering? Or neither or both? Explain .


AI's dual nature as both a science and an engineering discipline is reflected in its
interdisciplinary nature and the collaborative efforts of researchers, practitioners, and experts
from diverse fields. While scientific research drives theoretical advancements and deepens
our understanding of intelligence, engineering efforts translate these insights into practical
applications and technologies that benefit society. Therefore, AI can be considered as a
fusion of science and engineering, drawing upon the strengths of both disciplines to advance
the frontier of artificial intelligence.
3. Examine the AI literature to discover whether the following tasks can currently be
solved by computers:
a. Playing a decent game of table tennis (Ping-Pong).
b. Driving in the center of Cairo, Egypt.
c. Driving in Victorville, California.
d. Buying a week’s worth of groceries at the market.
e. Buying a week’s worth of groceries on the Web.
f. Playing a decent game of bridge at a competitive level.
g. Discovering and proving new mathematical theorems.
h. Writing an intentionally funny story.
i. Giving competent legal advice in a specialized area of law.
j. Translating spoken English into spoken Swedish in real time.
k. Performing a complex surgical operation.

a. Playing a decent game of table tennis (Ping-Pong): AI has made significant


advancements in playing complex games like chess, Go, and video games, but playing table
tennis at a decent level involves sophisticated real-time perception, motor control, and
strategy. While there are AI systems that can play table tennis to some extent, achieving
human-level performance remains a challenge.

b. Driving in the center of Cairo, Egypt: Autonomous driving technology has made
considerable progress, but driving in highly complex and unpredictable urban environments
like Cairo still presents challenges due to factors such as dense traffic, erratic driving
behavior, and lack of standardized road infrastructure. Current autonomous vehicles are

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 38


Artificial Intelligence (BAD402)

generally better suited for controlled environments like highways or well-mapped urban
areas.

c. Driving in Victorville, California: Driving in Victorville, a less densely populated area


with clearer roads and fewer complexities compared to Cairo, is more feasible for current
autonomous driving technology. However, challenges such as navigating unfamiliar terrain
and handling unexpected obstacles still exist.

d. Buying a week’s worth of groceries at the market: AI-powered systems can assist with
shopping tasks, including generating shopping lists, recommending products, and even
automating grocery delivery. However, the actual act of physically selecting groceries from a
market shelf may still require human intervention due to the variability and complexity of
products.

e. Buying a week’s worth of groceries on the Web: Online shopping platforms already
utilize AI algorithms for product recommendations, personalized offers, and efficient order
processing. AI can assist users in selecting groceries online, suggesting items based on
preferences, dietary restrictions, and past purchases.

f. Playing a decent game of bridge at a competitive level: While AI has achieved


remarkable success in games like chess and Go, playing bridge at a competitive level
involves complex bidding, partnership dynamics, and hidden information. While there are AI
systems capable of playing bridge, achieving human-level performance in this game remains
challenging due to its inherent complexity.

g. Discovering and proving new mathematical theorems: AI has been used to assist
mathematicians in exploring mathematical conjectures and generating hypotheses. However,
the process of discovering and proving new theorems often requires deep mathematical
insight and creativity, areas where current AI systems may struggle.

h. Writing an intentionally funny story: AI has demonstrated the ability to generate text,
including narratives and jokes, but intentionally crafting a genuinely funny story involves
understanding humor, context, and cultural nuances, which remains a significant challenge
for AI.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 39


Artificial Intelligence (BAD402)

i. Giving competent legal advice in a specialized area of law: AI-powered legal research
tools can assist lawyers in retrieving relevant case law, statutes, and legal documents.
However, providing competent legal advice involves analyzing complex legal issues,
applying legal principles to specific contexts, and considering ethical considerations, areas
where human expertise and judgment are still indispensable.

j. Translating spoken English into spoken Swedish in real time: AI-powered speech
recognition and machine translation systems can translate spoken languages in real time,
albeit with varying degrees of accuracy and fluency. Achieving high-quality real-time
translation requires advanced algorithms, training data, and computational resources.

k. Performing a complex surgical operation: AI has been increasingly integrated into


surgical systems, assisting surgeons in tasks such as image analysis, surgical planning, and
robotic-assisted surgery. While AI can augment surgical capabilities and improve precision,
performing complex surgical operations still requires skilled human surgeons who can make
critical decisions based on patient-specific factors and real-time feedback.

4. 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.
Ssolution:
Suppose we have a robot tasked with collecting objects in a grid environment within a time
limit of T steps. Each object collected yields a reward, and the robot's objective is to
maximize the total reward collected within the first T steps.
Now, imagine the robot encounters two scenarios:
1. In the early time steps (e.g., T/2), the robot finds itself in a region of the grid where
valuable objects are plentiful and easily accessible. In this scenario, the rational action for the
robot would be to prioritize collecting as many objects as possible in the current time steps,
maximizing its reward given the abundance of valuable objects.

2. Later in the time steps (e.g., 3T/4), the robot finds itself in a region of the grid where
valuable objects are scarce and scattered. In this scenario, the rational action for the robot
might be to conserve its remaining time and prioritize reaching a different area of the grid

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 40


Artificial Intelligence (BAD402)

where more valuable objects are likely to be found, even if it means sacrificing immediate
rewards.

In both scenarios, the rational action taken by the robot depends not only on the current state
of the environment (availability and distribution of objects) but also on the time step it has
reached (remaining time horizon). This is because the agent's objective is to maximize its
cumulative reward within the given time limit of T steps.

Therefore, in environments where the performance measure is constrained to the first T time
steps, rational agents may need to consider both the current state of the environment and the
time step they have reached to make optimal decisions and maximize their performance
within the limited time horizon.
5. For each of the following activities, give a PEAS description of the task environment
and characterize it in terms of the properties listed
• 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.
Solution:
PEAS description and characterize the task environment for each activity:

1. Playing soccer:
 Performance Measure: Score goals while preventing the opponent from scoring.
 Environment: Soccer field with boundaries, goalposts, teammates, opponents, and a soccer
ball.
 Actuators: Running, kicking, passing, dribbling, and goalkeeping actions.
 Sensors: Vision to perceive the positions of players and the ball, auditory cues for
communication with teammates and opponents.
 Properties:
 Multi-agent: Interaction with teammates and opponents influences the game.
 Dynamic: Players move rapidly, and the ball changes position frequently.
 Continuous: Actions like running and kicking are continuous variables.
 Partially Observable: Players cannot directly observe the entire field simultaneously.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 41


Artificial Intelligence (BAD402)

 Uncertain: Factors like the opponent's strategy, ball trajectory, and weather conditions
introduce uncertainty.

2. Exploring the subsurface oceans of Titan:


 Performance Measure: Gather scientific data and insights about Titan's subsurface oceans.
 Environment: Subsurface oceans of Titan, possibly with robotic vehicles or probes for
exploration.
 Actuators: Maneuvering thrusters, sampling devices, and sensors for data collection.
 Sensors: Cameras, sonars, spectrometers, and other scientific instruments for observing and
analyzing the environment.
 Properties:
 Single-agent: Robotic vehicles or probes act autonomously to explore the environment.
 Dynamic: Ocean currents and geological features may change over time.
 Partially Observable: The entire subsurface environment cannot be observed simultaneously.
 Uncertain: Geological features, chemical composition, and the presence of life are uncertain.

3. Shopping for used AI books on the Internet:


 Performance Measure: Purchase desired AI books within budget and time constraints.
 Environment: Online marketplace platforms with listings of used AI books, seller ratings,
prices, and shipping options.
 Actuators: Clicking on listings, adding items to the shopping cart, and completing the
purchase process.
 Sensors: Vision (to view book listings and seller ratings), text analysis (to understand book
descriptions), and possibly price comparison tools.
 Properties:
 Single-agent: The shopper acts independently to achieve the goal.
 Static: The online marketplace remains relatively stable during the shopping process.
 Fully Observable: The agent can observe the entire online marketplace through the interface.
 Discrete: Actions such as clicking and adding items to the shopping cart are discrete.
 Deterministic: The outcome of actions, such as adding an item to the cart, is predictable.

4. Playing a tennis match:


 Performance Measure: Win the tennis match by scoring more points than the opponent.
 Environment: Tennis court with boundaries, net, opponents, tennis racket, and tennis ball.
 Actuators: Running, hitting the ball, serving, volleying, and moving around the court.
 Sensors: Vision to perceive the ball's trajectory, opponent's movements, and court
boundaries.
 Properties:
 Multi-agent: Interaction with the opponent influences the game.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 42


Artificial Intelligence (BAD402)

 Dynamic: Players move rapidly, and the ball changes direction frequently.
 Continuous: Actions like running and hitting are continuous variables.
 Partially Observable: Players cannot directly observe the entire court simultaneously.
 Uncertain: Factors like the opponent's strategy, ball trajectory, and weather conditions
introduce uncertainty.

5. Practicing tennis against a wall:


 Performance Measure: Improve tennis skills by hitting the ball against the wall accurately
and consistently.
 Environment: Tennis court with a wall, tennis racket, and tennis ball.
 Actuators: Hitting the ball with the racket and moving around the court to position oneself.
 Sensors: Vision to perceive the ball's trajectory and auditory feedback from ball impacts.
 Properties:
 Single-agent: The player acts independently to improve skills.
 Dynamic: The ball rebounds off the wall, requiring rapid reactions and adjustments.
 Continuous: Actions like hitting the ball and moving are continuous variables.
 Partially Observable: The player cannot directly observe the entire trajectory of the ball.
 Deterministic: The outcome of actions, such as hitting the ball, is predictable.

6. Performing a high jump:


 Performance Measure: Jump over the bar at the highest possible height.
 Environment: Track and field arena with a high jump pit, bar, take-off area, and landing
area.
 Actuators: Running, jumping, and body positioning during take-off and flight.
 Sensors: Vision to perceive the bar's height, auditory cues for the starting signal, and
proprioception for body awareness.
 Properties:
 Single-agent: The athlete performs the high jump independently.
 Dynamic: The athlete's motion and the position of the bar change rapidly during the jump.
 Continuous: Actions like running and jumping are continuous variables.
 Fully Observable: The athlete can observe the entire high jump environment.
 Deterministic: The outcome of actions, such as jumping, is predictable.

7. Knitting a sweater:
 Performance Measure: Complete the sweater with desired size, style, and quality.
 Environment: Knitting area with knitting needles, yarn, pattern instructions, and possibly a
knitting machine.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 43


Artificial Intelligence (BAD402)

 Actuators: Manipulating knitting needles, controlling tension, and following pattern


instructions.
 Sensors: Vision to observe knitting progress and detect errors, tactile feedback for yarn
tension, and possibly pattern recognition for following instructions.
 Properties:
 Single-agent: The knitter performs the task independently.
 Static: The knitting environment remains relatively stable during the process.
 Discrete: Actions such as knitting stitches are discrete.
 Partially Observable: The knitter cannot observe the entire sweater simultaneously.
 Deterministic: The outcome of actions, such as knitting a stitch, is predictable.

8. Bidding on an item at an auction:


 Performance Measure: Successfully win the item at the lowest possible price or within
budget constraints.
 Environment: Auction platform with auction listings, current bids, auctioneer, other bidders,
and bidding interface.
 Actuators: Placing bids, increasing bid amounts, and monitoring auction progress.
 Sensors: Vision to view auction listings and bidding activity, auditory feedback for auction
announcements, and possibly real-time bidding data.
 Properties:
 Single-agent: The bidder acts independently to achieve the goal.
 Dynamic: Bidding activity changes rapidly as other participants place bids.
 Discrete: Actions such as placing bids and increasing bid amounts are discrete.
 Partially Observable: The bidder cannot directly observe other bidders' strategies or
maximum bid limits.
 Uncertain: Factors like other bidders' intentions and bidding strategies introduce uncertainty.

Smt. L N Shylaja, Associate Professor & HOD, AIML Page 44

You might also like