AI Unit 1
AI Unit 1
Introduction:
What is Artificial Intelligence? Foundations of Artificial Intelligence, History, the state of art Artificial
Intelligence today.
Intelligent Agents:
Agents and environment, good behavior, nature of environment, the structure of agents
―[The automation of] activities that we ―The study of the computations that make
associate with human thinking, activities it possible to perceive, reason, and act.‖
such as decision-making, problem solving, (Winston, 1992)
learning . . .‖ (Bellman, 1978)
Acting Humanly Acting Rationally
―The art of creating machines that perform ―Computational Intelligence is the study
functions that require intelligence of the design of intelligent agents.‖ (Poole
when performed by people.‖ (Kurzweil, et al., 1998)
1990)
―AI . . . is concerned with intelligent behavior
―The study of how to make computers do in artifacts.‖ (Nilsson, 1998)
things at which, at the moment, people are
better.‖ (Rich and Knight, 1991)
3. Acting humanly: The Turing Test approach
a) The Turing Test, proposed by Alan Turing (1950), was designed to provide a satisfactory
operational definition of intelligence. A computer passes the test if a human interrogator, after
posing some written questions, cannot tell whether the written responses come from a person
or from a computer. Chapter 26 discusses the details of the test and whether a computer
would really be intelligent if it passed. For now, we note that programming a computer to
pass a rigorously applied test provides plenty to work on. 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.
b) Turing’s test deliberately avoided direct physical interaction between the interrogator and the
computer, because physical simulation of a person is unnecessary for intelligence. However,
the so-called total Turing Test includes a video signal so that the interrogator can test the
subject’s perceptual abilities, as well as the opportunity for the interrogator to pass physical
objects ―through the hatch.‖ To pass the total Turing Test,
the computer will need computer vision to perceive objects, and
robotics to manipulate objects and move about.
c) These six disciplines compose most of AI, and Turing deserves credit for designing a test that
remains relevant 60 years later. Yet AI researchers have devoted little effort to passing the
Turing Test, believing that it is more important to study the underlying principles of
intelligence than to duplicate an exemplar. The quest for ―artificial flight‖ succeeded when
the Wright brothers and others stopped imitating birds and started using wind tunnels and
learning about aerodynamics. Aeronautical engineering texts do not define the goal of their
field as making ―machines that fly so exactly like pigeons that they can fool even other
pigeons.‖
4. Thinking humanly: The cognitive modeling approach
a) 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. Once we have a sufficiently precise theory of
the mind, it becomes possible to express the theory as a computer program. If the program’s
input–output behavior matches corresponding human behavior, that is evidence that some of
the program’s mechanisms could also be operating in humans. For example, Allen Newell
and Herbert Simon, who developed GPS, the ―General Problem Solver‖ (Newell and Simon,
1961), were not content merely to have their program solve problems correctly. They were
more concerned with comparing the trace of its reasoning steps to traces of human subjects
solving the same problems. The interdisciplinary field of cognitive science brings together
computer models from AI and experimental techniques from psychology to construct precise
and testable theories of the human mind.
b) Cognitive science is a fascinating field in itself, worthy of several textbooks and at least one
encyclopedia (Wilson and Keil, 1999). We will occasionally comment on similarities or
differences between AI techniques and human cognition. Real cognitive science, however, is
necessarily based on experimental investigation of actual humans or animals. We will leave
that for other books, as we assume the reader has only a computer for experimentation. In the
early days of AI there was often confusion between the approaches: an author would argue
that an algorithm performs well on a task and that it is therefore a good model of human
performance, or vice versa. Modern authors separate the two kinds of claims; this distinction
has allowed both AI and cognitive science to develop more rapidly. The two fields continue
to fertilize each other, most notably in computer vision, which incorporates
neurophysiological evidence into computational models.
5. Thinking rationally: The “laws of thought” approach
a) 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
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.
b) Logicians in the 19th century developed a precise notation for statements about all kinds
of objects in the world and the relations among them. (Contrast this with ordinary arithmetic
notation, which provides only for statements about numbers.) By 1965, programs existed
that could, in principle, solve any solvable problem described in logical notation. (Although
if no solution exists, the program might loop forever.) The so-called logicist tradition within
artificial intelligence hopes to build on such programs to create intelligent systems.
c) 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. Although both of these obstacles apply to any attempt
to build computational reasoning systems, they appeared first in the logicist tradition.
6. Acting rationally: The rational agent approach
a) 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. In the ―laws of thought‖
approach to AI, the emphasis was on correct inferences. Making correct inferences is
sometimes part of being a rational agent, because one way to act rationally is to reason
logically to the conclusion that a given action will achieve one’s goals and then to act on that
conclusion. On the other hand, correct inference is not all of rationality; in some situations,
there is no provably correct thing to do, but something must still be done. There are also ways
of acting rationally that cannot be said to involve inference. For example, recoiling from a hot
stove is a reflex action that is usually more successful than a slower action taken after careful
deliberation.
b) All the skills needed for the Turing Test also allow an agent to act rationally. Knowledge
representation and reasoning enable agents to reach good decisions. We need to be able to
generate comprehensible sentences in natural language to get by in a complex society. We
need learning not only for erudition, but also because it improves our ability to generate
effective behavior.
c) The rational-agent approach has two advantages over the other approaches. First, it
is more general than the ―laws of thought‖ approach because correct inference is just one
of several possible mechanisms for achieving rationality. Second, it is more amenable to
scientific development than are approaches based on human behavior or human thought. The
standard of rationality is mathematically well defined and completely general, and can be
―unpacked‖ to generate agent designs that provably achieve it. Human behavior, on the other
hand, is well adapted for one specific environment and is defined by, well, the sum total
of all the things that humans do.
Q. List the foundations of AI? Explain any one in detail?
Answer:
1. Following are some of the foundations of AI:
a) Philosophy
b) Mathemetics
c) Economics
d) Neuroscience
e) Psycology
f) Computer Engg
g) Control Theory and Cybernatics
h) Linguistics
2. Philosophy:
a) What is Philosophy?
Can formal rules be used to draw valid conclusions?
How does the mind arise from a physical brain?
Where does knowledge come from?
How does knowledge lead to action?
b) It’s one thing to say that the mind operates, at least in part, according to logical rules, and to
build physical systems that emulate some of those rules; it’s another to say that the mind
itself is such a physical system. This question is vital to AI because intelligence requires
action as well as reasoning. Moreover, only by understanding how actions are justified can
we understand how to build an agent whose actions are justifiable
3. Mathemetics:
a) Philosophers staked out some of the fundamental ideas of AI, but the leap to a formal science
required a level of mathematical formalization in three fundamental areas: logic,
computation, and probability.
What are the formal rules to draw valid conclusions?
What can be computed?
How do we reason with uncertain information?
b) The first nontrivial algorithm is thought to be Euclid’s algorithm for computing greatest
common divisors. This fundamental result can also be interpreted as showing that some
functions on the integers cannot be represented by an algorithm—that is, they cannot be
computed. This motivated Alan Turing (1912–1954) to try to characterize exactly which
functions are computable—capable of being computed.
c) Besides logic and computation, the third great contribution of mathematics to AI is the theory
of probability.
4. Economics:
a) Decision theory, which combines probability theory with utility theory, provides a formal and
complete framework for decisions (economic or otherwise) made under uncertainty— that is,
in cases where probabilistic descriptions appropriately capture the decision maker’s
environment. This is suitable for ―large‖ economies where each agent need pay no attention
to the actions of other agents as individuals. For ―small‖ economies, the situation is much
more like a game: the actions of one player can significantly affect the utility of another
(either positively or negatively).
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?
b) Work in economics and operations research has contributed much to our notion of rational
agents, yet for many years AI research developed along entirely separate paths. One reason
was the apparent complexity of making rational decisions.
5. Neuroscience:
Neuroscience is the study of the nervous system, particularly the brain. Although the exact
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.
Brains and digital computers have somewhat different properties. Figure 1.3 shows that
computers have a cycle time that is a million times faster than a brain. The brain makes up
for that with far more storage and interconnection than even a high-end personal computer,
although the largest supercomputers have a capacity that is similar to the brain’s. (It should
be noted, however, that the brain does not seem to use all of its neurons simultaneously.)
6. Psychology:
a) Cognitive psychology, which views COGNITIVE the brain as an information-processing
device, can be traced back at least to the works of William James (1842–1910).
b) The three key steps of a knowledge-based agent:
the stimulus must be translated into an internal representation,
the representation is manipulated by cognitive processes to derive new internal
representations, and
these are in turn retranslated back into action.
d) It is now a common (although far from universal) view among psychologists that ―a cognitive
theory should be like a computer program‖ (Anderson, 1980); that is, it should describe a
detailed information processing mechanism whereby some cognitive function might be
implemented.
7. Computer Engg:
a) For artificial intelligence to succeed, we need two things: intelligence and an artifact. The
computer has been the artifact of choice. The modern digital electronic computer was
invented independently and almost simultaneously by scientists in three countries embattled
in World War II.
b) Since that time, each generation of computer hardware has brought an increase in speed and
capacity and a decrease in price. Performance doubled every 18 months or so until around
2005, when power dissipation problems led manufacturers to start multiplying the number of
CPU cores rather than the clock speed. Current expectations are that future increases in power
will come from massive parallelism—a curious convergence with the properties of the brain.
c) AI also owes a debt to the software side of computer science, which has supplied the
operating systems, programming languages, and tools needed to write modern programs (and
papers about them). But this is one area where the debt has been repaid: work in AI has
pioneered many ideas that have made their way back to mainstream computer science,
including time sharing, interactive interpreters, personal computers with windows and mice,
rapid development environments, the linked list data type, automatic storage management,
and key concepts of symbolic, functional, declarative, and object-oriented programming.
8. Control Theory and Cybernetics
a) 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. 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. This roughly matches our view of AI: designing systems that behave optimally.
b) Calculus and matrix algebra, the tools of control theory, lend themselves to systems that are
describable by fixed sets of continuous variables, whereas AI was founded in part as a way to
escape from the these perceived limitations. The tools of logical inference and computation
allowed AI researchers to consider problems such as language, vision, and planning that fell
completely outside the control theorist’s purview.
9. Linguistics
a) Modern linguistics and AI, then, were ―born‖ at about the same time, and grew up together,
intersecting in a hybrid field COMPUTATIONAL called computational linguistics or natural
language processing. The problem of understanding language soon turned out to be
considerably more complex than it seemed in 1957. Understanding language requires an
understanding of the subject matter and context, not just an understanding of the structure of
sentences.
b) This might seem obvious, but it was not widely appreciated until the 1960s. 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.
3. We can imagine tabulating the agent function that describes any given agent; for most agents, this
would be a very large table—infinite, in fact, unless we place a bound on the length of percept
sequences we want to consider. Given an agent to experiment with, we can, in principle, construct
this table by trying out all possible percept sequences and recording which actions the agent does
in response.1 The table is, of course, an external characterization of the agent. 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 within some physical system
Q. Explain the concept of rationality?
Answer:
1. 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 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. Notice that we
said environment states, not agent states. If we define success in terms of agent’s opinion of its
own performance, an agent could achieve perfect rationality simply by deluding itself that its
performance was perfect.
2. 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.
3. This leads to a definition of a 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.
4. Omniscience, learning, and autonomy
a) 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. Retreating from a
requirement of perfection is not just a question of being fair to agents. The 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 fulfill this specification. Our definition of rationality does not require
omniscience, then, because the rational choice depends only on the percept sequence to date.
b) We must also ensure that we haven’t inadvertently allowed the agent to engage in decidedly
underintelligent activities.
c) 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. There are extreme cases in which the environment is completely known a
priori. In such cases, the agent need not perceive or learn; it simply acts correctly.
d) 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.
c) In Figure, we have sketched the basic PEAS elements for a number of additional agent types.
It may come as a surprise to some readers that our list of agent types includes some programs
that operate in the entirely artificial environment defined by keyboard input and character
output on a screen. ―Surely,‖ one might say, ―this is not a real environment, is it?‖ In fact,
what matters is not the distinction between ―real‖ and ―artificial‖ environments, but the
complexity of the relationship among the behavior of the agent, the percept sequence
generated by the environment, and the performance measure.
d) In contrast, some software agents (or software robots or softbots) exist in rich, unlimited
domains. Imagine a softbot Web site operator designed to scan Internet news sources and
show the interesting items to its users, while selling advertising space to generate revenue. To
do well, that operator will need some natural language processing abilities, it will need to
learn what each user and advertiser is interested in, and it will need to change its plans
dynamically—for example, when the connection for one news source goes down or when a
new one comes online.
2. Properties of task environments
a) 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
b) Single agent vs. multiagent:
The distinction between single-agent and multiagent environments may seem simple
enough.
c) 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.
d) 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.
e) 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
f) 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
g) Known vs. unknown:
Strictly speaking, this distinction refers not to the environment itself but to the agent’s (or
designer’s) state of knowledge about the ―laws of physics‖ of the environment. In a
known environment, the outcomes (or outcome probabilities if the environment is
stochastic) for all actions are given.
Obviously, if the environment is unknown, the agent will have to learn how it works in
order to make good decisions
b) We outline 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; and
Utility-based agents.
Each kind of agent program combines particular components in particular ways to generate
actions.
3. Simple reflex agents
a) 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 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.‖
b) 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 unobservability can cause serious trouble.
4. Model-based reflex agents
a) 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
aspects of the current state
b) Updating this internal state information as time goes by requires two kinds of knowledge to
be encoded in the agent program.
First, we need some information about how the world evolves independently of the
agent—for example, that an overtaking car generally will be closer behind than it was a
moment ago.
Second, we need some information about how the agent’s own actions affect the world—
for example, that when the agent turns the steering wheel clockwise, the car turns to the
right
c) Regardless of the kind of representation used, it is seldom possible for the agent to determine
the current state of a partially observable environment exactly. Instead, the box labeled ―what
the world is like now‖ (Figure 2.11) represents the agent’s ―best guess‖ (or sometimes best
guesses). For example, an automated taxi may not be able to see around the large truck that
has stopped in front of it and can only guess about what may be causing the hold-up. Thus,
uncertainty about the current state may be unavoidable, but the agent still has to make a
decision.
5. Goal-based agents
a) 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 GOAL 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.
b) Sometimes goal-based action selection is straightforward—for example, when goal
satisfaction 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.
c) 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 behaviors 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.
The goal-based agent’s behavior can easily be changed to go to a different destination, simply
by specifying that destination as the goal. The reflex agent’s rules for when to turn and when
to go straight will work only for a single destination; they must all be replaced to go
somewhere new.
6. Utility-based agents
a) 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 instead. Utility-based
agent programs are where we design decision-making agents that must handle the uncertainty
inherent in stochastic or partially observable environments.
b) A utility-based agent has to model and keep track of its environment, tasks that have involved
a great deal of research on perception, representation, reasoning, and learning. The results of
this research fill many of the chapters of this book. Choosing the utility-maximizing course of
action is also a difficult task, requiring ingenious algorithms.