ExerciseSolutions n
for n
Artificial Intelligence n
A Modern Approach
n n
Second Edition n
Stuart J. Russell and Peter Norvig
n n n n n
Upper Saddle River, New Jersey 07458
n n n n n
,Library n of n Congress n Cataloging-in-Publication n Data
Russell, nStuart nJ. n(Stuart nJonathan)
Instructor’s nsolution nmanual nfor nartificial nintelligence n: n a nmodern
napproach n(second nedition) n/ nStuart nRussell, nPeter nNorvig.
Includes nbibliographical nreferences nand nindex.
1. nArtificial nintelligence I. nNorvig, nPeter. nII. nTitle.
Vice President and Editorial Director, ECS: Marcia J. Horton
n n n n n n n n
Publisher: Alan R. Apt n n n
Associate Editor: Toni Dianne Holm
n n n n
Editorial Assistant: Patrick Lindner
n n n
Vice President and Director of Production and Manufacturing, ESM: David W. Riccardi
n n n n n n n n n n n
Executive Managing Editor: Vince O’Brien
n n n n
Managing Editor: Camille Trentacoste
n n n n
Production Editor: Mary Massey
n n n n
Manufacturing Manager: Trudy Pisciotti
n n n n
Manufacturing Buyer: Lisa McDowell
n n n n
Marketing Manager: Pamela Shaffer
n n n n
c 2003 Pearson Education, Inc.
n n n n
Pearson Prentice Hall
n n n
Pearson Education, Inc. n n
nUpper Saddle River, NJ n n n
07458
n
All rights reserved. No part of this manual may be reproduced in any form or by any means, without
n n n n n n n n n n n n n n n n n n
permission in writing from the publisher.
n n n n n n
Pearson Prentice Hall R is a trademark of Pearson Education, Inc.
n n n n n n n n n n
Printed in the United States of America
n n n n n n
10 n n 9 8 n n 7 6 n n 5 4 n n 3 2 n n 1
ISBN: 0-13-090376-0 n
Pearson Education Ltd., London
n n n
Pearson Education Australia Pty. Ltd., Sydney
n n n n n
Pearson Education Singapore, Pte. Ltd.
n n n n
nPearson Education North Asia Ltd., Hong
n n n n n
Kong Pearson Education Canada, Inc.,
n n n n n
Toronto Pearson Educacio´n de Mexico, S.A.
n n n n n n
de C.V. Pearson Education—Japan, Tokyo
n n n n n
Pearson Education Malaysia, Pte. Ltd.
n n n n
Pearson Education, Inc., Upper Saddle River, New Jersey
n n n n n n n
,Preface
This Instructor’s Solution Manual provides solutions (or at least solution sketches) for
n n n n n n n n n n n
almost all of the 400 exercises in Artificial Intelligence: A Modern Approach (Second
n n n n n n n n n n n n n
Edi- tion). We only give actual code for a few of the programming exercises; writing a lot of
n n n n n n n n n n n n n n n n n n
code would not be that helpful, if only because we don’t know what language you prefer.
n n n n n n n n n n n n n n n n
In many cases, we give ideas for discussion and follow-up questions, and we try to
n n n n n n n n n n n n n n
explain why we designed each exercise.
n n n n n n
There is more supplementary material that we want to offer to the instructor, but we
n n n n n n n n n n n n n n
have decided to do it through the medium of the World Wide Web rather than through a
n n n n n n n n n n n n n n n n n
CD or printed Instructor’s Manual. The idea is that this solution manual contains the material
n n n n n n n n n n n n n n n
that must be kept secret from students, but the Web site contains material that can be updated
n n n n n n n n n n n n n n n n n
and added to in a more timely fashion. The address for the web site is:
n n n n n n n n n n n n n n n
http://aima.cs.berkeley.edu
and the address for the online Instructor’s Guide is:
n n n n n n n n
http://aima.cs.berkeley.edu/instructors.html
There you will find:
n n n
Instructions on how to join the aima-instructors discussion list. We strongly n n n n n n n n n n
nrecom- mend that you join so that you can receive updates, corrections, notification
n n n n n n n n n n n n
nof new versions of this Solutions Manual, additional exercises and exam questions,
n n n n n n n n n n n
netc., in a timely manner. n n n n
Source code for programs from the text. We offer code in Lisp, Python, and Java,
n n n n n n n n n n n n n n
nand point to code developed by others in C++ and Prolog.
n n n n n n n n n n
Programming resources and supplemental texts. n n n n
nFigures from the text; for overhead transparencies.
n n n n n n
nTerminology from the index of the book. n n n n n n
Other courses using the book that have home pages on the Web. You can see example
n n n n n n n n n n n n n n n
nsyllabi and assignments here. Please do not put solution sets for AIMA exercises on
n n n n n n n n n n n n n
npublic web pages! n n
AI Education information on teaching introductory AI courses.
n n n n n n n
Other sites on the Web with information on AI. Organized by chapter in the book; check
n n n n n n n n n n n n n n n
nthis for supplemental material.
n n n
We welcome suggestions for new exercises, new environments and agents, etc. The
n n n n n n n n n n n
book belongs to you, the instructor, as much as us. We hope that you enjoy teaching from it,
n n n n n n n n n n n n n n n n n n
that these supplemental materials help, and that you will share your supplements and experi-
n n n n n n n n n n n n n n
ences with other instructors.
n n n n
iii
,