Instructor’s Solution Manual G G
ArtificialIntelligence G G
A Modern Approach G G
FourthEdition G
Stuart J. Russell and Peter Norvig
G G G G G
with contributions from
G G
Nalin Chhibber, Ernest Davis, Nicholas J. Hay, Jared Moore, Alex Rudnick, Mehran S
G G G G G G G G G G G G
ahami, Xiaocheng Mesut Yang, and Albert Yu G G G G G G
This solution manual is intended for the instructor of a class. Students should use the online site f
G G G G G G G G G G G G G G G G G
or exercises at aimacode.github.io/aima-
G G G
exercises. That site is open for anyone to use. It offers solutions for some but not all of the exe
G G G G G G G G G G G G G G G G G G G
rcises; an instructor can check there to see which ones have solutions. The exercises are online r
G G G G G G G G G G G G G G G G
ather than in the textbook itself because (a) the textbook is long enough as is, and (b) we wanted
G G G G G G G G G G G G G G G G G G G
to be able to update the exercises frequently.
G G G G G G G
Copyright © 2022 G G
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
G G G G G G G G
,EXERCISES G G
1
INTRODUCTION
Note that for many of the questions in this chapter, we give references where answers can be foun
G G G G G G G G G G G G G G G G G
d rather than writing them out—the full answers would be far too long.
G G G G G G G G G G G G
1.1 What Is AI? G G G
Exercise 1.1.#DEFA G
Define in your own words: (a) intelligence, (b) artificial intelligence, (c) agent, (d) ra-
G G G G G G G G G G G G G
tionality, (e) logical reasoning.
G G G G
a. Dictionary definitions of intelligence talk about “the capacity to acquire and apply knowl
G G G G G G G G G G G G
edge” or “the faculty of thought and reason” or “the ability to comprehend and profit from
G G G G G G G G G G G G G G G
experience.” These are all reasonable answers, but if we want something quantifiable we
G G G G G G G G G G G G G G
would use something like “the ability to act successfully across a wide range of objectives
G G G G G G G G G G G G G G G
in complex environments.”
G G
b. We define artificial intelligence as the study and construction of agent programs that per
G G G G G G G G G G G G G
form well in a given class of environments, for a given agent architecture; they do the righ
G G G G G G G G G G G G G G G G
t thing. An important part of that is dealing with the uncertainty of what the current state is
G G G G G G G G G G G G G G G G G
, what the outcome of possible actions might be, and what is it that we really desire.
G G G G G G G G G G G G G G G G
c. We define an agent as an entity that takes action in response to percepts from an envi-
G G G G G G G G G G G G G G G G
ronment.G
d. We define rationality as the property of a system which does the “right thing” given what
G G G G G G G G G G G G G G G
it knows. See Section 2.2 for a more complete discussion. The basic concept is perfect rat
G G G G G G G G G G G G G G G G
ionality; Section ?? describes the impossibility of achieving perfect rational-
G G G G G G G G G
ity and proposes an alternative definition.
G G G G G G
e. We define logical reasoning as the a process of deriving new sentences from old, such that
G G G G G G G G G G G G G G G G
the new sentences are necessarily true if the old ones are true. (Notice that does not refer to a
G G G G G G G G G G G G G G G G G G
ny specific syntax or formal language, but it does require a well-defined notion of truth.)
G G G G G G G G G G G G G G
Exercise 1.1.#TURI G
Read Turing’s original paper on AI (Turing, 1950). In the paper, he discusses several objectio
G G G G G G G G G G G G G G
ns to his proposed enterprise and his test for intelligence. Which objections still carry
G G G G G G G G G G G G G
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
G G G G G G G G
, Section 1.1 What Is AI? G G G G G 3
weight? Are his refutations valid? Can you think of new objections arising from develop-
G G G G G G G G G G G G G
ments since he wrote the paper? In the paper, he predicts that, by the year 2000, a computer will
G G G G G G G G G G G G G G G G G G G G
have a 30% chance of passing a five-
G G G G G G G
minute Turing Test with an unskilled interrogator. What chance do you think a computer would
G G G G G G G G G G G G G G G
have today? In another 25 years?
G G G G G
See the solution for exercise 26.1 for some discussion of potential objections.
G G G G G G G G G G G
The probability of fooling an interrogator depends on just how unskilled the interrogator is.
G G G G G G G G G G G G G G
A few entrants in the Loebner prize competitions have fooled judges, although if you look at the
G G G G G G G G G G G G G G G G
transcripts, it looks like the judges were having fun rather than taking their job seriously. There
G G G G G G G G G G G G G G G G
certainly have been examples of a chatbot or other online agent fooling humans. For example, s
G G G G G G G G G G G G G G G G
ee the description of the Julia chatbot at www.lazytd.com/lti/ julia/. We’d say the ch
G G G G G G G G G G G G G
ance today is something like 10%, with the variation depending more on the skill of the interrog
G G G G G G G G G G G G G G G G
ator rather than the program. In 25 years, we expect that the entertainment industry (movies, vi
G G G G G G G G G G G G G G G
deo games, commercials) will have made sufficient investments in artificial actors to create ver
G G G G G G G G G G G G G
y credible impersonators.
G G
Note that governments and international organizations are seriously considering rules that req
G G G G G G G G G G G
uire AI systems to be identified as such. In California, it is already illegal for machines to imperso
G G G G G G G G G G G G G G G G G
nate humans in certain circumstances.
G G G G
Exercise 1.1.#REFL G
Are reflex actions (such as flinching from a hot stove) rational? Are they intelligent?
G G G G G G G G G G G G G
Yes, they are rational, because slower, deliberative actions would tend to result in more da
G G G G G G G G G G G G G G
mage to the hand. If “intelligent” means “applying knowledge” or “using thought and reasonin
G G G G G G G G G G G G G
g” then it does not require intelligence to make a reflex action.
G G G G G G G G G G G
Exercise 1.1.#SYAI G
To what extent are the following computer systems instances of artificial intelligence:
G G G G G G G G G G G
• Supermarket bar code scanners. G G G
• Web search engines. G G
• Voice-activated telephone menus. G G
• Spelling and grammar correction features in word processing programs.
G G G G G G G G
• Internet routing algorithms that respond dynamically to the state of the network.
G G G G G G G G G G G
• Although bar code scanning is in a sense computer vision, these are not AI systems. The p
G G G G G G G G G G G G G G G G
roblem of reading a bar code is an extremely limited and artificial form of visual interpreta
G G G G G G G G G G G G G G G
tion, and it has been carefully designed to be as simple as possible, given the hardware.
G G G G G G G G G G G G G G G
• In many respects. The problem of determining the relevance of a web page to a query is a p
G G G G G G G G G G G G G G G G G G
roblem in natural language understanding, and the techniques are related to those
G G G G G G G G G G G
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
G G G G G G G G
, 4 Exercises 1 Introduction G G G
we will discuss in Chapters 23 and 24. Search engines also use clustering techniques anal
G G G G G G G G G G G G G G
ogous to those we discuss in Chapter 20. Likewise, other functionalities provided by a sea
G G G G G G G G G G G G G G
rch engines use intelligent techniques; for instance, the spelling corrector uses a form of dat
G G G G G G G G G G G G G G
a mining based on observing users’ corrections of their own spelling errors. On the other ha
G G G G G G G G G G G G G G G
nd, the problem of indexing billions of web pages in a way that allows retrieval in seconds
G G G G G G G G G G G G G G G G G
is a problem in database design, not in artificial intelligence.
G G G G G G G G G
• To a limited extent. Such menus tends to use vocabularies which are very limited –
G G G G G G G G G G G G G G
e.g. the digits, “Yes”, and “No” — G G G G G G
and within the designers’ control, which greatly simplifies the problem. On the other hand
G G G G G G G G G G G G G G
, the programs must deal with an uncontrolled space of all kinds of voices and accents. Mo
G G G G G G G G G G G G G G G G
dern digital assistants like Siri and the Google Assistant make more use of artificial intelli
G G G G G G G G G G G G G G
gence techniques, but still have a limited repetoire.
G G G G G G G
• Slightly at most. The spelling correction feature here is done by string comparison to a fixe
G G G G G G G G G G G G G G G
d dictionary. The grammar correction is more sophisticated as it need to use a set of rather co
G G G G G G G G G G G G G G G G G
mplex rules reflecting the structure of natural language, but still this is a very limited and f
G G G G G G G G G G G G G G G G
ixed task. G
The spelling correctors in search engines would be considered much more nearly inst
G G G G G G G G G G G G
ances of AI than the Word spelling corrector are, first, because the task is much more dyna
G G G G G G G G G G G G G G G G
mic – G
search engine spelling correctors deal very effectively with proper names, which are dete
G G G G G G G G G G G G G
cted dynamically from user queries – and, second, because of the technique used –
G G G G G G G G G G G G G
data mining from user queries vs. string matching.
G G G G G G G G
• This is borderline. There is something to be said for viewing these as intelligent agents wor
G G G G G G G G G G G G G G G
king in cyberspace. The task is sophisticated, the information available is partial, the techniq
G G G G G G G G G G G G G
ues are heuristic (not guaranteed optimal), and the state of the world is dynamic. All of these
G G G G G G G G G G G G G G G G G
are characteristic of intelligent activities. On the other hand, the task is very far from those n
G G G G G G G G G G G G G G G G
ormally carried out in human cognition. In recent years there have been suggestions to base
G G G G G G G G G G G G G G G
more core algorithmic work on machine learning.
G G G G G G
Exercise 1.1.#COGN G
Many of the computational models of cognitive activities that have been proposed involve qui
G G G G G G G G G G G G G
te complex mathematical operations, such as convolving an image with a Gaussian or finding a
G G G G G G G G G G G G G G G
minimum of the entropy function. Most humans (and certainly all animals) never learn this kin
G G G G G G G G G G G G G G
d of mathematics at all, almost no one learns it before college, and almost no one can compute th
G G G G G G G G G G G G G G G G G G
e convolution of a function with a Gaussian in their head. What sense does it make to say that th
G G G G G G G G G G G G G G G G G G G
e “vision system” is doing this kind of mathematics, whereas the actual person has no idea how t
G G G G G G G G G G G G G G G G G
o do it?
G G
Presumably the brain has evolved so as to carry out this operations on visual images, but the
G G G G G G G G G G G G G G G G G
mechanism is only accessible for one particular purpose in this particular cognitive task of imag
G G G G G G G G G G G G G G
e processing. Until about two centuries ago there was no advantage in people (or animals) bein
G G G G G G G G G G G G G G G
g able to compute the convolution of a Gaussian for any other purpose.
G G G G G G G G G G G G
The really interesting question here is what we mean by saying that the “actual person” can
G G G G G G G G G G G G G G G G
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
G G G G G G G G
ArtificialIntelligence G G
A Modern Approach G G
FourthEdition G
Stuart J. Russell and Peter Norvig
G G G G G
with contributions from
G G
Nalin Chhibber, Ernest Davis, Nicholas J. Hay, Jared Moore, Alex Rudnick, Mehran S
G G G G G G G G G G G G
ahami, Xiaocheng Mesut Yang, and Albert Yu G G G G G G
This solution manual is intended for the instructor of a class. Students should use the online site f
G G G G G G G G G G G G G G G G G
or exercises at aimacode.github.io/aima-
G G G
exercises. That site is open for anyone to use. It offers solutions for some but not all of the exe
G G G G G G G G G G G G G G G G G G G
rcises; an instructor can check there to see which ones have solutions. The exercises are online r
G G G G G G G G G G G G G G G G
ather than in the textbook itself because (a) the textbook is long enough as is, and (b) we wanted
G G G G G G G G G G G G G G G G G G G
to be able to update the exercises frequently.
G G G G G G G
Copyright © 2022 G G
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
G G G G G G G G
,EXERCISES G G
1
INTRODUCTION
Note that for many of the questions in this chapter, we give references where answers can be foun
G G G G G G G G G G G G G G G G G
d rather than writing them out—the full answers would be far too long.
G G G G G G G G G G G G
1.1 What Is AI? G G G
Exercise 1.1.#DEFA G
Define in your own words: (a) intelligence, (b) artificial intelligence, (c) agent, (d) ra-
G G G G G G G G G G G G G
tionality, (e) logical reasoning.
G G G G
a. Dictionary definitions of intelligence talk about “the capacity to acquire and apply knowl
G G G G G G G G G G G G
edge” or “the faculty of thought and reason” or “the ability to comprehend and profit from
G G G G G G G G G G G G G G G
experience.” These are all reasonable answers, but if we want something quantifiable we
G G G G G G G G G G G G G G
would use something like “the ability to act successfully across a wide range of objectives
G G G G G G G G G G G G G G G
in complex environments.”
G G
b. We define artificial intelligence as the study and construction of agent programs that per
G G G G G G G G G G G G G
form well in a given class of environments, for a given agent architecture; they do the righ
G G G G G G G G G G G G G G G G
t thing. An important part of that is dealing with the uncertainty of what the current state is
G G G G G G G G G G G G G G G G G
, what the outcome of possible actions might be, and what is it that we really desire.
G G G G G G G G G G G G G G G G
c. We define an agent as an entity that takes action in response to percepts from an envi-
G G G G G G G G G G G G G G G G
ronment.G
d. We define rationality as the property of a system which does the “right thing” given what
G G G G G G G G G G G G G G G
it knows. See Section 2.2 for a more complete discussion. The basic concept is perfect rat
G G G G G G G G G G G G G G G G
ionality; Section ?? describes the impossibility of achieving perfect rational-
G G G G G G G G G
ity and proposes an alternative definition.
G G G G G G
e. We define logical reasoning as the a process of deriving new sentences from old, such that
G G G G G G G G G G G G G G G G
the new sentences are necessarily true if the old ones are true. (Notice that does not refer to a
G G G G G G G G G G G G G G G G G G
ny specific syntax or formal language, but it does require a well-defined notion of truth.)
G G G G G G G G G G G G G G
Exercise 1.1.#TURI G
Read Turing’s original paper on AI (Turing, 1950). In the paper, he discusses several objectio
G G G G G G G G G G G G G G
ns to his proposed enterprise and his test for intelligence. Which objections still carry
G G G G G G G G G G G G G
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
G G G G G G G G
, Section 1.1 What Is AI? G G G G G 3
weight? Are his refutations valid? Can you think of new objections arising from develop-
G G G G G G G G G G G G G
ments since he wrote the paper? In the paper, he predicts that, by the year 2000, a computer will
G G G G G G G G G G G G G G G G G G G G
have a 30% chance of passing a five-
G G G G G G G
minute Turing Test with an unskilled interrogator. What chance do you think a computer would
G G G G G G G G G G G G G G G
have today? In another 25 years?
G G G G G
See the solution for exercise 26.1 for some discussion of potential objections.
G G G G G G G G G G G
The probability of fooling an interrogator depends on just how unskilled the interrogator is.
G G G G G G G G G G G G G G
A few entrants in the Loebner prize competitions have fooled judges, although if you look at the
G G G G G G G G G G G G G G G G
transcripts, it looks like the judges were having fun rather than taking their job seriously. There
G G G G G G G G G G G G G G G G
certainly have been examples of a chatbot or other online agent fooling humans. For example, s
G G G G G G G G G G G G G G G G
ee the description of the Julia chatbot at www.lazytd.com/lti/ julia/. We’d say the ch
G G G G G G G G G G G G G
ance today is something like 10%, with the variation depending more on the skill of the interrog
G G G G G G G G G G G G G G G G
ator rather than the program. In 25 years, we expect that the entertainment industry (movies, vi
G G G G G G G G G G G G G G G
deo games, commercials) will have made sufficient investments in artificial actors to create ver
G G G G G G G G G G G G G
y credible impersonators.
G G
Note that governments and international organizations are seriously considering rules that req
G G G G G G G G G G G
uire AI systems to be identified as such. In California, it is already illegal for machines to imperso
G G G G G G G G G G G G G G G G G
nate humans in certain circumstances.
G G G G
Exercise 1.1.#REFL G
Are reflex actions (such as flinching from a hot stove) rational? Are they intelligent?
G G G G G G G G G G G G G
Yes, they are rational, because slower, deliberative actions would tend to result in more da
G G G G G G G G G G G G G G
mage to the hand. If “intelligent” means “applying knowledge” or “using thought and reasonin
G G G G G G G G G G G G G
g” then it does not require intelligence to make a reflex action.
G G G G G G G G G G G
Exercise 1.1.#SYAI G
To what extent are the following computer systems instances of artificial intelligence:
G G G G G G G G G G G
• Supermarket bar code scanners. G G G
• Web search engines. G G
• Voice-activated telephone menus. G G
• Spelling and grammar correction features in word processing programs.
G G G G G G G G
• Internet routing algorithms that respond dynamically to the state of the network.
G G G G G G G G G G G
• Although bar code scanning is in a sense computer vision, these are not AI systems. The p
G G G G G G G G G G G G G G G G
roblem of reading a bar code is an extremely limited and artificial form of visual interpreta
G G G G G G G G G G G G G G G
tion, and it has been carefully designed to be as simple as possible, given the hardware.
G G G G G G G G G G G G G G G
• In many respects. The problem of determining the relevance of a web page to a query is a p
G G G G G G G G G G G G G G G G G G
roblem in natural language understanding, and the techniques are related to those
G G G G G G G G G G G
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
G G G G G G G G
, 4 Exercises 1 Introduction G G G
we will discuss in Chapters 23 and 24. Search engines also use clustering techniques anal
G G G G G G G G G G G G G G
ogous to those we discuss in Chapter 20. Likewise, other functionalities provided by a sea
G G G G G G G G G G G G G G
rch engines use intelligent techniques; for instance, the spelling corrector uses a form of dat
G G G G G G G G G G G G G G
a mining based on observing users’ corrections of their own spelling errors. On the other ha
G G G G G G G G G G G G G G G
nd, the problem of indexing billions of web pages in a way that allows retrieval in seconds
G G G G G G G G G G G G G G G G G
is a problem in database design, not in artificial intelligence.
G G G G G G G G G
• To a limited extent. Such menus tends to use vocabularies which are very limited –
G G G G G G G G G G G G G G
e.g. the digits, “Yes”, and “No” — G G G G G G
and within the designers’ control, which greatly simplifies the problem. On the other hand
G G G G G G G G G G G G G G
, the programs must deal with an uncontrolled space of all kinds of voices and accents. Mo
G G G G G G G G G G G G G G G G
dern digital assistants like Siri and the Google Assistant make more use of artificial intelli
G G G G G G G G G G G G G G
gence techniques, but still have a limited repetoire.
G G G G G G G
• Slightly at most. The spelling correction feature here is done by string comparison to a fixe
G G G G G G G G G G G G G G G
d dictionary. The grammar correction is more sophisticated as it need to use a set of rather co
G G G G G G G G G G G G G G G G G
mplex rules reflecting the structure of natural language, but still this is a very limited and f
G G G G G G G G G G G G G G G G
ixed task. G
The spelling correctors in search engines would be considered much more nearly inst
G G G G G G G G G G G G
ances of AI than the Word spelling corrector are, first, because the task is much more dyna
G G G G G G G G G G G G G G G G
mic – G
search engine spelling correctors deal very effectively with proper names, which are dete
G G G G G G G G G G G G G
cted dynamically from user queries – and, second, because of the technique used –
G G G G G G G G G G G G G
data mining from user queries vs. string matching.
G G G G G G G G
• This is borderline. There is something to be said for viewing these as intelligent agents wor
G G G G G G G G G G G G G G G
king in cyberspace. The task is sophisticated, the information available is partial, the techniq
G G G G G G G G G G G G G
ues are heuristic (not guaranteed optimal), and the state of the world is dynamic. All of these
G G G G G G G G G G G G G G G G G
are characteristic of intelligent activities. On the other hand, the task is very far from those n
G G G G G G G G G G G G G G G G
ormally carried out in human cognition. In recent years there have been suggestions to base
G G G G G G G G G G G G G G G
more core algorithmic work on machine learning.
G G G G G G
Exercise 1.1.#COGN G
Many of the computational models of cognitive activities that have been proposed involve qui
G G G G G G G G G G G G G
te complex mathematical operations, such as convolving an image with a Gaussian or finding a
G G G G G G G G G G G G G G G
minimum of the entropy function. Most humans (and certainly all animals) never learn this kin
G G G G G G G G G G G G G G
d of mathematics at all, almost no one learns it before college, and almost no one can compute th
G G G G G G G G G G G G G G G G G G
e convolution of a function with a Gaussian in their head. What sense does it make to say that th
G G G G G G G G G G G G G G G G G G G
e “vision system” is doing this kind of mathematics, whereas the actual person has no idea how t
G G G G G G G G G G G G G G G G G
o do it?
G G
Presumably the brain has evolved so as to carry out this operations on visual images, but the
G G G G G G G G G G G G G G G G G
mechanism is only accessible for one particular purpose in this particular cognitive task of imag
G G G G G G G G G G G G G G
e processing. Until about two centuries ago there was no advantage in people (or animals) bein
G G G G G G G G G G G G G G G
g able to compute the convolution of a Gaussian for any other purpose.
G G G G G G G G G G G G
The really interesting question here is what we mean by saying that the “actual person” can
G G G G G G G G G G G G G G G G
© 2023 Pearson Education, Hoboken, NJ. All rights reserved.
G G G G G G G G