Artificial Intelligence c c
A Modern Approach
c c
Fourth Edition c
Stuart J. Russell and Peter Norvig
c c c c c
with contributions from
c c
Nalin Chhibber, Ernest Davis, Nicholas J. Hay, Jared Moore, Alex Rudnick, Mehran
c c c c c c c c c c c c
Sahami, Xiaocheng Mesut Yang, and Albert Yu
c c c c c c
cThiscsolutioncmanualciscintendedcforcthecinstructorcofcacclass.cStudentscshouldcusectheconlinecs
itecforcexercisescatcaimacode.github.io/aima-
exercises.c Thatcsiteciscopencforcanyonectocuse.cItcofferscsolutionscforcsomecbutcnotcallcofcthec
exercises;cancinstructorccanccheckctherectocseecwhichconeschavecsolutions.c Thecexercisescareco
nlinecrathercthancincthectextbookcitselfcbecausec(a)cthectextbookcisclongcenoughcascis,candc(b)cw
ecwantedctocbecablectocupdatecthecexercisescfrequently.
Copyrightc©c2022
©c2023cPearsoncEducation,cHoboken,cNJ.cAllcrightscreserved.
,EXERCISES c c
1
INTRODUCTION
Notecthatcforcmanycofcthecquestionscincthiscchapter,cwecgivecreferencescwherecanswersccancbecf
oundcrathercthancwritingcthemcout—thecfullcanswerscwouldcbecfarctooclong.
1.1 What Is AI?
c c c
Exercisec1.1.#DEFA
Definecincyourcowncwords:c (a)cintelligence,c(b)cartificialcintelligence,c(c)cagent,c(d)cra-
ctionality,c(e)clogicalcreasoning.
a. Dictionarycdefinitionscofcintelligencectalkcaboutc“theccapacityctocacquirecandcapplyckno
wledge”corc“thecfacultycofcthoughtcandcreason”corc“thecabilityctoccomprehendcandcprofitc
fromcexperience.”c Thesecarecallcreasonablecanswers,cbutcifcwecwantcsomethingcquantifi
ablecwecwouldcusecsomethingclikec“thecabilityctocactcsuccessfullycacrosscacwidecrangecofc
objectivescinccomplexcenvironments.”
b. Wecdefinecartificialcintelligencecascthecstudycandcconstructioncofcagentcprogramscthatcp
erformcwellcincacgivencclasscofcenvironments,cforcacgivencagentcarchitecture;ctheycdocthe
crightcthing.c Ancimportantcpartcofcthatciscdealingcwithcthecuncertaintycofcwhatctheccurren
tcstatecis,cwhatcthecoutcomecofcpossiblecactionscmightcbe,candcwhatciscitcthatcwecreallycde
sire.
c. Wecdefinecancagentcascancentitycthatctakescactioncincresponsectocperceptscfromcancenvi-
cronment.
d. Wecdefinecrationalitycascthecpropertycofcacsystemcwhichcdoescthec“rightcthing”cgivencw
hatcitcknows.c SeecSectionc2.2cforcacmoreccompletecdiscussion.c Thecbasiccconceptciscperf
ectcrationality;cSectionc??cdescribescthecimpossibilitycofcachievingcperfectcrational-
citycandcproposescancalternativecdefinition.
e. Wecdefineclogicalcreasoningcascthecacprocesscofcderivingcnewcsentencescfromcold,csuchct
hatcthecnewcsentencescarecnecessarilyctruecifcthecoldconescarectrue.c(Noticecthatcdoescnotcre
ferctocanycspecificcsyntaxcorcformalclanguage,cbutcitcdoescrequirecacwell-
definedcnotioncofctruth.)
Exercisec1.1.#TURI
ReadcTuring’scoriginalcpaperconcAIc(Turing,c1950).c Incthecpaper,checdiscussescseveralcobject
ionsctochiscproposedcenterprisecandchisctestcforcintelligence.cWhichcobjectionscstillccarry
©c2023cPearsoncEducation,cHoboken,cNJ.cAllcrightscreserved.
, Sectionc1.1c c WhatcIscAI? 3
weight?c Arechiscrefutationscvalid?c Cancyoucthinkcofcnewcobjectionscarisingcfromcdevelop-
cmentscsincechecwrotecthecpaper?c Incthecpaper,checpredictscthat,cbycthecyearc2000,caccomputerc
willchavecac30%cchancecofcpassingcacfive-
minutecTuringcTestcwithcancunskilledcinterrogator.cWhatcchancecdocyoucthinkcaccomputercwo
uldchavectoday?cIncanotherc25cyears?
Seecthecsolutioncforcexercisec26.1cforcsomecdiscussioncofcpotentialcobjections.
Thecprobabilitycofcfoolingcancinterrogatorcdependsconcjustchowcunskilledcthecinterrogatorci
s.c AcfewcentrantscincthecLoebnercprizeccompetitionschavecfooledcjudges,calthoughcifcyouclookc
atcthectranscripts,citclooksclikecthecjudgescwerechavingcfuncrathercthanctakingctheircjobcseriousl
y.c Thereccertainlychavecbeencexamplescofcacchatbotcorcotherconlinecagentcfoolingchumans.cFo
rcexample,cseecthecdescriptioncofcthecJuliacchatbotcatcwww.lazytd.com/lti/cjulia/.c
We’dcsaycthecchancectodayciscsomethingclikec10%,cwithcthecvariationcdependingcmoreconcthec
skillcofcthecinterrogatorcrathercthancthecprogram.c Inc25cyears,cwecexpectcthatc thecentertainmen
tcindustryc(movies,cvideocgames,ccommercials)cwillchavecmadecsufficientcinvestmentscincartif
icialcactorsctoccreatecveryccrediblecimpersonators.
Notecthatcgovernmentscandcinternationalcorganizationscarecseriouslycconsideringcrulescthatcr
equirecAIcsystemsctocbecidentifiedcascsuch.cIncCalifornia,citciscalreadycillegalcforcmachinesctocim
personatechumanscinccertainccircumstances.
Exercisec1.1.#REFL
Arecreflexcactionsc(suchcascflinchingcfromcachotcstove)crational?cArectheycintelligent?
Yes,ctheycarecrational,cbecausecslower,cdeliberativecactionscwouldctendctocresultcincmorecd
amagectocthechand.c Ifc“intelligent”cmeansc“applyingcknowledge”corc“usingcthoughtcandcreaso
ning”cthencitcdoescnotcrequirecintelligencectocmakecacreflexcaction.
Exercisec1.1.#SYAI
Tocwhatcextentcarecthecfollowingccomputercsystemscinstancescofcartificialcintelligence:
• Supermarketcbarccodecscanners.
• Webcsearchcengines.
• Voice-activatedctelephonecmenus.
• Spellingcandcgrammarccorrectioncfeaturescincwordcprocessingcprograms.
• Internetcroutingcalgorithmscthatcrespondcdynamicallyctocthecstatecofcthecnetwork.
• Althoughcbarccodecscanningciscincacsenseccomputercvision,cthesecarecnotcAIcsystems.cTh
ecproblemcofcreadingcacbarccodeciscancextremelyclimitedcandcartificialcformcofcvisualcinter
pretation,candcitchascbeenccarefullycdesignedctocbecascsimplecascpossible,cgivencthechardw
are.
• Incmanycrespects.c Thecproblemcofcdeterminingcthecrelevancecofcacwebcpagectocacquerycis
cacproblemcincnaturalclanguagecunderstanding,candcthectechniquescarecrelatedctocthose
©c2023cPearsoncEducation,cHoboken,cNJ.cAllcrightscreserved.
, 4 Exercisesc 1c c Introduction
wecwillcdiscusscincChaptersc23candc24.c Searchcenginescalsocusecclusteringctechniquesca
nalogousctocthosecwecdiscusscincChapterc20.c Likewise,cothercfunctionalitiescprovidedcb
ycacsearchcenginescusecintelligentctechniques;cforcinstance,cthecspellingccorrectorcusescacfo
rmcofcdatacminingcbasedconcobservingcusers’ccorrectionscofctheircowncspellingcerrors.cOnc
thecotherchand,cthecproblemcofcindexingcbillionscofcwebcpagescincacwaycthatcallowscretrie
valcincsecondsciscacproblemcincdatabasecdesign,cnotcincartificialcintelligence.
• Toc ac limitedc extent.c Suchc menusc tendsc toc usec vocabulariesc whichc arec veryc limitedc –
e.g.c thecdigits,c“Yes”,candc“No”c—
candcwithincthecdesigners’ccontrol,cwhichcgreatlycsimplifiescthecproblem.cOncthecothercha
nd,cthecprogramscmustcdealcwithcancuncontrolledcspacecofcallckindscofcvoicescandcaccents
.c ModerncdigitalcassistantsclikecSiricandcthecGooglecAssistantcmakecmorecusecofcartifici
alcintelligencectechniques,cbutcstillchavecaclimitedcrepetoire.
• Slightlycatcmost.cThecspellingccorrectioncfeaturechereciscdonecbycstringccomparisonctocacfi
xedcdictionary.cThecgrammarccorrectionciscmorecsophisticatedcascitcneedctocusecacsetcofcrat
herccomplexcrulescreflectingcthecstructurecofcnaturalclanguage,cbutcstillcthisciscacveryclimi
tedcandcfixedctask.
Thecspellingccorrectorscincsearchcenginescwouldcbecconsideredcmuchcmorecnearlycin
stancescofcAIcthancthecWordcspellingccorrectorcare,cfirst,cbecausecthectaskciscmuchcmorec
dynamicc–
csearchcenginecspellingccorrectorscdealcveryceffectivelycwithcpropercnames,cwhichcarecde
tectedcdynamicallycfromcusercqueriesc–cand,csecond,cbecausecofcthectechniquecusedc–
cdatacminingcfromcusercqueriescvs.cstringcmatching.
• Thisciscborderline.cThereciscsomethingctocbecsaidcforcviewingcthesecascintelligentcagentscw
orkingcinccyberspace.c Thectaskciscsophisticated,cthecinformationcavailableciscpartial,cthectec
hniquescarecheuristicc(notcguaranteedcoptimal),candcthecstatecofcthecworldciscdynamic.cAllc
ofcthesecareccharacteristiccofcintelligentcactivities.cOncthecotherchand,cthectaskciscverycfarcfr
omcthosecnormallyccarriedcoutcinchumanccognition.cIncrecentcyearsctherechavecbeencsugge
stionsctocbasecmoreccorecalgorithmiccworkconcmachineclearning.
Exercisec1.1.#COGN
Manycofctheccomputationalcmodelscofccognitivecactivitiescthatchavecbeencproposedcinvolvecq
uiteccomplexcmathematicalcoperations,csuchcascconvolvingcancimagecwithcacGaussiancorcfindi
ngcacminimumcofcthecentropycfunction.c Mostchumansc(andccertainlycallcanimals)cneverclearnct
hisckindcofcmathematicscatcall,calmostcnoconeclearnscitcbeforeccollege,candcalmostcnoconeccancc
omputecthecconvolutioncofcacfunctioncwithcacGaussiancinctheirchead.c Whatcsensecdoescitcmake
ctocsaycthatcthec“visioncsystem”ciscdoingcthisckindcofcmathematics,cwhereascthecactualcpersonch
ascnocideachowctocdocit?
Presumablycthecbrainchascevolvedcsocasctoccarrycoutcthiscoperationsconcvisualcimages,cbutct
hecmechanismcisconlycaccessiblecforconecparticularcpurposecincthiscparticularccognitivectaskcof
cimagecprocessing.c Untilcaboutctwoccenturiescagoctherecwascnocadvantagecincpeoplec(orcanima
ls)cbeingcablectoccomputecthecconvolutioncofcacGaussiancforcanycothercpurpose.
Thecreallycinterestingcquestionchereciscwhatcwecmeancbycsayingcthatcthec“actualcperson”cc
©c2023cPearsoncEducation,cHoboken,cNJ.cAllcrightscreserved.