Ai Unit 1 Notes
Ai Unit 1 Notes
2024-2025
UNIT - I
UNIT-I
TOPICS
1. Introduction:
2. HistoryofAI,
3. IntelligentSystems,
4.Foundations of AI,
5. SubareasofAI,
6. Applications.
7. ProblemSolving–State-SpaceSearch.Statespacerepresentation.
1. Introduction
2. History of AI
The history of AI had cycles of success and failures but kept introducing newcreative approaches
and systematically refining the best one.
There was no relation between human and machines till early 1950 even though
philosophers in 400 BC had conceived the ideas that mind operates on some knowledge
encoded in some natural language in the same way as the machine does.
Psychologists further strengthened the idea that humans and other living creatures can be
considered to be information processing machines.
Page2of 21
UNIT-I
Page3of 21
UNIT-I
3. IntelligentSystems
AIisacombination ofcomputerscience,physiologyand philosophy.
AIisabroadtopic,consistingofdifferentfields ,frommachinevisionto expertsystems.
AI is the science and engineering of making intelligent machines, especially intelligent
computer programs said by John McCarthy. Further he defines intelligence as the
computational part of the ability to achieve goals in the world.
Variousauthors havedefined AIdifferentlyas given below:
AIisthe studyofmentalfaculties throughtheuse computationalmodels.
The art of creating machine that performs functions, which require intelligence
when performed by people.
AI is a field of study that seeks to explain and emulate intelligent behavior
interms of computational processes.
AI isthestudyof howtomakecomputersdo thingsatwhichatthe moment, people
are better.
AI isthestudyofcomputationsthatmakeitpossibletoperceive,reasonand act.
AI is the branch of computer science that is concerned with the automation
ofintelligent behavior.
Page4of 21
UNIT-I
AI is a branch of computer science which is concerned with the study and creation of
computer systems that exhibit some form of intelligence OR those characteristics which
we associate with intelligence in human behavior.
AI program must have the capability and characteristics of intelligence such as learning,
reasoning, inferencing, perceiving and comprehending information.
UnderstandingAI
It requires understanding of the related terms such as intelligence, knowledge, coginiton,
learning.
AIshowsbestoncomplexproblemsforwhichgeneralprinciplesdonothelpmuch, though there
are a few useful general principles.
AIisalso difficultto understand byits content.
TheboundariesofAIarenotwelldefined.
Generallyitisthoughtasadvancedsoftwareengineering,sophisticatedsoftware
techniques for hard problems that cannot be solved in easy way.
AIalsoinvolves workingindomain inwhichtheproblemis oftenpoorly misunderstood.
AIprograms-likepeople-areusually notperfect,and evenmake mistakes.
It often means, nonnumericways ofsolving problems, sincepeople can't handlenumbers
well.
Nonnumericwaysaregenerally"commonsense"ways,notnecessarily thebestones.
TwoViewsofAIGoals
AIisaboutduplicatingwhatthe(human)brainDOES
Cognitive Science
AIisaboutduplicatingwhatthe(human)brainSHOULDdo
Rationality (doing things logically)
There are lot of challenges in building system that mimic the behaviour of human
brainwhich is made up of billions of neurons.
Inordertoclassifymachinesas"Intelligent",itisnecessarytodefineintelligence.
The earliest best method to gauge intelligence of a system was the Turing Test that was
proposed by Alan Turing in the year 1950.
AlanTuringdefinedintelligencebehaviorastheabilitytoachievehuman-level
performance in all cognitive task, sufficient to fool the interrogator.
Page5of 21
UNIT-I
AsystemissaidtopassTuringTestifahumanquestionerisunabletodeterminefromrepeated questions
of any kind ,whether he or she is talking to another person or to a machine/system.
Example:ELIZA
ElizawasfirstprogramdevelopedbyJosephWiezbaumtoconverseinEnglishinmid1960's It passed
turing test.
Thefollowing passageshows Eliza’stalking
Elizawasaprogramthatconversedwithuserin English.
Theprogramwasabletoconverseaboutanysubject,becauseitstoredsubjectinformationin data banks.
Elizawasabletopickupspeechpatternfromuserquestionsandprovideresponsesusingthose patterns.
Elizarephrasedtheusersstatements asquestionsandposted thosetotheuser.
TheMaincharacteristicsofELIZAare
1. Simulation of intelligence: These program are not intelligent at all in real sense. They do not
understand the meaning of utterance. Instead they simulate intelligent behavior quite effectively by
recognizing keywords and phrases..
2. Quality of response: It is limited by the sophistication of the ways in which they can process the
input text at a syntacticlevel. For examplethe numberof templates available is aserious limitation.
3. Coherence: The earlier version of the system imposed no structure on the conversation. Each
statement was based entirely on the current input and no context information was used. More
complex version of ELIZA can do a little better.
Page6of 21
UNIT-I
4. Semantics: Such system have no semantic representation of the content of either the user input
orthe reply.But it looks that it imitates the human converstation style.
CategoriesofIntelligentSystems
Systems thatthinklikehumans
Systemsthat actlikehumans
Systemsthatthinkrationally
Systemsthatact rationally
Systemsthatthinklikehumans
Mostofthetimeit isablackbox wherewearenotclear aboutourthought process.
Onehasto knowfunctioningof brainandits mechanismforpossessing information.
It is an area of cognitive science. The stimuli are converted into mental representation.Cognitive
processes manipulate representation to build new representations that are used to generate actions.
Neuralnetworkisacomputing modelforprocessinginformationsimilartobrain.
Systemsthatactlike humans
o Theoverall behaviorofthesystemshouldbehumanlike.Itcouldbeachievedbyobservation.
o Turingtest is example.
Systemsthatthinkrationally
o Such systems rely on logic rather than human to measure correctness. For thinking rationally
or logically, logic formulas and theories are used for synthesizing outcomes.
o Forexample, givenJohnisahumanandallhumansaremortalthenonecanconclude logically that
John is mortal
o Notallintelligentbehavioraremediatedbylogical deliberation
Systemsthatactrationally
o Rationalbehaviormeansdoingrightthing.
o Evenifmethodisillogical,theobservedbehaviormustberational.
Page7of 21
UNIT-I
3.3Components ofAIProgram
AItechniques mustbeindependentof theproblemdomain as far as possible.
AIprogramshould have
o knowledge base
o Navigationalcapability which contains Control strategy and inference
mechanism.
KnowledgeBase
AIprograms should be learning in natureand update its knowledgeaccordingly.
Knowledgebaseconsists offactsandrules.
CharacteristicsofKnowledge:
Itisvoluminousinnatureandrequiresproperstructuring It
may be incomplete and imprecise
Itmaykeeponchanging(dynamic)
Control Strategy
determinestheruletobeapplied
someheuristics(thump rule)maybeapplied.
Inferencerequires
search through knowledge baseandderive new knowledge using existing knowledgewith
the help of inference rules.
Inference is a general term representing the derivation of new knowledge from existing
knowledge and axioms (i.e., rules of derivation) within a single step, and can be one of many
kinds, such as, induction, deduction and abduction.
o For example, "modus tollens" is a rule of inference. Thus, one inference is the derivation
of new knowledge using a single step using modus tollens.
4. FoundationsofAI
FoundationofAIis based on
Mathematics
Neuroscience
Control Theory
Linguistics
Foundations-Mathematics
AIsystemsuseformallogicalmethodsandBooleanlogic,analysisoflimitstowhatcanbe
computed,Probability theory
Page8of 21
UNIT-I
UncertaintythatformsthebasisformostmodernapproachestoinAIapplicationscanbe handled
by
ModalandTemporallogics,Fuzzy logic.
Foundations-Neuroscience
Thisscienceofmedicinehelpsinstudyingthefunctioningofbrain.
Earlystudies(1824)reliedoninjuredandabnormalpeopletounderstandwhatpartsofbrain work
Morerecentstudiesuseaccuratesensorstocorrelatebrainactivityto humanthought
Bymonitoringindividualneurons,monkeyscannowcontrolacomputermouseusingthought alone
Moore’slawstatesthatcomputerswillhaveasmany gatesashumanshave neuronsin 2020
Researchersareworkingtoknowastohowtohaveamechanicalbrain.
SuchsystemswillrequireParallelcomputation,remapping,interconnectionstoalargeextent.
Foundations–Control Theory
Machinescanmodifytheirbehaviorinresponsetotheenvironment(sense/action loop)
Water-flowregulator,steam enginegovernor, thermostat
In1950,controltheorycouldonlydescribelinearsystemsandAIlargelyroseasaresponseto this
shortcoming.
Thistheoryofstablefeedbacksystems(1894)Buildsystemsthattransitionfrominitialstateto goal
state with minimum energy.
Foundations-Linguistics
Speechdemonstratessomuchofhumanintelligence
Analysisofhumanlanguagerevealsthoughttakingplaceinwaysnotunderstoodinother
settings
Childrencancreatesentences theyhaveneverheardbefore
Languageandthought arebelievedtobetightlyintertwined
5. SubareasofAI
Knowledgerepresentation
Theoremproving Mechanism
Gameplaying
Commonsensereasoningdealingwithuncertaintyanddecisionmaking
Learningmodels,inferencetechniques,patternrecognition, searchandmatching etc.
Logic(fuzzy,temporal,modal)in AI
Planningand scheduling
Naturallanguageunderstanding
Computer vision
Modelsforintelligenttutoring systems
Understandingspokenutterances
Robotics
DataMining
Machinetranslation systems
Neural Networks, AItoolsetc
WebAgents
Page9of 21
UNIT-I
6. Applications
Business:Financialstrategies,giveadvice
Engineering:checkdesign,offersuggestionstocreatenew product
Manufacturing:Assembly,inspection&maintenance
Medicine:monitoring,diagnosingandprescribing
Mining:usedwhenconditions aredangerous
Education: Inteaching
household: Adviceoncooking, shopping etc.
farming:prunetrees&selectively harvestmixedcrops.
Frauddetection
Spaceshuttlescheduling
Objectidentification
Informationretrieval
7. ProblemSolving
Problem Solving is a method of deriving solution steps beginning from initial description of the
problem to the desired solution. It has been one of the focus areas of AIand can be characterized
as a systematic search using a range of possible steps to achieve some predefined solution.
The task is solved by a series of actions that minimizes the differencebetween the given
situation and the desired goals.
InAI,theproblemsarefrequentlymodeledasastatespaceproblem.
State space is a set of all possible states from start to goal states. The set of states form a
graph. Two states are linked in a graph if there is an operation which can be executed to
transformonestatetoother.While solvingaproblems,thestatespaceisgeneratedintheprocess of
searching for its solution.
Difference between state space search used in AI and the conventional computer science
search methods.
In AI the states of the graph are generated as they are explored for the solution path and
discarded thereafter. In traditional search methods, search are applied to the existing graphs. The
typical state-space graph for solving problems is to large to be generated and stored in memory.
Page10of 21
UNIT-I
GeneralProblem Solving
Production system is one of the formalisms that help AI programs to do search
process conveniently in the state space problems. This system comprises of start state
andgoalstatesoftheproblemalongwithoneormoredatabasesconsistingofsuitable and
necessary information for the particular task.
PSconsistsof anumberofproduction rules.
Leftsidethatdeterminestheapplicabilityoftheruleandarightsidedescribethe action
to be performed if the rule is applied.
Leftsideoftheruleiscurrentstatewhereastherightsidedescribethenewstatethat is
obtained from applying the rule.
Theproductionrulesoperateonthedatabasesthatchangeastheseareapplied. State
space search
UsingStatespacesearch,onecanfindapathfromstartstatetogoalstatewhilesolvinga problem.
AStatespacebasically consistsoffour components.
o AsetScontaining start statesoftheproblem.
o Aset G containinggoalstates of theproblem.
o Setofnodes(states)in thegraphortree.Each noderepresentsthestatein problem-
solving process.
o Set of arcs connecting nodes. Each arc corresponds to operator that is a step in a
problem-solving process.
MissionariesandCannibalsProblem
ItwasusedbySaulAmarel asanexampleofproblemrepresentationin1968.
Inthemissionariesandcannibalsproblem,threemissionariesandthreecannibalsmustcrossa river.
Usingaboatwhichcancarryat mosttwopeople,undertheconstraint that,forbothbanks,
Iftherearemissionaries presentonthebank,theycannotbeoutnumbered bycannibals(ifthey were,
the cannibals would eat the missionaries).
Theboat cannotcrosstheriverbyitselfwithno peopleon board.
And,insomevariations,oneof thecannibalshasonlyonearm andcannotrow.
Ononebankofariver arethreemissionaries(blacktriangles)andthreecannibals (redcircles).
Thereisoneboatavailablethat canholduptotwopeopleandthattheywouldliketouseto cross the
river.
Page11of 21
UNIT-I
Ifthecannibalseveroutnumberthemissionariesoneitheroftheriver’sbanks,themissionaries will get
eaten.
Howcantheboatbeusedtosafely carryall themissionariesandcannibalsacrossthe river?
Initial state:
All missionaries, all cannibals, andthe boat are on theleft bank
5 possible actions:
onemissionarycrossing
onecannibal crossing
twomissionaries crossing
twocannibalscrossing
onemissionaryandonecannibal crossing
Final State
Allmissionaries, allcannibals,andtheboatareontheRight bank
Thepossibleoperatorsappliedinthisproblem are
{2M0C,1M1C,0M2C,1M0C, 0M1C}.
HereMismissionary and Ciscannibal.
Digitbeforethesecharactersmeansnumberofmissionariesandcannibalspossibleatany point
in time.
Page12of 21
UNIT-I
Page13of 21
UNIT-I
Page14of 21
UNIT-I
TwoPossiblesolutionpaths
SolutionPath 1 SolutionPath 2
1M1C 1M1C
1M0C 1M0C
0M2C 0M2C
0M1C 0M1C
2M0C 2M0C
1M1C 1M1C
2M0C 2M0C
0M1C 0M1C
0M2C 0M2C
0M1C 1M0C
0M2C 1M1C
Page15of 21
UNIT-I
The8-Puzzle
ProblemStatement:
The eight puzzle problem consists of a 3 x 3 grid with (1 to 8) consecutively numbered tiles
arranged on it with one empty cell. At any point, the adjacent tile can move to the empty cell
creatinganewemptycell.Solvingthisprobleminvolvesarrangingtilessuchthatwegetthegoal state
from the start state.
Startstate Goalstate
3 7 6 5 3 6
5 1 2 7 2
4 8 4 1 8
TryallpossiblepathsandreachGoalstate…
Page16of 21
UNIT-I
Page17of 21
UNIT-I
In Breadth first search,a search space tree is generated level wise until we find a solution or some
specified depth is reached.
Thesestrategiesareexhaustive,uninformedandblindsearchesinnature.
Iftheproblemissimple,thenanycontrolstrategythatcausesmotionandsystematicwill lead to a
solution
Buttosolverealworld problemeffectivecontrolstrategymust beused.
Theproblemcan besolvedbysearching forasolution.
Themainworkintheareaofsearchstrategiesistofindthecorrectsearchstrategyfora given problem.
Transforminitialstateofaproblemintosomefinal goalstate.
Problemcanhavemorethanoneintermediatestatesbetweenstartandgoalstates.
Allpossiblestatesoftheproblem takentogetheraresaidto form
o astatespaceorproblemstateandsearchiscalledstatespacesearch.
o Search is basically a procedure to discover a path through a problem space from initial
state to a goal state.
o Therearetwodirectionsinwhichsuchasearchcouldproceed.
o Datadrivensearch,forwardchainingfromthestartstate
o Goaldrivensearch,backwardchaining,fromthegoalstate
Page18of 21
UNIT-I
ForwardReasoning(Chaining):
Itisacontrolstrategythatstartswithknownfactsandworkstowardsaconclusion.
Forexamplein8puzzleproblem,westartfrominitialstatetogoalstate.
In this case we begin building a tree of move sequences with initial state as the root of the
tree.
Generatethenextlevelofthetreebyfindingallruleswhoseleftsidesmatch withrootand use their
right side to create the new state.
Continueuntilaconfigurationthatmatchesthe goalstateis generated.
Language OPS5 uses forward reasoning rules. Rules are expressed in the form of “if-
thenrule”.
Findoutthosesub-goals whichcouldgeneratethe givengoal.
BackwardReasoning(Chaining)
Itisagoaldirectedcontrol strategythatbeginswiththefinal goal.
Continuetoworkbackward,generatingmoresubgoalsthatmustalsobesatisfiedin order
to satisfy main goal.
Prolog(Programming inLogic)usesthisstrategy.
We can use both data-driven and goal-directed strategies for problem solving, depending on the
nature of the problem.
Eightpuzzleproblemhassinglestart stateandsinglegoal state
o itmakesnodifferencewhethertheproblemissolvedintheforwardorthebackward direction.
o Thecomputational effort isthesame. Inboth thesecases,samestatespace is searchedbut in
different order.
Page19of 21
UNIT-I
CharacteristicsofProblem
Someofthecharacteristics are
1. Typeofproblem
Ignorable
Recoverable
Irrecoverable
Ignorable
Thesearetheproblemswherewecanignorethe solution steps.
Ex.Inprovingatheorem,Ifsomelemmaisprovedtoprovethetheoremandlaterwe realize that it
is not useful ,then we can ignore this solution step and prove other lemma.
Suchproblemscanbesolvedusingasimplecontrol strategy.
Recoverable
Thesearetheproblemswheresolutionstepscanbeundone.
Ex. In waterjug problem, ifwehave filled up the jug, wecan empty it also. Anystatecan be
reached again by undoing the steps.
Theseproblemsareusuallypuzzlesplayedbyasingleplayer.
Suchproblems can be solved using back-tracking, so control strategy can beimplemented
using a push down stack.
Page20of 21
UNIT-I
Irrecoverable
Theseproblemswheresolution steps cannotbeundone.
Ex.Anytwoplayersplayingchess, playingcards,snakeandladders, etc.
Suchproblemscan besolvedusing aplanning process.
2. Decomposabilityofproblem
Divide the problem into a set of independent smaller sub-problems, solve them and combine the
solution to get final solution.
The process of dividingsub problems continuestill we get the set of smaller sub-
problemsforwhich a small collection of specific rules are used.
Divideandconquer techniqueiscommonly usedmethodforsolvingsuch problems.
Eachsubproblemissimplertosolveand canbehandedtoadifferent processor.
Thussuchproblemscanbesolvedinparallelprocessingenvironment.
3.Roleof knowledge
Knowledgeplaysavitalroleinsolving any problems.
Knowledgecouldbeintheformsofrulesandfactswhichhelpsgeneratingsearchspacefor finding
solution.
4.Consistencyof KnowledgeBaseusedinsolvingProblem.
Makesurethattheknowledgebased usedto solvethe problemis consistent.
Inconsistentknowledgebasewill leadtowrongsolution.
o Ex.Ifitishumid,it willrain
o Ifit is sunny, then it is daytime
o Itissunny,it isnighttime
Aboveknowledgeisnotconsistentasthereisacontradictionbecauseitisdaytimecanbededuce from
knowledge ,thus both daytime and nighttime is not possible at the same time.
Page21of 21