Artificial Intelligence yx yx
A Modern Approach yx yx
Fourth Edition yx
Stuart J. Russell and Peter Norvig yx yx yx yx yx
with contributions from
yx yx
Nalin Chhibber, Ernest Davis, Nicholas J. Hay, Jared Moore, Alex Rudnick, Mehra
yx yx yx yx yx yx yx yx yx yx yx
n Sahami, Xiaocheng Mesut Yang, and Albert Yuyx yx yx yx yx yx yx
This solution manual is intended for the instructor of a class. Students should use the online
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
site for exercises at aimacode.github.io/aima-
yx yx yx yx yx
exercises. That site is open for anyone to use. It offers solutions for some but not all of t
y x yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
he exercises; an instructor can check there to see which ones have solutions. The exercises
yx yx yx yx yx yx yx yx yx yx yx yx y x yx yx
are online rather than in the textbook itself because (a) the textbook is long enough as is, a
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
nd (b) we wanted to be able to update the exercises frequently.
yx yx yx yx yx yx yx yx yx yx yx
Copyright © 2022 yx yx
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
,EXERCISES yx
1
INTRODUCTION
Note that for many of the questions in this chapter, we give references where answers can be
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
found rather than writing them out—the full answers would be far too long.
yx yx yx yx yx yx yx yx yx yx yx yx
1.1 What Is AI?
y x yx yx
Exercise 1.1.#DEFA
Define in your own words: (a) intelligence, (b) artificial intelligence, (c) agent, (d) ra-
tionality, (e) logical reasoning.
a. Dictionary definitions of intelligence talk about “the capacity to acquire and apply k
yx yx yx yx yx yx yx yx yx yx yx yx
nowledge” or “the faculty of thought and reason” or “the ability to comprehend and
yx yx yx yx yx yx yx yx yx yx yx yx yx yx
profit from experience.” These are all reasonable answers, but if we want something
yx yx y x yx yx yx yx yx yx yx yx yx
quantifiable we would use something like “the ability to act successfully across a wid
yx yx yx yx yx yx yx yx yx yx yx yx yx yx
e range of objectives in complex environments.”
yx yx yx yx yx yx
b. We define artificial intelligence as the study and construction of agent programs tha
yx yx yx yx yx yx yx yx yx yx yx yx
t perform well in a given class of environments, for a given agent architecture; they d
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
o the right thing. An important part of that is dealing with the uncertainty of what th
yx yx yx y x yx yx yx yx yx yx yx yx yx yx yx yx
e current state is, what the outcome of possible actions might be, and what is it that
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
we really desire.
yx yx
c. We define an agent as an entity that takes action in response to percepts from an envi-
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
ronment.
yx
d. We define rationality as the property of a system which does the “right thing” given
yx yx yx yx yx yx yx yx yx yx yx yx yx yx y
what it knows. See Section 2.2 for a more complete discussion. The basic concept i
x yx yx y x yx yx yx yx yx yx yx y x yx yx yx
s perfect rationality; Section ?? describes the impossibility of achieving perfect rational
yx yx yx yx yx yx yx yx yx yx yx
- ity and proposes an alternative definition.
yx yx yx yx yx yx
e. We define logical reasoning as the a process of deriving new sentences from old, such
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
that the new sentences are necessarily true if the old ones are true. (Notice that does not r
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
efer to any specific syntax or formal language, but it does require a well-
yx yx yx yx yx yx yx yx yx yx yx yx yx
defined notion of truth.) yx yx yx
Exercise 1.1.#TURI
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
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
, Section 1.1 What Is AI? 3
weight? Are his refutations valid? Can you think of new objections arising from develop-
ments 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 25 years?
See the solution for exercise 26.1 for some discussion of potential objections.
yx yx yx yx yx yx yx yx yx yx yx
The probability of fooling an interrogator depends on just how unskilled the interrogator
yx yx yx yx yx yx yx yx yx yx yx yx yx
is. A few entrants in the Loebner prize competitions have fooled judges, although if you l
y x yx yx yx yx yx yx yx yx yx yx yx yx yx yx
ook at the transcripts, it looks like the judges were having fun rather than taking their job s
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
eriously. There certainly have been examples of a chatbot or other online agent fooling hu
y x yx yx yx yx yx yx yx yx yx yx yx yx yx
mans. For example, see the description of the Julia chatbot at www.lazytd.com/lti/ j
yx yx yx yx yx yx yx yx yx yx yx yx
ulia/. We’d say the chance today is something like 10%, with the variation depending
y x yx yx yx yx yx yx yx yx yx yx yx yx yx
more on the skill of the interrogator rather than the program. In 25 years, we expect that
yx yx yx yx yx yx yx yx yx yx y x yx yx yx yx yx y x
the entertainment industry (movies, video games, commercials) will have made sufficient i
yx yx yx yx yx yx yx yx yx yx yx
nvestments in artificial actors to create very credible impersonators.
yx yx yx yx yx yx yx yx
Note that governments and international organizations are seriously considering rules that
yx yx yx yx yx yx yx yx yx yx yx
require AI systems to be identified as such. In California, it is already illegal for machines to
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
impersonate humans in certain circumstances. yx yx yx yx
Exercise 1.1.#REFL
Are reflex actions (such as flinching from a hot stove) rational? Are they intelligent?
Yes, they are rational, because slower, deliberative actions would tend to result in more
yx yx yx yx yx yx yx yx yx yx yx yx yx
damage to the hand. If “intelligent” means “applying knowledge” or “using thought and r
yx yx yx yx y x yx yx yx yx yx yx yx yx yx
easoning” then it does not require intelligence to make a reflex action.
yx yx yx yx yx yx yx yx yx yx yx
Exercise 1.1.#SYAI
To what extent are the following computer systems instances of artificial intelligence:
• Supermarket bar code scanners.
• Web search engines.
• Voice-activated telephone menus.
• Spelling and grammar correction features in word processing programs.
• Internet routing algorithms that respond dynamically to the state of the network.
• Although bar code scanning is in a sense computer vision, these are not AI systems.
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
The problem of reading a bar code is an extremely limited and artificial form of visual
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx y
interpretation, and it has been carefully designed to be as simple as possible, given th
x yx yx yx yx yx yx yx yx yx yx yx yx yx yx
e hardware. yx
• In many respects. The problem of determining the relevance of a web page to a quer
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
y is a problem in natural language understanding, and the techniques are related to tho
yx yx yx yx yx yx yx yx yx yx yx yx yx yx
se
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
, 4 Exercises 1 Introduction
we will discuss in Chapters 23 and 24. Search engines also use clustering technique
yx yx yx yx yx yx yx y x yx yx yx yx yx
s analogous to those we discuss in Chapter 20. Likewise, other functionalities provid
yx yx yx yx yx yx yx yx y x yx yx yx
ed by a search engines use intelligent techniques; for instance, the spelling corrector uses
yx yx yx yx yx yx yx yx yx yx yx yx yx y
a form of data mining based on observing users’ corrections of their own spelling error
x yx yx yx yx yx yx yx yx yx yx yx yx yx yx
s. On the other hand, the problem of indexing billions of web pages in a way that allo
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
ws retrieval in seconds is a problem in database design, not in artificial intelligence.
yx yx yx yx yx yx yx yx yx yx yx yx yx
• To a limited extent. Such menus tends to use vocabularies which are very limited –
yx yx yx y x yx yx yx yx yx yx yx yx yx yx
e.g. the digits, “Yes”, and “No” —
y x yx yx yx yx yx
and within the designers’ control, which greatly simplifies the problem. On the other
yx yx yx yx yx yx yx yx yx yx yx yx yx yx
hand, the programs must deal with an uncontrolled space of all kinds of voices and acc
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
ents. Modern digital assistants like Siri and the Google Assistant make more use of
y x yx yx yx yx yx yx yx yx yx yx yx yx yx
artificial intelligence techniques, but still have a limited repetoire.
yx yx yx yx yx yx yx yx
• Slightly at most. The spelling correction feature here is done by string comparison to a
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
fixed dictionary. The grammar correction is more sophisticated as it need to use a set of r
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
ather complex rules reflecting the structure of natural language, but still this is a very
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
limited and fixed task. yx yx yx
The spelling correctors in search engines would be considered much more nearly
yx yx yx yx yx yx yx yx yx yx yx yx
instances of AI than the Word spelling corrector are, first, because the task is much
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
more dynamic – yx yx
search engine spelling correctors deal very effectively with proper names, which are
yx yx yx yx yx yx yx yx yx yx yx yx yx
detected dynamically from user queries – and, second, because of the technique used –
yx yx yx yx yx yx yx yx yx yx yx yx yx
data mining from user queries vs. string matching.
yx yx yx yx yx yx yx yx
• This is borderline. There is something to be said for viewing these as intelligent agents
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
working in cyberspace. The task is sophisticated, the information available is partial, the
yx yx yx yx yx yx yx yx yx yx yx yx yx
techniques are heuristic (not guaranteed optimal), and the state of the world is dynamic.
yx yx yx yx yx yx yx yx yx yx yx yx yx yx
All of these are characteristic of intelligent activities. On the other hand, the task is very f
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
ar from those normally carried out in human cognition. In recent years there have been s
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
uggestions to base more core algorithmic work on machine learning. yx yx yx yx yx yx yx yx yx
Exercise 1.1.#COGN
Many of the computational models of cognitive activities that have been proposed involve
quite complex mathematical operations, such as convolving an image with a Gaussian or
finding a minimum of the entropy function. Most humans (and certainly all animals) never
learn this kind of mathematics at all, almost no one learns it before college, and almost no
one can compute the convolution of a function with a Gaussian in their head. What sense
does it make to say that the “vision system” is doing this kind of mathematics, whereas the
actual person has no idea how to do it?
Presumably the brain has evolved so as to carry out this operations on visual images, but
yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx yx
the mechanism is only accessible for one particular purpose in this particular cognitive tas
yx yx yx yx yx yx yx yx yx yx yx yx yx
k of image processing. Until about two centuries ago there was no advantage in people (o
yx yx yx y x yx yx yx yx yx yx yx yx yx yx yx
r animals) being able to compute the convolution of a Gaussian for any other purpose.
yx yx yx yx yx yx yx yx yx yx yx yx yx yx
The really interesting question here is what we mean by saying that the “actual person
yx yx yx yx yx yx yx yx yx yx yx yx yx yx
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.