self learning material artificial intelligence

253
Self Learning Material Artificial Intelligence (MCA 501) Course: Masters in Computer Applications Semester-V Distance Education Programme I.K. Gujral Punjab Technical University Jalandhar

Upload: others

Post on 26-Dec-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Self Learning Material Artificial Intelligence

Self Learning Material

Artificial Intelligence(MCA 501)

Course: Masters in Computer Applications

Semester-V

Distance Education Programme

I.K. Gujral Punjab Technical University

Jalandhar

Page 2: Self Learning Material Artificial Intelligence

SyllabusI.K. Gujral Punjab Technical University

MCA-501

ArtificialIntelligence

Section-A

Introduction: Intelligence, Foundations of artificial intelligence(AI). History of AI; Turing

Test, The Underlying assumption, and AItechniques, Level of Model.

Problems, Problem Space and Search: defining the problem as a state space search, ProductionSystem, Problem Characteristics, Production System and its characteristics. Water Jug problemand its spacesearch.

Section-B

Un-informed Search: Depth First Search, Breadth First Search its advantages and

disadvantages. Informed Search Strategies: Heuristic functions Best first search, A*

algorithm, Depth first Search, Breadth first search, Best First Search, advantages and

disadvantages of informed search techniques. Iterative deepening, Game playing- Perfect

decision game, imperfect decision game, evaluation function, alpha-beta pruning.

Section-C

Knowledge Representation: Characteristics and knowledge representation Issues:

representation and mapping. Reasoning: Propositional Logic, predicate logic(firstorderlogic)

FOPL, logical reasoning, forward chaining, backward chaining; representing simple facts in

logic, representing instance and IS A relationships, resolution principle with examples. Clausal

form Representation, Inference.

Section-D

Uncertainty: Basic probability, Bayes rule, Belief networks, Default reasoning, Fuzzy sets

and fuzzy logic; Decision making-Utility theory, utility functions, Decision theoretic expert

Page 3: Self Learning Material Artificial Intelligence

systems.

Weak-slot and-filler structures:Frames, Strong slot and filler structures: Conceptual

dependency,scripts. Communication: Communication among agents, formal grammar, parsing,

grammar. NaturalLanguage processing and its problems, discourse and pragmatic processing.

Suggested/Readings &Books

1.StuartRussellandPeterNorvig.ArtificialIntelligence–A Modern Approach, Pearson EducationPress, 2001.

2.Kevin Knight, Elaine Rich, B.Nair, Artificial Intelligence, McGraw Hill,2008.

3. George F. Luger, Artificial Intelligence,PearsonEducation,2001.

4. Nils J. Nilsson, Artificial Intelligence: A New Synthesis, Morgan Kauffman, 2002.

Page 4: Self Learning Material Artificial Intelligence

Table of Contents

Chapter No. Title Written By Page No.

1. Overview of Artificial Intelligence Mrs. Namarta Kapoor, DAVCollege, Jalandhar

1

2. More about Artificial Intelligence Mrs. Namarta Kapoor, DAVCollege, Jalandhar

18

3. Problem, Problem Space Concepts Mrs. Namarta Kapoor, DAVCollege, Jalandhar

36

4.State Space Search

Mrs. Namarta Kapoor, DAVCollege, Jalandhar

54

5.Search in Artificial Intelligence

Mrs. Namarta Kapoor, DAVCollege, Jalandhar

75

6.Heuristic Search Techniques

Mrs. Namarta Kapoor, DAVCollege, Jalandhar

92

7.Game Playing

Mrs. Namarta Kapoor, DAVCollege, Jalandhar

108

8.Knowledge Representation

Mrs. Monika Chopra, DAVCollege, Jalandhar

124

9.Logic in Artificial Intelligence

Mrs. Monika Chopra, DAVCollege, Jalandhar

139

10.Probability and Bayes’ Theorem

Mrs. Monika Chopra, DAVCollege, Jalandhar

166

11. Fuzzy Logic and Fuzzy Sets Mr. Jaskirat Singh, DAVCollege, Jalandhar

181

12.Expert Systems

Mr. Jaskirat Singh, DAVCollege, Jalandhar

196

13.

Slots and Filler StructuresMr. Jaskirat Singh, DAVCollege, Jalandhar

214

14.

Natural Language ProcessingMr. Jaskirat Singh, DAVCollege, Jalandhar

232

Page 5: Self Learning Material Artificial Intelligence

Reviewed ByDr. Dalvir Kaur, IKGPTUMain Campus,

Kapurthala

©IK Gujral Punjab Technical University JalandharAll rights reserved with IK Gujral Punjab Technical University Jalandhar

Page 6: Self Learning Material Artificial Intelligence

Lesson 1

Overview of Artificial Intelligence

Structure of the Lesson

1.0. Objectives

1.1. Introduction of Artificial Intelligence

1.2. Definitions of Artificial Intelligence

1.3. Foundations of Artificial Intelligence

1.4. History of Artificial Intelligence

1.5. Turing Test

1.6. Summary

1.7. Glossary

1.8. Answers to check your Progress/ Self-Assessment Questions

1.9. Model Questions

1.0. Objectives.

After completing this chapter, the student will be able to:

Get the introduction and overview of artificial intelligence. Discuss the meaning of artificial intelligence. Artificial Intelligence Discipline. Definitions of Artificial Intelligence. Foundation of Artificial Intelligence. History of Artificial Intelligence. Turing Test.

1.1. Introduction of “Artificial Intelligence”

Artificial Intelligence is the backbone of modern era. If we look around, almost everything is based upontechnology which is referred as Artificial Intelligence. Basically, the meaning of “Artificial Intelligence”presents that it is the branch of science and engineering of making intelligent machines. It is concernedwith getting computers doing things intelligently like human beings. It is the concept of reading that howa human brain thinks, learn, take decisions, and act while trying to find solution of the providedsituation, and then in the same way we use such results of the reading and understandings for developingintelligent and smart machines. While analyzing the power and capacity of the computer systems, adeveloper always wonders that is it possible for a machine to think. So, the simulation of ArtificialIntelligence started with the motivation of creating intelligent machines like human beings. In the coming

Page 1 of 248

Page 7: Self Learning Material Artificial Intelligence

years, the whole world will be handled by artificial intelligence. Figure 1.1 shows our dependence forartificial intelligence.

Figure No.1.1.Scope of Artificial Intelligence.

Artificial intelligence concepts presents that how to design computers to perform tasks which at the samemoment of time can be done better by human beings.AI is an area of study that focus on computationaltechniques for performing different tasks that apparently require knowledge and intelligence whenperformed by humans. Artificial Intelligence is the one of the popular area of computer science and othersubfields that is connected with the simulation of intelligent behavior of machines same as people behavein daily routine and do important decisions. Artificial Intelligence is based upon the fundamentalimplementation of data structures used in Knowledgeorganization and representation, the algorithmsneeded to apply that knowledge andprogramming techniques used in their implementation.

“John McCarthy” is considered as the father of “Artificial Intelligence”.Artificial intelligence isconsidered as the broader field of doing research and growth in science and technology based on domainssuch as:

“Biology” “Cognitive Science” “Physics” “Linguistics” “Mathematics” “Psychology” “Computer Science and Engineering.”

A major seek of Artificial Intelligence is in the simulation of computer programs, algorithms andfunctions related with human intelligence, such as thinking, learning, reasoning and solving a particularproblem. The following diagram shows how Artificial intelligence is related to different subfields. Figure1.2 shows the subfields of artificial intelligence.

Page 2 of 248

Page 8: Self Learning Material Artificial Intelligence

Figure No.1.2.Subfields of Artificial Intelligence.

Figure 1.2 Areas of Artificial Intelligence

Highly technical and specialized Research associated with artificial intelligence is the main area ofinterest of artificial intelligence involves programming systems in few particularfollowing disciplinessuch as:

“Learning” “Planning” “Knowledge” “Logical Reasoning” “Capacity of manipulation and able to rotate and move particles” “Problem solving” “Perception”

The term: “Knowledge Engineering” is known as the heart of Artificial intelligence innovations andresearch areas.It is really wonderful to listen that Machines have the capability to think, act and behave inthe same way human beings do only if they have plenty of information relating to the real world.Artificial intelligence has capability to access different objects, classes, procedures, categories,interactions, functions, attributes, links, algorithms and association between all among them to elaborateand understand the concept of“Knowledge Engineering”. It means that having information which can beprocessed into useful knowledge, we are able to develop artificial humans. How exciting this subject is asit will provide us the knowledge of new concepts and opportunity to know a lot about ourselves.Whilesimulating natural thinking power that is “Common Sense”, thinking ability and problem-solving powerin machines is a difficult task.“Machine learning” is also one of the interesting andimportant parts ofArtificial Intelligence.

“Learning” is the ability to learn new things from the surrounded environment. Learning is of varioustypes.

1. Supervised Learning2. Unsupervised Learning3. Reinforcement Learning

Page 3 of 248

Page 9: Self Learning Material Artificial Intelligence

4. Induced Learning5. Auditory Learning6. Episodic Learning7. Motor Learning8. Observational Learning9. Perceptual learning10. Relational Learning11. Stimulus Response Learning

Learning without any kind of supervision means learning the system without a teacher which needs acapability to recognize samples in streams of inputs but on the other hand, learning with supervisioninvolves:

“Classification & Regressions”.

Classification or clustering: It represents the category a pattern that links and associates to.

Regression: It represents a set of numerical inputs or outputsas examples, and then thereby findingout functions which have the capability to generate suitable outputs from the provided suitable inputs.

Procedures of “Machine Learning”can be easily implemented mathematically and their performancecan be analyzed in a well-defined theoretical “Computer Science and Engineering” field. This ismostly referred as “Computational Learning Theory”. To overcome and minimize different tasksofthe whole world, “Machine perception” works with the ability to use sensory inputs, analyzethoseinputs with few fundamental sub-problems such as “facial”, “object”, “pattern”, “attributes”andspeech recognition, computer vision all are the powers to enhance the capability of intelligentsystems. Figure 1.3 shows how we are going to be serviced by artificial intelligence that robots willgive water to our plants.

Figure No. 1.3.Service by Artificial Intelligence.

Artificial Intelligence can be divided into two parts.

1. Strong Artificial Intelligence2. Weak Artificial Intelligence

Page 4 of 248

Page 10: Self Learning Material Artificial Intelligence

Strong Artificial Intelligence follows the principle that the machines could be design to think like humanbrains or in the other words act like humans to have capability to take quick decisions on the basis ofcurrent situation or environment. Thus Strong AI guarantees that in near future we will be surrounded bysuch kinds of machine which can completely works like humans and systems could have intelligence.Presently, Artificial intelligence is the interesting research area of researchers to create strong AI. Figure1.4 gives an example of need of artificial intelligence.

Figure No.1.4.Strong Artificial Intelligence.

Weak AI is simply based on the principle by the fact that machines can be designed or simulates to act asif they are intelligent as human beings. Weak AI states that thinking, understanding, acting like featurescan be easily simulated while designing machines to make them more useful, powerful and reliable toolsand this already started to happen and the world is going to be full of intelligent machines soon asresearchers are working in this area very sensibly. Figure 1.5 represents weak artificial intelligence.

Page 5 of 248

Page 11: Self Learning Material Artificial Intelligence

Figure No.1.5.Weak Artificial Intelligence.

For Example

When a human being plays chess against a machine, the human player may feel as if the machine isactually the real competitor who is making impressive moves. But the chess application is not reasoningand planning at all. Actually, it is programmed earlier to play chess and all the moves it takesarepreviously programmed in to the machine by a human which is the most intelligent creature of thisworldand that is how it is ensured that the software will make the right moves at the right times.Figure1.6 shows how a system can be trained in such a way that it is ready to compete with the human mind.

Figure No.1.6. An Intelligent Program.

The main targets of artificial intelligence are:

Is it possible forMachines to think same as humans? Is it possible forMachines to think logically? Is it possible forMachines to accomplish tasks same as humans? Is it possible forMachines to accomplish tasks logically?

Check your progress/Self-assessment Questions.

Q1.What is Artificial Intelligence?

Page 6 of 248

Page 12: Self Learning Material Artificial Intelligence

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Q2. Differentiate Strong AI and Weak AI.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

1.2. Definitions of Artificial Intelligence

“Artificial Intelligence is a streamof computer science and engineering which deals withsimulating machines with the ability to act like they have human intelligence.”

“Artificial Intelligence contains the capability to provide such wonderful power to a machine thatit can copy human intelligence.”

“The field of computer science that deal with simulatingcomputer programs that can solveproblems creatively.”

“Artificial Intelligence (AI) is both the intelligence of machines and the stream of computerscience which aims to create it.”

“Artificial Intelligence is a series of albums by Warp Records released in the early 1990s toexhibit the capabilities and sounds of electronic music. It was meant more for the mind than thebody.”

“The history of artificial intelligence begins in ancient past, with myths, stories and rumorsofbeings simulated by craftsman and enriched with intelligence and consciousness.”

“Intelligence exhibited by an artificial (non-natural, man-made) entity; The stream ofcomputer science and engineering dealing with the reproduction of human-level thoughtincomputers; The most necessary quality of a machine which thinks in a manner similar to oronthe same general level as a human being.”

“This refers to a set of procedures or algorithms that can take decisions in a logical way. Forexample, the AI routine for an enemy in a game.Occurs when analysis and the search for truthtakes preference over the creative and enrichedhuman activities of a task. People who practice anddoing research in artificial intelligence behave with so muchreasoning, thinking and analysis thatemotions, intuition, and art of making decisions are sacrificed.”

“Research into spacecraft autonomy, emerging properties of complex systems, automatedSystem design and in general on the applications of the methods developed by the AIResearchers to problems related to space system.”

“Tools that exhibit human behavior and intelligence including self-learning systems,intelligentagents, robots, expert systems, pattern recognition and voice recognition, natural and automatedtranslation.”

“Information processing by simulation of the cerebral, nervous or cognitive processes.” “Applies to a computer system that is able to operate in a manner similar to that of human brain

intelligence; that is, it can process natural language and is capable of solving problems,understanding, analyzing, acting, responding, learning, adapting, clustering, recognizing,classifying, self-improvement, and reasoning.”

Page 7 of 248

Page 13: Self Learning Material Artificial Intelligence

“The stream of computer science that attempts to program computers to react as ifthey wereunderstanding, analyzing, thinking – capable of understanding, reasoning, adapting to newsituations, and learning new skills.”

“The developments of machines that think like us and respond like us.” “Computational techniques to automate tasks that need human intelligence and theability to

reason.” “A branch of information science aiming at computational models of human cognition,such as

expert systems.” “An algorithm by which the machine gives the illusion of behaving and acting like a human Also,

theactivity of a character in a game as it reacts to other objects in the game.” “The discipline of building special machines that can perform complex activitiesusually only

performed by humans.” “The concept of making computers does tasks once contemplated to entail thinking.” “AI makes computers play chess and recognize handwriting and speech.” “A stream of computer science whose goal is the simulation of machines that have

attributeslinked and associated with human intelligence, such as behaving, learning, reasoning,vision, understanding speech, and, ultimately, consciousness.”

“Field of study concerned with generating computer programs capable of learning andprocessingtheir own ideas and thoughts.”

“A growing set of computer problem-solving techniques being developed to imitatehumanthought or decision making processes.”

“Default behavior of units, programmed into the game, to give basic reactions andspecifically tosimulate a confrontation with another player.”

“It is the study and design of intelligent agents, where an intelligent agent is a system thatrecognizes its environment and takes necessary actions which maximize its probability ofsuccess.”

“The simulation of human mental ability and skills through rules and such things as patternrecognizing such asspeech or visual images, solving problems, or making medical diagnoses.”

“The ability of a machine system to perceive anticipated orparticipated in new conditions, decidewhat necessary actions must be taken under the severalconditions,and plan the actionsaccordingly.”

“A set of procedures or algorithms designed to automate the actions of an intelligent being –suchas a human or animal.”

“A broad term describing the stream of developing machines to simulate humanthought processes

and behaviors.”

Check your Progress/Self-Assessment Questions

Q3. Give any two definitions of Artificial Intelligence.

Page 8 of 248

Page 14: Self Learning Material Artificial Intelligence

-------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------

1.3.Foundation of Artificial Intelligence

Homo sapiens are a scientific name which is given to human beings by themselves. Homo sapiensmean“man the wise”.The meaning of the word explainshuman beings having“Mental Capacities” which are soimpressive to everyday lifestyles of humans and their capability to understand themselves. The areaof artificial intelligence holds the ability to understand intelligent behavior of humans. There isanimportant and fundamental reason to give the answer to the question that claims that why there is needto understand and learn the concept of artificial intelligence. The very impressive answerto thisfundamental question is that generally, it is a wonderful experience to study artificial intelligence isactually learning the concept of learningmore and more about ourselves. Artificial Intelligence focus togenerate intelligent systemsas well as understand them.AI has done innovation of many magical,important, impressive systems at this initial step of its progress. Rather we cannot analyze or judge theupcoming times in the future but artificially intelligent systems are the wonderful computers with human-like intelligence and even better than it. It is going to have a very large influence on daily routines ofhuman beings.Humans are going to be fully dependent upon the technology of artificial intelligence inthe coming future. Figure 1.7 shows the four areas of computing.

Figure No.1.7.Areas of Computing.

Artificial Intelligence claims to the concept of solving problems related todifficult tasks and ultimatepuzzles. The very fundamental question is:

Page 9 of 248

Page 15: Self Learning Material Artificial Intelligence

1. “How is it possible for a tiny human brain, whether biological or electronic, to think, understand,predict, actand manipulate a world which is far larger and more complicated?”

2. “How it is possible for us to go about making something with those attributes?”

These are very difficult questions to answer, but theresearchers and scientists in the field of artificialintelligence are having strong proofs that impossible also states about its possibility. All the researchershave to do is lookthem in the mirror to see wonderful example of an intelligent system.

Artificial Intelligence is one of the wonderful and impressive disciplines.

Artificial Intelligence contains a huge variety of subfields, such as “Perception and Logical reasoning”, tospecific tasks such as

“Game Playing” “Proving Mathematical Theorems” “Writing Poetry” “Expert System” “Natural Language Processing” “Diagnosing Diseases”.

Even,researchers and scientists in other various branches are also stepping towards artificial intelligence,where they are able to research in the various instruments and grammar’s, vocabulary to systematize andsimulate the intellectual tasks on which they have been performing all of their lives during research andin the search of innovation. In the same way, researchers in Artificial Intelligence can have the ability tochoose to implement their methods, techniques, formulas to any field of human intellectual fashion.Artificial Intelligence is a universal field.

Check your progress/Self-assessment Questions

Q4.Who is considered as father of Artificial Intelligence?

-------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------------

Q5. Define the term “Homo sapiens”.

-------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------

Q6.What is the four areas of computing?

-------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------

Page 10 of 248

Page 16: Self Learning Material Artificial Intelligence

1.4. History of Artificial Intelligence

During the ten years period of 1940 to 1950, few researchers and scientists from different streams likemathematics, philosophy, neural science, psychology, computer science and engineering,sociology,economics and political science were getting interest in the term artificial intelligence and theywere really curious to discuss that whether it was possible to develop machines which can have anartificial brain. Now the very first question arises in our minds is that from where the term “ArtificialIntelligence” comes into existence. Here is the story: “The term artificial intelligence was firstpropounded in 1956, at the Dartmouth conference, and since then Artificial Intelligence has been popularbecause of the theories and principles developed by its dedicated researchers. Although in its shortmodern history, advancement in the areas of AI have been slower than estimated, progress continues tobe made and researchers are taking interest in this field and trying to develop new technologies. Sincefrom the birth of AI from 4 decades ago, there have been an enormous variety of AI programs, and theyhave been supporting other technological advancements.”

During 1941’s,there was an invention which was revolutionized for the storage and processing ofinformation. That wonderful discoverywas of the electronic computers developed in both the Germanyand US. The early machines or computers needed large, separate air-conditioned rooms, and even to get aprogram running, there was need of configuration of thousands of wires which was really a very difficulttask. During 1949, with graceful discovery of the stored program accomplished the task of formulation ofa program and there was enhancements in “Computer Theory” lead to “Computer Science andEngineering”and eventually“Artificial intelligence” came into existence.Although the technologynecessary for AI is provided by computer, researchers and scientists observed that there was link betweenhuman intelligence and machines. A Person whose name was “Norbert Wiener” observed the associationbetween human intelligence and machines on the principle of “Feedback Theory”. If we consider anexampleof thermostat which is the most familiar example of “Feedback Theory”. It controls thetemperature of an environment by collecting the actual temperature of the environment and compares itto the desired temperature level,and response back by turning the heat up or down.

After successful completion of the conference, AI started to pick up gears and motion. It comes inpipeline within seven years. Although the stream was still undefined, ideas formed at the conference wereneeded to be re-checked, re-considered and re-investigated experimented and built upon.

In 1957, The “General Problem Solver (GPS)” was experimented which was the first version of a newprogram.The program developed by the same pair which developed the“Logic Theorist”. The GPS wasan enhancement of “Wiener’s feedback principle”, and was capable of solving common sense problemsat greater extent. IBM contracted a team to research artificialIntelligence; a couple of years after theGPS,“Herbert Gelerneter” did research on a program for solving “Geometry Theorems” for three years.While more programs and researches were being developed,“John McCarthy” was busy in the wonderfulinnovation of developing a major breakthrough in Artificial intelligence ancient time’s.The “LISPlanguage”was introduced in 1958 by John McCarthy, his major development in the field of Artificialintelligence, is being still in use today. “LISP stands for List Processing”, and it was very early getpopularity among most AI developers as the language of choice.The following is the list of milestones ofartificial intelligence with their foundation and fruitful years.

Study of journey of artificial Intelligence with foundation years and innovations

During Nineteen Twenty Three, “Karel Kapek's” name of a person whose play which was titled

Page 11 of 248

Page 17: Self Learning Material Artificial Intelligence

“Rossum's Universal Robots” was started inLondon and it was the place where the term “Robot”

was very first time used.

In Nineteen Forty Three. It was a good time which invented “Neural Networks.” Neural

networks is the building of machines same as human brains. Neurons are the components of

human brains that are why this technology was given the name of neural network.

In Nineteen Forty Five, Again it was a magical time period as the term: “Robotics” came in to

existence by “Isaac Asimov, Columbia University alumni.”

During Nineteen Fifty, It was the year of revolution as a great person “Alan Turing” discovered

an approach which was named as “Turing Test” for estimation and checking of reasoning and

intelligence.

During Nineteen Fifty Six,this was the year of productivity and fruitful results came out from the

efforts of person whose name was “John McCarthy” discovered the term “Artificial Intelligence”

and gave demo of the first running Artificial intelligence program at “Carnegie Mellon

University.”

In the year Nineteen Fifty Eight, when the work came in pipeline and progress was started. “John

McCarthy” who was the founder of artificial intelligence developed LISP whose full form is

“List Processing” programming language for artificial intelligence.

In Nineteen Sixty Four, People were doing research in the field of artificial intelligence very

excitingly and a person whose name was “Danny Bobrow” he found and concluded something

in his dissertation at MIT and he tried to prove in his work that machines can understand natural

language to solve algebra word problems correct manner.

During Nineteen Sixty Five, Interest of people in the field of artificial intelligence continues and

people were doing their doctorate in this area and again in this year “Joseph Weizenbaum” who

built “ELIZA” which was an interactive issue that takes a dialogue in English.This geniuswork

was again done at MIT.

During Nineteen Sixty Nine, now the real inventions came in existence as scientists and

researchers of“Stanford Research Institute” developed “Shakey” which was the name of the

robot having equipped with perception, and problem solving, locomotion.

During Nineteen Seventy Three,“Freddy”, Robot was capable of using vision to locate and

assemble models was built by “The Assembly Robotics group at Edinburgh University.”

In the year Nineteen Seventy Five,“Stanford Cart, The first computer-controlled autonomous

vehicle was built.”

Page 12 of 248

Page 18: Self Learning Material Artificial Intelligence

During Nineteen Eighty Five, “Aaron was created and provided the drawing program by Harold

Cohen.”

During Nineteen Ninety,Most Technological advancements in almost every field of Artificial

Intelligence –.

Mathematical problem solving.

Playing games such as chess.

Demos in machine learning.

Planning.

Knowledge Representation.

Scheduling.

Data Mining.

Web Crawler.

Pattern Recognition.

Natural Language Processing.

Virtual Reality

Medical diagnosis

In the year, 1997, “Garry Kasparov”, world chess champion, beats “The Deep Blue Chess

Program.”

In the year, 2000, Now finally the era comes of Intelligent Robots. MIT presents a robot, named

Kismet with a face that expresses emotions.

Till date, research is stepping towards the innovations to make impossible things to make them

possible. This field is trying to find those aspects which are beyond the limit of human society

but the term artificial will make it possible hopefully in the upcoming years and during that time

all of our works will be done by machines.

Check your progress/Self-assessment Questions

Q7.Who organized a conference to find out interest and passion in the field of artificialintelligence during 1956?

Q8. What is the name of the program which was tested in 1957?

Page 13 of 248

Page 19: Self Learning Material Artificial Intelligence

1.5. Turing Test

The brilliant British mathematician Alan Turing is often described as the father of computer science.Alan Turing was a brilliant British pioneering computer scientist, mathematician, logician, cryptanalystand theoretical biologist. He decoded the German navel ciphers at Bletchley Park, the code breakingcenter, during Second World War. He used ‘bombs’, a complicated machine to remove large amount ofincorrect solutions to the code to achieve correct solutions. Due to his work the war ended two yearsearlier. He died at the age of 57, twoyearsafter his achievement. In 1936, Turing had developed atheoretical device known as Turing Machine; the machine mainly consisted of long tapes divided intosquares, representing a symbol. The machine was operated according to the instructions given in theinstruction manual. The operator had to move the tape forth and back one square and a symbol at aninterval.

Alan Turing is popular for innovation a test for artificial consciousness called the Turing Test.In 1951,Alan Turing proposed a test The Imitation Game for solving the problems of machine intelligence issues.According to Turing test, a machine is considered to have artificial intelligence if it can perform ashuman responses under certain conditions. In Turing's test, if the human being judging the test is unableto determine whether an answer has been given by a machine or by another human being, then thecomputer is considered to have "passed" the test.

In the basis of Turing Test, there are three nodes. Two of the nodes are handled by humans, and the thirdnode is handled by a machine. Each node is separated physically from the other two nodes. One human ispositioned as the questioner. The human being and the computer are positioned as the respondents. Thequestioner investigates both the human respondent and the machine according to a specified format,within a certain area and context, and for a predetermined length of time. After the determined time, thequestioner tries to decide which node is operated by the human respondent, and which node is handled bythe computer. The test is repeated no. of times. If the questioner makes the correct observation in half ofthe test runs or less, the machine is considered to have artificial intelligence, because the questionerdetermines it as human. Figure 1.8 shows concept of Turing test.

Figure No.1.8.Turing Test.

The Turing Test has also been criticized, in particular because of the nature of the questioning must belimited in order for a machine to reveal human-like intelligence. For example, a machine might scorehigh when the questioner asks the queries so they have true or false responses and tends to a narrow field

Page 14 of 248

Page 20: Self Learning Material Artificial Intelligence

of knowledge, such as “Mathematical Number Theory” .If answers to questions of a broad area ofconversational nature; however, a machinewould not be expected to act like a human being. This is reallytrue if the subject is sentimentally charged or socially sensitive.

1.6. Summary.

This chapter focuses on the study of origin of “Artificial intelligence”. As now we all are familiar withartificial intelligence and understood that it is the branch of science and engineering of buildingpowerful, smart and intelligent machines. It is concerned with getting computers doing thingsintelligently like human beings.Different people have different views about AI. The main targets ofartificial intelligence are:

1. Is it possible forMachines to think same as humans?2. Is it possible forMachines to think logically?3. Is it possible forMachines to accomplish tasks same as humans?4. Is it possible forMachines to accomplish tasks logically?

If we go in deep of ancient times of artificial intelligence begins with very good time, and having goodhistory with myths, stories and rumors that it was simulated by craftsman and enriched with intelligenceand focuses.This claims to a set of procedures that can take decisions in a logical andconceptualway.Artificial Intelligence focus to generate intelligent systems as well as understand them.AIhas developed many magical, important, attractive and wonderfulsystems during its initial footprints ofits progress. In fact, we cannot judge or estimate the future and growth but artificially intelligent systemsare going to be the wonderful computers with human-like intelligence and even going to be much betterthan it, intelligent systems wouldhave a very large impact on day to day life and on the futurealso.Artificial Intelligence is one of the newest disciplines. Artificial intelligence is branch of science andtechnology which has pillars of various domains. The history of Artificial Intelligence had many cyclesof progress and success. Further research and development programs are simultaneously carried out forbetterment in technology.Recent progress in research and simulation of the artificial intelligence conceptsare going hand to hand of researchers with enhancements in the abilities of real systems.

1.7. Glossary

AI Technique:Artificial intelligence techniques are the ways that can be used to generate and

produce computer programs usually observed as forms of artificial intelligence.

Artificial Intelligence (AI):Artificial Intelligence (AI) is generally defined as the art of making

machines do things that need intelligence when done by humans.

Strong AI Systems:Strong AI systems are those that most completely look for to emulate human

thought and cognitive potentials through a broad range of functions.

Weak AI Systems:Artificial intelligence techniques that build up weak AI systems are narrower

1.8. Answers to check your Progress and Self-Assessment Test

Page 15 of 248

Page 21: Self Learning Material Artificial Intelligence

1. Artificial Intelligence is the branch of science and engineering of making intelligent machines. It isconcerned with getting computers doing things intelligently like human beings.2. Strong Artificial Intelligence follows the principle that the machines could be design to think likehuman brains or in the other words act like humans to have capability to take quick decisions on the basisof current situation or environment. Weak AI is simply based on the principle by the fact that machinescan be designed or simulates to act as if they are intelligent as human beings.3. Instruments that display human behavior, intelligence including those systems which are learning bythemselves, “intelligent agents”, “robots”, “expert systems”, “pattern recognition” and “voicerecognition”, “natural and automated translation”.4. John McCarthy is considered as the father of Artificial Intelligence.5. Homo sapiens are a scientific name which is given to human beings by themselves. Homo sapiensmean “man the wise”.6. Traditional Scientific Calculation, Data Processing, Computation Intensive application with heuristiccontrol, Artificial Intelligence.7. John McCarthy.8. In 1957, The “General Problem Solver (GPS)” was experimented which was the very first version of anew program.

1.9. Model Questions

1. Give an overview of Artificial Intelligence.2. How human and computer Intelligence are different from each other?3. Illustrate the concept of AI types.4. Describe the tasks and applications associated with intelligent behavior.5. Illustrate the concept of Knowledge Domain.6. What are the main targets of Artificial Intelligence Techniques?7. Differentiate “Strong AI” And “Weak AI”.8. Discuss how AI evolved?9. Explain foundations of AI.10. What is Turing Test?

Page 16 of 248

Page 22: Self Learning Material Artificial Intelligence

Page 17 of 248

Page 23: Self Learning Material Artificial Intelligence

LESSON 2: More about Artificial Intelligence

Structure of the chapter

2.0. Objectives

2.1.Artificial Intelligence Techniques

2.2. Applications of Artificial Intelligence

2.2.1. Game Playing

2.2.2. Speech Recognition

2.2.3. Natural Language Processing

2.2.4. Computer Vision

2.2.5. Expert Systems

2.2.6. Robotic Engineering

2.2.7. Intelligent Robots

2.2.8. Handwriting Recognition System

2.2.9. Medical Diagnosis

2.2.10. Financial Management

2.2.11. Computer Science

2.2.12. Intelligent Transportation System

2.2.13. Music

2.2.14. Printing and Publishing

2.3. Artificial Intelligence Languages

2.3.1. Properties of Prolog as a Programming language

2.3.2. Background for Prolog

2.3.3. Rules

2.3.4. Goals

2.3.5. Atoms

2.3.6. Numbers

2.3.7. Variables

2.3.8. Variable Goals and Calls

Page 18 of 248

Page 24: Self Learning Material Artificial Intelligence

2.4. Summary

2.5. Glossary

2.6. Answers to check your Progress/ Self-Assessment Questions

2.7. Model Questions.

2.0. Objective

After studying this chapter, the student will be able to understand:

Techniques of Artificial Intelligence. Various Applications of Artificial Intelligence. Languages for Artificial Intelligence. The importance of Prolog in AI.

2.2.Artificial Intelligence Techniques

As there are many diverse artificial intelligence techniques that have been generated, with the ways beingproduced, a few forms of Artificial Intelligence (AI) have turn out to be more andmore well-liked. Theuse of neural networks and the expansion of expert systems are compromised by some of the mostgeneral techniques. These dissimilar artificial intelligence techniques can be accessed to build updissimilar forms of AI, typically depending on the amount of “thinking” the program can really perform,and these are classified as Strong or Weak AI.

Artificial intelligence techniques are the ways that can be used to simulate and automate computersystems generally observed as forms of artificial intelligence. Usually, artificial intelligence points to aprogram that is able to imitate or re-create the consideration processes exampled by the human brain.This typically negotiates solving problems, making observations or obtaining input for utilization inanalysis or problem solving, and the aptitude to classify and identify dissimilar objects and the propertiesof those objects. There are many dissimilar artificial intelligence methods that can be used by an AIprogrammer, like expert systems and artificial neural networks. Artificial Neural networks are computerprograms calculated about the cognitive processes utilized by the human brain. Basically, a neuralnetwork includes layers of categorization and ways by which objects can be recognized and categorized.This is similar to the idea of plan in human cognition, which permits people to recognize objects based onattributes of those objects. New information offered to the neural network can then be analyzed andrecognized based on formerly inputted criteria, permitting the system to “learn” new categories andrecognize known or unknown objects.

Expert systems are artificial intelligence techniques constructed around logic and “if/then”statements.This typically includes a great deal of information that is “taught” to the computersystem, which thenmakes the system an expert in a specific field. When new input is commenced in, such as a request forprocessing organizational reports, the expert system can examine the information by means of theseif/then statements to restrict the output response.These different artificial intelligence techniques can beutilized to build up systems that are recommended as either Strong or Weak AI. Strong AI systems arethose that most completely look for to emulate human thought and cognitive potentials through a broadrange of functions .Artificial intelligence techniques that build up weak AI systems are narrower in focus,and look for to imitate only a single function or facet of human intelligence.

Page 19 of 248

Page 25: Self Learning Material Artificial Intelligence

Check your Progress/Self Assessment Questions

Q1. Artificial Intelligence really depends on---------------------------------------------------------------------

Q2.Which computer programs calculatedthe cognitive processes utilized by human brains?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q3. Name those systems which mostly emulate human thought and cognitive potentials through a broadrange of functions.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q4.Which systems are narrower in focus, and look for to imitate only a single function or facet of humanintelligence?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2.2 Applications of Artificial Intelligence

Today, there is hardly any area which is working without help of artificial intelligence. Its reallywonderful experience to work with machines .Human has made artificial copies of itself which arehelping him to work almost every era of life. Researchers are working day and night to build more andmore intelligent systems which can make tasks much easier. Imagine, we are on holiday and a machine isdoing all our works to make us feel comfortable and enjoy our holiday. It sounds really good. There ishardly any field which is not using information technology for further explorations. Figure 2.1 showsimportance of artificial intelligence.

FigureNo.2.1 Artificial Intelligence.

The following is the list of applications in which artificial intelligence is working today and in comingfuture; the list is going to be infinite.

Page 20 of 248

Page 26: Self Learning Material Artificial Intelligence

1. Heavy Industry2. Computer Aided Design3. Speech Recognition4. Natural Processing Language5. Game Playing6. Computer Vision7. Expert Systems8. Intelligent Robots9. heuristic classification10. Learning to read postcodes11. Stock market prediction12. Debt risk assessment13. Handwriting recognition14. Data Mining15. Neural Net6works16. Fuzzy Logic17. Artificial Life18. Artificial Immune System19. Optical character recognition20. Strategic planning21. Translation and Chatter bots22. Evolutionary Computation.23. Functional Programming24. Financial Institution25. Medical Diagnosis26. Clinical Decision Support Systems27. Heart Sound Analysis28. Education System29. Inventory Control30. Computer Art31. Virtual Reality32. Knowledge Representation33. Automated Reasoning

Check your Progress/Self-Assessment Questions

Q5.Human has made artificial copies of------------------------------------------------------------------

Q6.Researchers is working in which field day and night for growth?------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Q7.Name Methods of Artificial Intelligence.------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Q8.What is the scientific perspective of artificial intelligence?------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Q9. What is the technical perspective of artificial intelligence?

Page 21 of 248

Page 27: Self Learning Material Artificial Intelligence

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Q10. Name any five applications of artificial intelligence.------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2.2.1 Game Playing

We can buy machines which can play with us. The intelligent machines which are programmed with thesame capability we are holding. The machines are programmed in such a way that they are able tocalculate best possible moves within seconds and conclude a best approach of movement in the game.One can have company of artificial friendfor time pass. Figure No.2.2 shows game playing application ofartificial intelligence.

Figure No.2.2 Game Playing.

2.2.2 Speech Recognition

Speech Recognition is a convenient way to train your machines which act after recognizing speech.Feature extraction method is used to extract voice using some language models and acoustic models.Figure 2.3 shows block diagram of speech recognition system.

Page 22 of 248

Page 28: Self Learning Material Artificial Intelligence

Figure No.2.3 Block Diagram of Speech Recognition System

2.2.3 Natural Language Processing

Just getting a bundle of words into a machine is not quite enough. Parsing of sentences is also notsufficient. There is need to provide a machine the capability of understanding of the domain the text isabout, and this is presently possible with the concept of natural language processing which is itself a partof artificial intelligence. Figure 2.4 shows how natural processing language works.

Figure No.2.4 Natural Language Processing.

2.2.4 Computer Vision

The world coordinate system is composed of three-dimensions, but the inputs to the human eye andcameras are of two dimensions. Some good algorithms can work solely in two dimensions, but fullcomputer vision needs partial three-dimensional capability that is not just in a set of two-dimensionalviews and clips. Today, there are only limited methods of representing three-dimensional informationdirectly, and they are not as perfect as what humans evidently use. Artificial intelligence is gettingpopular in developing computer visions efficient. Figure 2.5 represents the concept of computer vision.

Figure No.2.5 Computer Vision.

2.2.5 Expert System

The expert systems are the computer applications developed to solve complex problems in a specificdomain, which matches the level of human intelligence and expertise. An expert system is a computerapplication that performs a task that can be performed by a living expert. An Expert System is a piece ofsoftware which uses stored information and convert it into useful knowledge and make decisions and

Page 23 of 248

Page 29: Self Learning Material Artificial Intelligence

give advices to its clients. An Expert System is a program that uses historical information and derivessolutions to problems in a specific task domain along with decisions. Figure 2.6 shows the working ofexpert system.

Figure No.2.6 Expert System.

2.2.6. Robotic Engineering

A robot can carry out many operations such as the manufacturing of toys in a factory. Robots can attachparts, paint, etc. The robot follows instructions of a control program to work out the task provided to it bya human. All these robots have sensors to sense things. These robots can do the same thing over and overagain as programmed by the control system. A sensor is a device which can sense physical data from itsenvironment and then this information is input into a machine.Sense of light, heat, movement, pressure,temperature, sound. Figure 2.6 shows robot control.

Figure no 2.6 Robot Control Loop

Check your Progress /Self Assessment Questions

Q11.What do you mean by Game playing?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

give advices to its clients. An Expert System is a program that uses historical information and derivessolutions to problems in a specific task domain along with decisions. Figure 2.6 shows the working ofexpert system.

Figure No.2.6 Expert System.

2.2.6. Robotic Engineering

A robot can carry out many operations such as the manufacturing of toys in a factory. Robots can attachparts, paint, etc. The robot follows instructions of a control program to work out the task provided to it bya human. All these robots have sensors to sense things. These robots can do the same thing over and overagain as programmed by the control system. A sensor is a device which can sense physical data from itsenvironment and then this information is input into a machine.Sense of light, heat, movement, pressure,temperature, sound. Figure 2.6 shows robot control.

Figure no 2.6 Robot Control Loop

Check your Progress /Self Assessment Questions

Q11.What do you mean by Game playing?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

give advices to its clients. An Expert System is a program that uses historical information and derivessolutions to problems in a specific task domain along with decisions. Figure 2.6 shows the working ofexpert system.

Figure No.2.6 Expert System.

2.2.6. Robotic Engineering

A robot can carry out many operations such as the manufacturing of toys in a factory. Robots can attachparts, paint, etc. The robot follows instructions of a control program to work out the task provided to it bya human. All these robots have sensors to sense things. These robots can do the same thing over and overagain as programmed by the control system. A sensor is a device which can sense physical data from itsenvironment and then this information is input into a machine.Sense of light, heat, movement, pressure,temperature, sound. Figure 2.6 shows robot control.

Figure no 2.6 Robot Control Loop

Check your Progress /Self Assessment Questions

Q11.What do you mean by Game playing?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 24 of 248

Page 30: Self Learning Material Artificial Intelligence

Q12.What is the meaning of Speech Recognition?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q13.Name components of Speech Recognition System.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q14.What do you mean by Natural Language Processing?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q15.World Coordinate system is composed of____________________________________________

Q16. What is Computer Vision?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q17. The expert systems are the computer applications developed to solve ----------------------------------------------------------------------------------------------------------------which matches the level of humanintelligence and expertise.

Q18. What are the components of the block diagram of expert system?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q19--------------------------------- is a program that uses historical information and derives solutions toproblems in a specific task domain along with decisions.

Q20.What robot consists of?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q21.What can robots sense?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q22.What is the components of robot control loop?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2.2.7 Intelligent Robots

Page 25 of 248

Page 31: Self Learning Material Artificial Intelligence

An intelligent robot has many different sensors, large processors and a large memory in order to showthat they have intelligence. The robots will learn from their mistakes and be able to adapt to any newsituation that may arise.An intelligent robot can be programmed with its own expert system, e.g. a factoryfloor is blocked with fallen boxes. An intelligent robot will remember this and take a differentroute.These intelligent robots carry out many different tasks such as automated delivery in a factory, pipeinspection, bomb disposal, exploration of dangerous/unknown environments.

Figure No. 2.7 Intelligent Robot

2.2.8 Handwriting Recognition

Different humans write differently. Human is so intelligent that he is training computers to recognizedifferent handwritings. Since, there is a high requirement to train the computer system to recognizedifferent human handwritings since humans all write certain letters in different ways. Figure 2.8 showshandwriting recognition process of computer.

Figure No.2.8 Handwriting Recognition System

2.2.9 Medical Diagnosis

Medical Diagnosis of patients is very helpful to test and generate reports for patients so that futuretreatments can be made easy. Taking historical data of the patients who are suffering from similar typesof diseases, observing, interpreting and analysis of historical data helps doctors to analysis of diseases

Page 26 of 248

Page 32: Self Learning Material Artificial Intelligence

and train them to do treatments of the patients.Figure 2.9 shows block diagram of Artificial MedicalDiagnosis System.

Figure No. 2.9 Block diagram of Artificial Medical Diagnosis System.

This technology provides you to keep track of heart sound of human. There is discovery of companionrobots for care of elders. Systems help in scan digital images which are computer aided for healthanalysis. Figure 2.10 shows working of medial field now seems to be impossible without artificialintelligence.

Figure No. 2.10 Medical Diagnosis using artificial intelligence.

Page 27 of 248

Page 33: Self Learning Material Artificial Intelligence

For example, computed tomography is used for typical appearances and to highlight conspicuous sectionsof a digital image to find and recognize possible diseases. One of the typical applications is the detectionof a tumor disease.

Check your Progress /Self Assessment Questions

Q23.What intelligent robots can do?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q24.What is handwriting Recognition?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q25.How Artificial Intelligence helps in Medical Diagnosis?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2.2.10. Financial Management

For Financial trading competition, organizations are using artificial intelligence to compete in the market.Financial organizations have long used artificial systems to detect charges or claims outside of the norm,perform human investigation. Banks use artificial intelligence systems to organize operations in theirorganizations, investment in stocks, and manage properties. Figure 2.11 shows the example of financialtrade of artificial intelligence.

Figure No.2.11 Financial Marketing

2.2.11. Computer Science

Page 28 of 248

Page 34: Self Learning Material Artificial Intelligence

AI scientists have created many significant tools to solve the problems in computer science. Many oftheir innovations have been adopted by computer science and are no longer considered a part of AI. Butactually, many were originally developed in AI labs like

Computer Mouse Interpreters Graphical user interfaces Symbolic programming Functional programming Dynamic programming Rapid development environments Automatic storage management

2.2.12. Intelligent Transportation System

Due to growing urban population in new mega cities, there is lack of available physical space whichbecomes a challenge to different modes of transport. People travel more frequently and covering greaterdistances than ever before, while weexpect safety, reliability, and swiftness from travel operators and thetechnology. To fulfill the needs of the growing transportation demands, intelligent transportation systemsenable users to be safer and smarter use of available transport networks using artificial intelligence.Figure 2.12 shows intelligent transportation.

Figure No.2.12 Intelligent Transportation System.

2.2.13. Music

The music industry has always been affected by changing technology. With artificial intelligence,researchers are trying to make the machines emulate the activities of the skillful musician. Music

Page 29 of 248

Page 35: Self Learning Material Artificial Intelligence

composition, music theory, sound processing are some of the major areas on which research in Music andArtificial Intelligence is focused. Figure 2.13 shows music composition using artificial intelligence.

Figure No.2.13 Music using Artificial Intelligence.

2.2.14Publishing and Printing

Today computers are generating news and reports commercially. It also produces financial managementprocess and real estate’s analyses. Figure 2.14 shows printing and publishing task using artificialintelligence.

Figure No.2.2.14 Printing and Publishing.

2.3 Artificial Intelligence Languages

Page 30 of 248

Page 36: Self Learning Material Artificial Intelligence

Programming Languages in Artificial Intelligence (AI) is a major tool for exploring and buildingcomputer programs that can be used to reproduce intelligent processes such as learning, reasoning andunderstanding symbolic information in context. Basically in the starting days of computer designing theprimarily use of computers was to performing scientific calculations, it was also found out quite soonthat strings of bits could represent not only numbers but also features of unpredictable objects. Operationson such features or symbols could be used to represent rules for creating, relating or changing symbols.This led to the general understanding of symbolic computation as a suitable means for definingalgorithms that calculated information of any type, and thus could be used for improving humanintelligence. Soon it was found out that programming with symbols required higher level concepts thanwas possible with those programming languages which were designed especially for scientificcalculations, e.g., FORTRAN.

In AI, programming of all aspects of human knowledge is considered from its foundations inunderstanding science through approaches of AIlike natural language processing, computer vision, andevolutionary or complex systems. It is inherent to this very adaptive problem domain that in the initialphase of programming a specific AI problem, it can only be specified badly. Only through interactive andincremental refinement does more simplified specification become easier. This is also possible as typicalAI problems tend to be very area specific; therefore heuristic strategies have to be developedsystematically through generate-and-test methods. In this way, AI programming notably differs fromsoftware engineering concepts where programming usually starts from planningand detailed formalspecification. But in programming of artificial intelligence is the implementation effort is actually mainconcept of the problem specification framework.

Due to the fuzzy nature of many artificial intelligence problems, artificial intelligence programmingprovides advantages considerably if the programming language frees the artificial intelligenceprogrammer from the limitations of too many technical build ups.A declarative programming style ismore good using built-in high-level data structures and functions so that symbolic computationssupported on a much more abstract level than would be possible with standard languages likeFORTRAN, C. However, once a certain artificial intelligence problems are understood, it is possible toreformulate it in form of detailed analysis and specifications as the basis for re-construction of using animperative language. The most widely used artificial intelligence programming language is the functionallanguage. Lisp was developed by John McCarthy in 1950. Lisp is based on the logic of mathematicalfunction theory and the lambda abstraction. In 1970s, a new programming paradigm called logicprogramming appeared which was on the basis of predicate calculus. The most important logicprogramming language is Prolog which was developed by Alain Colmerauer, Robert Kowalski andPhilippeRousse. Problems in Prolog language are stated as facts, axioms and rules for conducting newfacts.

2.2.1. Properties of Prolog as a Programming language:

There are no explicit types or classes in this They are rule-based, founded on first-order logic There is high impressibility: functionality per program line Interactive, experimental programming

2.2.2. Background for Prolog

Prolog can be understand as Programming in Logic: Syntax: subset of first order logic

Page 31 of 248

Page 37: Self Learning Material Artificial Intelligence

Declarative semantics: Logical consequence Procedural semantics: Resolution, proof rule with unification.

For Example, In Prolog program is a description of data:

Parent (Padam, Baby). % Pam is a parent of Bob

Parent (Tina, Baby).

Parent (Tina, Liza).

Parent (Baby, Anny).

Parent (Baby, Pavan).

Parent (pat, Jimmy)

There are following notions present in prolog:

Predicates: parent

– describes a relation

– defined by facts, rules, collectively called clauses

Constant (symbol)s: tomy, baby, x, y

Variables: X, Y, Tommy

Atoms (simple goals): parent (A, a)

Queries.

2.3.3.Rules

In Prolog, rules are used in the process of decision-making and can deduce new facts from existing ones.For Example: Suppose there are two facts such as: Tommy likes Mona, Baby likes Sanjay.

The rule says: Jimmy likes X if baby likes X.

Prolog can deduce that:

Jimmy likes Sanjay (Jim lives in Kapurthala)

You can give a Prolog program a goal that is a problem it needs to find a solution for. For examplefindevery person who likes Sam: Prolog will use its deductive ability to find all solutions to the problem. Ifand then parts of a rule are separated by the: symbol, referred to as the infix operator. The conditionalpart of the rule is written on the right of the infix operator and conclusion part on its left. A rule can bedeclared with a condition. For example, you can declare that if the weather is sunny, the day is to beselected for a picnic. The Prolog statement for declaring this rule and its condition is:

Travel (day):- weather (day, rainy).

2.3.4.Goals

Page 32 of 248

Page 38: Self Learning Material Artificial Intelligence

Proposing a query means demanding Prolog to attempt to prove that the statements implied by the querycan be prepared true given the right variable instantiations are prepared. The search for such a proof isgenerally pointed to as goal execution. Every predicate in the query comprises a (sub) goal, which Prologattempts to please one after the other. If variables are shared among numerous sub goals theirinstantiations have to be similar throughout the wholeexpression. If a goal goes with the head of a rule,the particular variable instantiations are made within the rule’s body, which then turns out to be the newgoal to be satisfied. If the body includes numerous predicates the goal is again split into sub goals to beexecuted in turn. Alternatively, the head of a rule is measured provably true, if the conjunction of all itsbody predicates is probably true. If a goal goes with a fact in our program the proof for that goalisabsolute and the variable instantiations made throughout matching are conversed back to the surface. Ifthe principal function of a goal is an incorporated predicate the connected action is executed whilst thegoal is being satisfied. For example: As far as goal execution is regarded the predicate write words willjust succeed, but simultaneously it will also print the words on the screen.

2.3.5.Atom

An atom is a simple name with no meaning. It is composed of a sequence of characters that is parsed bythe Prolog reader. Atoms are usually bare words to be use in prolog and consist of no special syntax.Atoms also contain spaces and special characters must be surrounded by single quotes. Atoms beginwitha capital letter needs to be quoted, to differ them from variables. The empty list is also anatom. Forexample: Other examples of atoms include x, blue, Taco, and some atom. An atom is a data object inProlog and is also used as a name of an individual or a predicate. An atom is a word-like entity and hasthe following characteristics:

It begins with a lowercase letter and contains letters, digits, and an underscore. It can be enclosed in single quotes that contain any character, such as a space. It does not have a length limit.

2.3.6. Numbers

Numbers can be floats or integers. Many Prolog implementations also provide unbounded integers andrational numbers. All standard Prolog implementations have numbers that are positive, negative, orfloating-point integers. Some implementations handle the exponential format. The knowledge base inProlog is written in free format because there is no on the number of free spaces that a program can have.A new line is allowed at any point in the program but thereare two restrictions: the atom or variable namecannot have embedded spaces and there cannot be anything between the function and the openingparentheses.

2.3.7Variables

Variables are denoted by a string consisting of letters, numbers and underscore characters, and beginningwith an upper-case letter or underscore. Variables closely resemble variables in logic in that they areplaceholders for arbitrary terms. A variable can become instantiate via unification. A single underscoredenotes an anonymous variable and means “any term”. Unlike other variables, the underscore does notrepresent the same value everywhere it occurs within a predicate definition. A variable name containsletters, digits, and underscores. It begins with a capital letter or an underscore mark.

2.3.8.Variable Goals and Calls

Page 33 of 248

Page 39: Self Learning Material Artificial Intelligence

Variables can be utilized as goals. A term G which is a variable appearing representing a goal istransformed to the goal call (G). Note that call is not clear to cuts.

2.4 Summary

This chapter describes the various applications of artificial intelligence.Today, there is hardly any areawhich is working without help of artificial intelligence. It’s really wonderful experience to work withmachines .Human has made artificial copies of itself which are helping him to work almost every era oflife. Researchers are working day and night to build more and more intelligent systems which can maketasks much easier. Imagine, we are on holiday and a machine is doing all our works to make us feelcomfortable and enjoy our holiday. It sounds really good. There is hardly any field which is not usinginformation technology for further explorations. This chapter ends up with the discussion of variousartificial intelligence languages in which prolog is the most popular language used in programmingconstructs of artificial intelligence components. Prolog represents logic programming.

2.6 Glossary

Artificial Intelligence: Capability to think and act likes human beings.

AI Applications: Areas where artificial intelligence is being used for the purpose of growth.

Prolog: Programming Language for Artificial Intelligence.

Lisp: List Processing (Language for Artificial Intelligence).

Fuzzy: Uncertain

Fuzzy Logic:The refined information storage is represented by if-then rule i.e. based on conditional aswell as unconditional statements.

2.7 Answers to check your progress/self assessment questions

1. Amount of thinking which can be performed by the program.2. Artificial Neural networks3. Strong AI4. Weak AI5. Itself6. Artificial Intelligence7. Knowledge base ,symbolic, behavioral methods8. Study of systems related to computational process9. Smart systems10. Learning to read postcodes, Stock market prediction, Debt risk assessment, Handwriting

recognition,11. The machines are programmed in such a way that they are able to calculate best possible moves

within seconds and conclude a best approach of movement in the game. One can have companyof artificial friend for time pass.

12. Speech Recognition is a convenient way to train your machines which act after recognizingspeech.

13. Voice, Feature extraction, Acoustic models, decoders, language models, text.

Page 34 of 248

Page 40: Self Learning Material Artificial Intelligence

14. provide a machine the capability of understanding of the domain the text is about,15. three-dimensions16. Computer vision needs partial three-dimensional capability that is not just in a set of two-

dimensional views and clips. Today, there are only limited methods of representing three-dimensional information directly, and they are not as perfect as what humans evidently use

17. problems in a specific domain18. Figure no.2.619. Expert System20. Sensors21. Sense of light, heat, movement, pressure, temperature, sound22. Sense, Think, Act.23. The robots will learn from their mistakes and be able to adapt to any new situation that may arise.24. recognize different human handwritings since humans all write certain letters in different ways25. Taking historical data of the patients who are suffering from similar types of diseases, observing,

interpreting and analysis of historical data helps doctors to analysis of diseases and train them todo treatments of the patients.

2.8 Model Questions

1. What are the various applications of Artificial Intelligence?

2. Draw and Explain Block diagram of Speech Recognition System?

3. How Artificial Intelligence helps in medical diagnosis?

4. How financial organizations are taking advantage of artificial intelligence?

5. What is the history of Artificial intelligence languages?

6. What is Prolog?

7. Explain the properties of prolog language?

8. What are the rules and goals of Prolog language?

Page 35 of 248

Page 41: Self Learning Material Artificial Intelligence

LESSON 3: Problem, Problem Space Concepts

Structure of the Lesson

3.0. Objectives

3.1. Introduction of Problem.

3.2. Definition Problem.

3.3. Problem Solution

3.4. Characteristics of Problem.

3.5. Problem Reduction

3.6. State Space Search and Problem Execution

3.7. Order of Problem Solution: Expert Systems

3.8. Order of Problem Execution: Knowledge Engineering.

3.9. Development Tools or Language.

3.10. Artificial Intelligence Problems.

3.10.1. Puzzle Problem.

3.10.2. Frame Problem.

3.10.3. Epistemological Problems.

3.11. Summary

3.12. Glossary

3.13. Answers to check your Progress/ Self-Assessment Questions

3.14. Model Questions

3.0. Objectives.

After completing this chapter, the student will be able to: Get the introduction of term “Problem in AI” Meaning and Definition of Problem. Characteristics of Problem. Knowledge about Problem Reduction and Order of Problem Reduction. Problem Execution Process. Expert Systems Development tools or Language use for developing AI Systems. Details of Artificial Intelligence Problems.

Page 36 of 248

Page 42: Self Learning Material Artificial Intelligence

3.1. Introduction.

Problems have the general form given some data, find value. A huge bundle of types ofProblems are addressed in AI. Some examples are: finding winning moves in chess board; Identifyingpeople from their photographs; and planning series to compute given task.The steps that are needed tomake a system to work out a particular problem are:

“Problem Definition” states that must include precise specifications of what the starting pointwill

be.It also includes the specification of the last point which will consist of the best result.

“Problem Analysis” tries to find out the best possible solution using various available techniques.

Selection of the best strategies for solving the particular problem.

Example:The typical example is of the Person, who is required to transport a Goat,a Lion and someGrass across a river separately. The Lion will eat the goat if left unconfirmed.Similarly the Goat will eatthe Grass. Here, the State is illustrated by the positions of the Person, Goat, Lion and Grass. The solvercan move among States by making a legal move (which does not consequence in something being eaten).Non-legal moves are not valued analyzing. The clarification to such a problem is a record of linked Statesleading from the “Initial State” to the “Goal State”. This may start at the Initial State and functioningtowards the Goal state or vice-versa. Whenever we want to find solution of a particular problem, we needto draw a policy. Let say, I want to play a game which is only possible to be played between two persons.These two persons can sit on a table or board games to take their actions to win. What are now requiredby me to win the game?It is the rules of the game which I cannot modify by myself as per myconvenience. The second need is to follow a strategy for winning the game. It will be different means ofrepresenting positions in the game.Most of the times“starting position” can be defined as the “initialstate” and a “final position” as a “target state”. There are a lot Legal rules and moves which permits usfor transformation from the first point to other states which will lead it to the final point. It is need to benoticed that the rules are always different for different games. Like if we take the example of “Chess”rules are different and if I play another game like “Cricket” rules will be changed on the basis of no. ofplayers, area of play, time of play. Thus the rules are not fixed or generalized. There are no fully accuratedetails of different games with anyone or everyone. In order to program computers, with the ability tohave all the rules with them is considered not an easy task. No computer program will be able to handlethe programs of games without plentiful of information.

Most of the time, the number of procedures that are being considered are always recommendedto be must be minimized .The observations has to be delivered by expressing each and every rule in asgeneralized as it can be. The games representationproblems lead to a “state space structure”. Thisrepresentation permits for the formal definition of a problem: “The movement from a set of start positionsto one of a set of goal positions”. It refers to the meaning that results of the problem are generated with abundle of good techniques. It uses the systematic search procedure. This is often considered as thesimplified and fruitful method of“Artificial Intelligence.”

1. So, we come to understand that problems can be defined with a set of rules.

2. Rules needs to be as simple as possible so that everyone who is involved in the process of solving

the problem can understand it and it needs to be represented as a “state space

Page 37 of 248

Page 43: Self Learning Material Artificial Intelligence

representation”which is the formal definition:“move from initial states to one of a set of target

positions; move is achieved by a systematic search.”

We will give a brief description of the problems associated with artificial intelligence as follows:

1. Define the problem: A precise definition of exact acceptable specifications acceptable to

initial as well as final situations.

2. Problem must be analyzed: It is really necessary to understand the target before trying to

solve it. One need to be capable such important features which can have great impacton the

completeness of different possible procedures which provides us the steps for finding the

solution of a problem.

3. Simplification: After analyzing the problem, the problem needs to be presented in the

simplified manner.

4. Represent: One needs to provide a good and simplified representation of the structure.

5. Amongst the available options of solution to solve a particular problem, now we have to take

the decision of the selection of the best approach of problem-solving technique.

3.2.Definition of Problem in Artificial Intelligence

In order to find the solution of many available problems, it is necessary that one needs to know thesequence of actions which will takes us to the desirable goal. Each action changes its position. Our targetis to discover the best sequence of actions and states that will take us towards the path of victory.

One well-defined problem can be described by:

“start state”

“Operator or successor function - for any state x returns s(x), the set of states reachable from x

with one action”

Check Your Progress/Self-Assessment Test

Q1. Define the term: “Problem”.

------------------------------------------------------------------------------------------------------------------------

Q2. How the rules can be generalized?

------------------------------------------------------------------------------------------------------------------------

Page 38 of 248

Page 44: Self Learning Material Artificial Intelligence

“State space - all states reachable from initial by any sequence of actions”

“Path - sequence through state space”

“Path cost - function that assigns a cost to a path. Cost of a path is the sum of costs of individual

actions along the path”

“Final test - test to determine if at goal state.”

Figure No.3.1 Process of Decision to move from one state to another state.

The term problem and problem solving has broad sense. Figure 3.2 shows steps of problem solvingmodel.

What can I doto move fromA to B?

Giveninitialsituation.

Desiredgoalsituation.

A B?

Page 39 of 248

Page 45: Self Learning Material Artificial Intelligence

Figure No.3.2 Problem Solving Model.

• Initializing, simplifying, and solving problems.

• Initializing, simplifying, and accomplishing tasks.

• Initializing, simplifying, and making decisions.

• Using higher-order and critical thinking to do all of the above.

Example: Program of Artificial Intelligence to Play Tic –tic-tac game by Machine. Figure 3.3 showssolution of game.

Figure No.3.3.Solution of Game Problem.

Check Your Progress/Self-Assessment Test

Q3. Define Problem.

-------------------------------------------------------------------------------------------------------------------

Q4. What are the steps of Problem Solving Modeling?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 40 of 248

Page 46: Self Learning Material Artificial Intelligence

3.3. Problem Solution

Problems are not well specified. One should have a very good approach to solve the problem. Let saystudy this concept with the help of an example. Let say if we hire a travel agent and ask a travelling agentto find out all the information about resorts that may have neatness issues. I do not wantthat the personwhich is hired by me and he comes back to me with all the information about all hotels, resorts,pubs.Ijustwant that he presents me only that information which is needed by me as other information is of no usefor me. I expect that what information he has gathered for me should have the information needed by me.If I get the right information, I can conclude the final result for which I was waiting. But the problem isthat if the travelling agent does not contains the detailed useful information about the resorts. What I willhave to do, I will have to do study all the information delivered to me to find out whether the informationis available or not. Then returning all of the information back may be the only way for it to guarantee thatall of the requested information is useless and the agent has to do more work to find good material forme. An optimal solution to a problem is always necessary. Optimal solution is the best solution in orderto some measure of solution quality. This measurement is specified. This specification is ordinal.However, sometimes we need cardinal measure. If we talk about ordinal measure in detail, it is for aspecific “Robot” to take out as much garbage as possible from different streets and If it is capable ofgathering more garbage. It will consist of best optimal solution. This way better working for the givenproblem is being done. If we take an example cardinal measure, it may also be possible that you want thedelivery robot to take most of the garbageas possible. But you apply some conditions that he has tocollect the garbage by minimizing the distance traveled. So, it has to fulfill the conditions and explicitlyspecify a trade-off between the effort required and the portion of the garbage collected. It is an optionalway to collect the garbage and better to miss some garbage in order to save time. One general cardinalmeasure of desirability, known as utility, is used in- decision theory. Figure 3.4 shows steps of problemsolving cycle.

Figure No.3.4.Problem Solving Cycle.

Page 41 of 248

Page 47: Self Learning Material Artificial Intelligence

3.4. Attributes of a Problem.

Heuristic search is an extremely common method pertinent to a large class of problem. It involvesnumerous techniques. In order to select an optimal method, it is essential to examine the problemconcerning the following deliberations.

Are we capable to divide the problem into parts?

“A very great and compound problem can be simply solved if it can be wrecked into smaller

problems and recursion could be used. Presume that we want to solve. This can be performed by

dividing it into three lesser problems and solving each by applying particular rules. Adding the

results the whole solution is attained. A very great and compound problem can be simply solved

if it can be wrecked into smaller problems and recursion could be used. Presume that we want to

solve. This can be performed by dividing it into three lesser problems and solving each by

applying particular rules. Adding the results the whole solution is attained.”

How the solution steps needs to be treated?

Problem always defines three classes.

“Ignorable, recoverable and irrecoverable. This categorization is pertaining to the steps of the

solution to a problem. Example: Consider theorem proving. We may later discover that it is of no

aid. We can still continue further, as nothing is lost by this outmoded step. This is an example of

ignorable solutions steps. Now consider the 8 puzzle problem tray and arranged in particular

order.

Check Your Progress/Self-Assessment Test

Q5. Steps of Problem Solving Cycle.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 42 of 248

Page 48: Self Learning Material Artificial Intelligence

While moving from the begin state towards objective state, we may make some dull move and

consider theorem proving. We may carry on by first proving lemma. But we may backtrack and

untie the unnecessary move. This only includes additional steps and the explanation steps are

recoverable. Finally consider the game of chess.”

Are we able to predict the problem?

Planningneeds to be done in order to solve the problem. Planning always helps to eliminate

unwanted solution steps. For example “Planning can at best produce a sequence of operators that

has a good likelihood of approaching to a solution. The uncertain result problems do not assures

a solution and it is frequently very expensive as the number of solution and it is frequently very

expensive As the number of solution paths to be discovered enhances exponentially with the

number of points at which the result cannot be predicted. Therefore one of the hardest types of

problems to resolve is the irrecoverable, uncertain outcome problems.”

What is the state of Solution “Absolute” or “Relative”?

In order to find out the nature of solution, first we need to understand the nature of the type of

given problem. For example “Water jug and 8 puzzle problems, we are content with the solution,

unaware of the solution path taken, while in the other group. Not just any solution is suitable. We

want the finest, like that of traveling sales man Problem, where it is the shortest path. In any path

problems, by heuristic methods we get hold of a solution and we do not discover alternatives.”

Page 43 of 248

Page 49: Self Learning Material Artificial Intelligence

How we will check out the consistency of the provided knowledge?

The knowledge base is reliable in some cases and in in some cases the knowledge base is not

reliable.“Consider the case when a Boolean expression is assessed. The knowledge base

Now includes theorems and laws of Boolean Algebra which are forever true. In contrast consider

a knowledge base that includes facts regarding production and cost. These keep ranging with

time. Thus many reasoning schemes that function well in consistent domains are not suitable in

conflicting domains.”

Why there is need of knowledge? What is role of it in order to solve a problem?

Some systems have very limited computing capability. There is need of a large size of the

knowledge base in order to solve the problems. It is always required to find out the best solution

for the provided problem. Let’s take an example:“The game of playing chess, just the rulesfor

identifying legal moves and some easy control mechanism is sufficient to arrive at a solution.

But additional knowledge about good strategy and tactics could aid to restrain the search and

accelerate the implementation of the program. The solution would then be realistic. Consider the

case of guessing the political trend. This would need a massive amount of knowledge even to be

able to identify a solution, leave alone the best. Example: Playing chess 2. Newspaper

understanding.”

Does the task require interaction with the person?

The problems can again be classified under two heads.

Solitary in which the computer will be specified a problem explanation and will

Create an answer, with no in-between communication and with the demand for a clarification of

the reasoning process. Simple theorem proving occurs under this

Group provided the basic rules and laws, the theorem could be proved, if one occurs.

Example: Theorem proving. Conversational, in which there will be in-between communication

among a personand the computer, wither to give additional aid to the computer or to give

additionalinformed information to the user, or both problems like medical diagnosis comesunder

this group, where people will be unwilling to recognize the decision of theprogram, if they

Page 44 of 248

Page 50: Self Learning Material Artificial Intelligence

cannot follow its reasoning.Example: Problems such as medical diagnosis.

Problem Classification

Definite problems are inspected from the point of view; the taskhere is scrutinizing an input and

decides which of a set of recognized classes.

3.5. Problem Reduction

To find a solution, there is needed to take a bundle of actions to reach the target.There is one optionwhich is“state-space search”where each element searches for the next move. While searching for asequence of actions, we need to know about “start state” to an “endstate”. It is also possible that one candivide the parts of the problem in many forms. Let’s consider an example: Let say we are planning a tripto Kapurthala. You are not likely to search through all the possible sequences of actions that might if youare going to Kapurthala. You are more likely to construct the problem into many parts and make it reallysimple. One needs to get to the station. After getting the station the person needs to go the destination byt getting a train to Kapurthala. There may be more than one possible way of decomposing the probleminto parts. An alternative way might bethere to get the airport, fly to “Delhi” and catch the bus from thereto Kapurthala. There may be different possible plans and routes having different costs to reach to thedecision. The main purpose is to take the best route at less cost within many available plans.

The “problem reduction techniques” can be represented as an “AND-OR graph”. To find a way to get toKapurthala one has to search appropriate route. One of the alternate is that we can take lift. We can startthis process by asking for help from others break it into as by asking help from others. It may be possiblethat we will get help or it might be possible that we may not get help. So, there is need to apply thesebasic ideas of graph search using“AND-OR graphs”.

There are many other possible ways of searching “AND-OR graph”. One efficient way is to effectivelychange them back into “OR graphs” where each node represents a whole set of targets to be satisfied. Soin terms of search algorithms each item on the agenda is a set of targets. For example: “Finding asuccessor to an item on the agenda involves picking a non-primitive goal from this set of goals andfinding possible sub targets for that target. If the node was an AND node then there is a single successorwhich is a set of goals with the sub target goal is replaced by its sub goals. If the node were an OR node,then there will be different successor node, each being a set of targets with set of sub targets replaced bya possible successor. A final target state will be set of directly executable or primitive goals/actions andour node lists will be lists of goals where each sub list will represent a partially developed possible plan”.An example is represented as follows:

Check Your Progress/Self-Assessment Test

Q6. What are the various deliberations to solve a problem?

----------------------------------------------------------------------------------------------------------------------------------------

Page 45 of 248

Page 51: Self Learning Material Artificial Intelligence

“Open = [[cycle-to. get-train], [walk-to, get train], [get-to-airport, get-plane, and get-train]]”

When you want to use heuristic search Things get slightly more complex. Then we have to evaluate the“goodness” of a whole set of targets. This is simple example. But this will lead to“non-optimal solution”.There might be redundant work in getting the solution. “The goal get-train may be expanded thrice, oncein the context of cycling to the station, second time in the context of walking there and third times thecontext of reaching the airport. As the sub goals are independent, this really shouldn’t be morespecialized AND-OR graph search policies will ensure both one, we don’t have to work out how to take atrain to Kapurthala thrice, and two that any estimates of costs of nodes are updates once we have workedout how to satisfy a goal.”

3.6. “State Space Search” and “Problem Execution”.

Most problems could follow the principle generated in either “state space or problem reduction” term.Usually, we have one way of generating the problem which needs to be natural and efficient. The goodtechnique further focus on both on the basic of the solution of that particular problem and needs to keepgoing on with the process until the result is not found.

Search is one of the techniques which are being used in the process of finding the solution to a problem ina natural way using the start and the end point. There is requirement to define the rules and proceduresfor transforming one step into another step, based on available resources in the domain. “Problemreduction” can be better if it is capable of dividing a problem into independent parts. This way thedeveloper will able to take the decisions with natural explanation of the decision making whichpermitsthe notification a solution and may respond in fewer searches than “state-space approaches”.

3.7. Order of Problem Solution: “Expert Systems”

Expert systems are intelligent programs. Their names specify their meaning. The systems which areexperts in performing some specific task. Expert systems are part of artificial intelligence. Artificialintelligence’s main objective is to understand intelligence. This is then used in simulating computerprograms. These programs are full of intelligent behavior. These systems are concerned withunderstanding the concepts of symbols.The term intelligence covers many cognitive skills: including the capability to solve problems,”“learn”

and “understand language”. Artificial intelligence understands all types of problems.Artificialintelligence focus on the area of problem solving. Artificial tasks claims to some object oriented problemsolving activity. Domain regions are the areaswithin which the project of problem is being performed inorder to solve it. Some of the typical tasks are:

“Medical Diagnosis”

“Planning”

“Scheduling”

“Configuration”

“Designing”

Check Your Progress/Self-Assessment Test

Q7. Define Expert System.

-------------------------------------------------------------------------------------------------------------------

Q8. Domain Areas of Expert System.Page 46 of 248

Page 52: Self Learning Material Artificial Intelligence

3.8. Order of Problem Execution : “Knowledge Engineering”

The term: “Knowledge Engineering” is known as the heart of Artificial intelligence innovations andresearch areas.Basically, two things are required for its working. One is “Knowledge” and second is“Knowledge Engineer”. A“knowledge engineer” is a computer scientist who knows how to build andimplement computer programs that use artificial intelligence techniques. The nature of “knowledgeengineering” is dynamic. Figure 3.5 shows knowledge engineering.

Figure No. 3.5. Knowledge engineering.

There are two ways to formulate an expert system. They can be formulated from start point or constructusing a piece of development software which is known as an expert tool.“Knowledge engineering” has alarge sense and the basic terminology used by the knowledge engineer to interrogate a human being by a

Page 47 of 248

Page 53: Self Learning Material Artificial Intelligence

team of experts to fetch different attributes and learns from them to use the information in a realisticmanner. The experts try to transform the data into meaningful knowledge. Such knowledgeisimplemented into computer language and designs a correct system

3.9. Development Tools or Language

The basic working of artificial intelligence is on estimating the human behavior and implementedthat behavior into the machines to get them trained. To enhance the capacities of the computers there wasneed of the usage of symbols.

“John McCarthy” was busy in the wonderful innovation of developing a major breakthrough in Artificialintelligence ancient time’s .The “LISP language”was introduced in 1958 by John McCarthy, his majordevelopment in the field of Artificial intelligence, is being still in use today. “LISP stands for ListProcessing”, and it was very early get popularity among most AI developers as the language of choice.The following is the list of milestones of artificial intelligence with their foundation and fruitful years.

During the year of nineteen seventy, there was a lot of developments in the area of artificial intelligenceand a new programming language was developed. It is called “PROLOG”. “Prolog” consists of Englishsentences in the form of rules and questions.

3.10. Artificial Intelligence Problems.

There are several problems concerning artificial intelligence.

3.10.1. Puzzle Problem

The 8 puzzle comprises eight numbered.We consider that it is having a set of boxes which are represented in three rows and three columns. Wecan suppose that one box is alwaysempty in the frame. Therefore while placing some objects in the boxwe make it probable to move to the nearest box and only condition is that that box needs to be empty.

The program is to get changes from the “initial configuration” into the “objective configuration”. Asolutionto the problem is a suitable long stepof moves.For the 8 puzzle problem that communicate tothese three components. These rudiments are the problem states, moves and goal. Here each tile

Page 48 of 248

Page 54: Self Learning Material Artificial Intelligence

configuration is a state. The set of all buildingsin the space of problem declares or the problem space,there are only 3, 62,880 different configurations of the 8 tiles and blank space. Once the problem stateshave been theoretically identified, we must build a computer representation, or description of them. Thisexplanation is then accessed as the database of a production system. For the 8-puzzle, a straight forwarddescription is a 3 × 3 array of matrix of numbers. The preliminary global database is this explanation ofthe initial problem state.Practically any type of data structure can be accessed to describe states. A moveconverts one problem state into another state. The 8-puzzle is interpreted as having the suitable moves.

3.10.2.“Frame” Problem

Our surroundings are not static. Our environment is dynamic.Our decision change with time. So is thecase of problem situations in artificial intelligence. A good assortment for getting success is sometimesdisposing orignoring irrelevant truths facts and save ourselves from negative side effects.If we take theexample of a robot it should be trained in such a way that it must bring in facts that are needed to be usedfor a particular moment. Generally, a robot needs to investigatethe present situation while working, andthen estimates the originality that will provide benefits for selecting itssubsequent action. The robot needsto find out changeable situations. There can betwo types of changes in the environment:

“Relevant Change: examine the changes made by an action”

“Irrelevant Change: do not examine facts that are not related to the task at hand”

Truths can be tested by using below two levels:

“Semantic Level: This level interprets what type of information is being inspected. Solutionsshouldbecome understandable by the suppositions of how an object should behave.There are believers in awholly semantic approach who consider that accurate informationcan be reached by means of meaning.However, this hypothesis has yet to be confirmed.”

“Syntactic Level: Which format the information should be investigated.That is, it generates solutionsdepending on the structure and patterns of facts.”There are several problems Related to the Frame Problem.

The “Qualification” Problem

No one is not always sure that if they are choosing something as a solution and wants to get it processes.It does not always guarantees that we will get the positive result. It might be possible that we will get thenegative result. “Qualification” problem deals with such situations.

The “Representational” Problem

While solving the different aspects of the problem, we need to develop the various truths regarding theproblem and representational problems. The Representational problems are: “Complexity of developing

Check Your Progress/Self-Assessment Test

Q9. The................................... Comprises eight numbered, changeable tiles set in a 3 × 3 frame.

Q10. The program is to modify the initial configuration into the....................................................configuration.

Page 49 of 248

Page 55: Self Learning Material Artificial Intelligence

truths concerning the currentenvironment. For instance, how can one program the thoughts of up anddown?”

The “Inferential” Problem

We do different kinds of inspections in order to get the best result of a problem.But sometimes we getdifficulty in inspecting the various procedures by which the steps of the whole universe of problems areneeded to be reviewed is the Inferential Problem.

The “Ramification” Problem

Things have to change with the nature and its Surroundings. While working on a problem we may havedifferent surroundings and environment.For Example: “A robotic arm has been provided the task ofpicking up a brick and positioningit on its side in a dissimilar location. If the brick has been knockedover, what can the robotperform to correct the problem? Will it still recognize which side should befacing up without the aptitude of human sight? Should these deviations be inspected individually everytime anaction has taken place?”

The “Predictive” Problem

While doing some work, we always have intuitions to lead the work to success. The “Predictive Problem”provides us the benefits of getting work done using predictions and assumptions. These predictions areuncertain as we do not know the final results. We implement them with a positive attitude to get thesuccess.

3.10.3. Epistemological Problems

Check Your Progress/Self-Assessment Test

Q11. The problem of forcing a robot to acclimatize to these changes is the foundation of the.....................................................................................................................................................Problem in artificial intelligence.

Q12. .................................. level interprets what type of information is being inspected.

Q13. .................................. level just decides in which format the information should beexamined.

Q14. The .................................. problem recommends that one is never totally positive if aparticular rule will work.

Q15. The General Purpose of .................................. problem is to check the complete world ofThings that is changeable.

Q16. The .................................. problem illustrates how an action can cause deviations insideitsEnvironment.

Page 50 of 248

Page 56: Self Learning Material Artificial Intelligence

The epistemological portion of AI studies what types of facts regarding the world are accessibleto aviewer with specified opportunities to scrutinize, how these facts can be symbolized in thememory of acomputer, and what rules allow legitimate conclusions to be drawn from thesefacts. It leaves away theheuristic problems of how to search spaces of probabilities and how tomatch patterns.Considering epistemological problems independently has the following benefits:

1. The same problems of what information is obtainable to a spectator and what conclusionscan be

taken out from information arise in association with a variety of problem solvingtasks.

2. A solution of the epistemological problems can assist a wide variety of heuristic strategies to a

problem.

3. AI is a very complicated scientific problem, so there are huge advantages in locating partsof the

problem that can be separated out.

4. It is quite hard to formalize the facts of general knowledge. Current programs that influencefacts

in some of the domains are restricted to special cases and don’t concern the difficultiesthat must

be conquer to attain very intelligent behavior.

We will converse what facts a person or robot must consider in order to attain a goal by some Approachof action. We will ignore the question of how these facts are displayed, e.g., whetherthey aredemonstrated by program. We begin with great generality, so there are many problems.We get successively simpler problems by presuming that the difficulties we have acknowledgeddon’ttake place until we obtain to a class of problems we believe we can solve.We start by enquiring whethersolving the problem needs the cooperation of other peopleor overcoming their opposition. If either is true,there are two subcases. In the first subcase,the other people’s wishes and goals must be considered, andthe actions they will take inspecified conditions predicted on the supposition that they will attempt toattain theirgoals, which may have to be exposed. The problem is even more hard if bargainingisconcerned, because then the problems and indeterminacies of game theory are pertinent.Even ifbargaining is not concerned, the robot still must “put himself in the position of theother people withwhom he communicates”.

Check Your Progress/Self-Assessment Test

Q17. The ............................... portion of AI studies what types of facts regarding the world areaccessible to a viewer with specified opportunities to scrutinize.

Q18. Epistemological problems leave away the ............................... problems of how to searchspaces of probabilities and how to match patterns.

Q19. The problem of showing information regarding what remains unchanged by an............................... was known as the frame problem.

Page 51 of 248

Page 57: Self Learning Material Artificial Intelligence

3.12. Summary

In this chapter,we have studied the concept of problem in artificial intelligence Problems have the generalform given some data, find value. The answer to get approach of finding best possible solution to startfirst and then find a way to get the success. While solving the problem, whatever actions are taken wiselywith the target to get success leads us from the first step to the last step. Problems have the general formgiven such-and-such data, find x.An “optimal solution” to a problem is the best solution according tosome measure of solution quality.Problem Characteristics define Problem in a proper way.The problemreduction techniques can be represented as an “AND-OR graph”.The thought of State Space Search isbroadly used in Artificial Intelligence. The plan is that a problem can be solved by probing the stepswhich might be taken for the solution.The 8 puzzle comprises eight numbered, changeable tiles set in a 3× 3 frame.Semantic Level interprets what type of information is being inspected.The epistemologicalportion of AI studies what types of facts regarding the world are accessible to a viewer with specifiedopportunities to scrutinize, how these facts can be symbolized in the memory of a computer, and whatrules allow legitimate conclusions to be drawn from these facts.

3.13. Glossary

Problems: have the general form given some data, find value.

Semantic Level: In this level, we do investigation on the provided information.

Expert System: Field of artificial intelligence.

PROLOG:It is one of the programming languages of artificial intelligence. It consists of Englishsentences in the form of rules and questions.

Syntactic Level: It takes such decisions like what will be the format of the data which is needed to beinvestigated?

3.14. Answers to check your progress/ Self-assessment Questions

1. A set of rules.2. State space representation3. Problem has five states: “Start State”, “Successor Function”, “State Space”, “Path Cost”, “Final

Test”4. Modeling Include: Problem Identification, Problem Analysis, Setting Goal, Plan Implementation,

Plan Evaluation5. Check, Act, Plan, and Do.6. Deliberations are:

Is the problem decomposable? Can solution steps be ignored or undone? Is the Universal Predictable? Is good solution absolute or relative? The knowledge base consistent? Role of Knowledge?

Page 52 of 248

Page 58: Self Learning Material Artificial Intelligence

Does the task require interaction with the person?7. “Expert systems” are programs which are the field of artificial intelligence.8. “Medical Diagnosis”, “Planning”, “Scheduling”, “Configuration and design.”9. 8 Puzzle10. Objective11. frame12. Semantic13. Syntactic14. Qualification15. inferential16. Ramification17. Epistemological18. Heuristic19. Event

3.15. Model Questions.

1. Define Problem. Characteristics of Problem.2. What is Problem Reduction?3. Explain the concept of expert system in detail.4. What is Knowledge Engineering?5. State 8 puzzle problems? Explain with help of an example.6. What is frame problem? Illustrate the concept.7. Illustrate the fundamental types of changes that occur in frame problem.8. Discuss the various problems that can take place in case of frame problem.9. What are Epistemological problems in artificial intelligence? Explain.

Page 53 of 248

Page 59: Self Learning Material Artificial Intelligence

LESSON 4 : State Space Search

Structure of the Lesson

4.1. Introduction to State Space Search

4.2. State Space Search as Water Jug Problem

4.3. Water Jug Algorithm.

4.4. Water Jug Algorithm Program using Prolog.

4.5 Production System.

4.5.1. Classes of Production Systems.

4.5.2. Advantages of Production Systems.

4.5.3. Disadvantages of Production Systems.

4.5.4. Production System Characteristic.

4.5.5. Issues in the Design of Search Programs.

4.6. Production System: Introduction to Rule Base System.

4.7. Summary.

4.8. Glossary.

4.9. Answers to check your Progress/Self-Assessment questions.

4.10. Model Questions.

4.0 Objectives

After studying this chapter, students will be able to:

Understand the problem as a state space search. Water Jug Problem and its state space. Step by Step Procedure of Water Jug Problem Illustrate the concept of production systems. Identify the problem & production system characteristics.

Page 54 of 248

Page 60: Self Learning Material Artificial Intelligence

Advantages and Disadvantages of Production System. Understand Production System as Rule Based System.

4.1. Introduction to“State Space Search”State space search is on of the popular search technique used in artificial intelligence to solve variousproblems. Usually, in our daily life we do searching. Searching of our books, clothes in our wardrobes.Similarly, searching process is used in artificial intelligence with the target of finding some useful resultsand on the basis on those results; we can take some intelligent decision. The following figure clearlydefines the Meaning of search in and state space in artificial intelligence.

Figure No.4.1 Defining Search and State-space.

So, we can define the problem as ton search the best path to reach to the destination. In the followingfigure no.4.2 we have tried to explain the meaning of state space search in artificial intelligence. Let saywe start from a point “A” and want to reach the destination at “J”. Now the question arises in our mind isthat how we can reach our destination without taking much risk of time and cost. Moreover we observethat there are several paths available from “A TO J”. State space search defines how to move to the nextstate to get the optimal result.

Page 55 of 248

Page 61: Self Learning Material Artificial Intelligence

Figure No.4.2. State Space Search

4.2. “State space Search” as “Water Jug Problem”The techniques of state space search are mostly used for finding the best answers in artificial intelligenceproblems. One of the very popular problems which are solved using state space search is “water jugproblem”.

Figure No.4.3 Problem State

The main problem in water jug problem is that we have to shift water from on utensil to another utensil.But the question arise in our mind is that what are the rule of shifting the water? Figure No. 4.3 presentsthe input state and tells us what is expected at the last. So, now the next task is to represent the problemas state representation. In this way, we will be able to understand the components of the problem part.Figure No. 4.4 shows the states of water jug problem.

Page 56 of 248

Page 62: Self Learning Material Artificial Intelligence

Figure No.4.4 Water Jug State Representation

From the state space representation, we have come to the point that we must have a start point, a targetand some states to move on.On basis of this principle water jug problem is get solved. The followingfigure 4.5 shows that if we consider two utensils to move their water, what will be the states of “water jugproblem”.

Page 57 of 248

Page 63: Self Learning Material Artificial Intelligence

Figure No 4.6 State Space Search of Water Jug Problem.

Figure No.4.7 State Space Problem Solution using Water Jug Problem.

To understand the concept lets discuss the concept with another example, thereare two jugs, “a 4-gallonand a 3-gallon capacity “which are non-calibrated. There is a source that can be used to fill the utensilswith water. Now the question is that how can one get exactly “two gallons of water into the four-gallonjug?”

For the given specific problem, tasks will be performed and we will have to take several successful andunsuccessful actions.To understand the story of actions and to show how the problem state changes withgiven the different actions:Let’s take an example: “Rules such as [A4, A3] and [A4, 0] mean that we canget from a state where there are A4 gallons water in the first jug and A3 in the second jug to a state where

Page 58 of 248

Page 64: Self Learning Material Artificial Intelligence

there are A4 gallons in the first and none in the second, using the given action. If there is a condition suchas (if A3+A4<3) this means that we can only apply the rule if that condition holds. We will consider anaction only if there is any change in the present state.”

The notion of a sub state is a little more confusing. There is need to look at all the actions and find thoseapplicable to the present state. You can use the set of various rules to optimize the state resulting fromthat action. One special element in the search tree can represent of particular state.

Basically, we consider that all the utensils are empty, so the start state is (zero, zero), and the nodedescriptions are:

“Open = [(0, 0)]”

“Closed = []”

Our goal state is “[2, A3], where A3 can take any value.”

After starting of the problem solving process, one has to remove the first state from open and look for itsuccessors. There are two actions that you can take from (0, 0) that will change the state or filling thethree or four gallon jug. Possible successors are (4, 0) and (0, 3), so our new description of lists are:

“Open = [(4, 0), (0, 3)]”

“Closed = [(0, 0)]”

From [4, 0] actions possible successor states are :(0,0), (0,0), (1,3), (4,3) is on the finished points , so isremove away and the new lists will be:

“Open = [(4, 3), (1, 3), (0, 3)]”

“Closed = [(4, 0), (0, 0)]”

Now, from (4, 3) we can apply actions 5 and 6 with change of state. Action 4 will get us back to (4, 0)which is on the closed list, while Action 3 will get us to (0, 3) which is on the open list. So , we put (4, 3)on finished list and go on to look at (1 ,3) we can fill the 4- gallon (Action 1), but that will get us back to(4, 3)we can empty the 3 gallon into the 4 gallon, but that will get to (4, 0) or we can empty either jug.Emptying the 3- gallon jug (Action 4) gets us to a new state (1, 0):

“Open = [(1, 0), (0, 3)]”

“Closed = [(1, 3), (4, 3), (4, 0), (0, 0)]”

From (1, 0) the only action that will result in a new state is 6, with new state (0, 1). Action No. 1 (fillingthe 4 gallon) results in a new state (4, 1), with lists now:

“Open = [(4, 1), (0, 3)]”

“Closed = [(0, 1), (1, 0), (1,), (4, 3), (4, 0), (0, 0)]”

From (4, 1) we try filling the 3 gallon from the 4 gallon jug resulting in a state (2, 3)

Which is the solution to this problem? The portion of the search ruler or action that is explored is givenbelow:

Page 59 of 248

Page 65: Self Learning Material Artificial Intelligence

Symbols:

= fill the jug

= pour water on ground from the jug.

Or = fill jug with some water from another jug.

Or = fill jug with all water from another jug.

Action 1:

If (condition) Then (Action) Description

X4<4 X3=empty Fill x4 jugwith water

Action 2:

If (condition) Then (Action) Description

X4=

Empty

X3<3 Fill x3 jugwith water

Action 3:

If (condition) Then (Action) Description

X4>0 X3=empty

Or somewater

Pour allwater onground fromx3 jug

Action 4:

If (condition) Then (Action) Description

X4 X3

X4 X3

X4 X3

Page 60 of 248

Page 66: Self Learning Material Artificial Intelligence

X4=empty

Orsomewater

X3 > -0

Put waterfrom x3 to x4(until jug isfull)

Action 5:

If (condition) Then (Action) Description

X4+x3 X3 >0

Put waterfrom x3 to x4(until jug isfull)

Action 6:

If (condition) Then (Action) Description

X4>0 X3+x4≥3

Put waterfrom x4 to x3(until jug isfull)

Action 7:

If (condition) Then (Action) Description

X4+x3≤4

X3 >0

Put all waterinto x4 fromx3

Action 8:

If (condition) Then (Action) Description

X4 X3

X4 X3

X4 X3

X4 X3

Page 61 of 248

Page 67: Self Learning Material Artificial Intelligence

X4>0 X3 +x4 ≤ 3

Put all waterinto x3 fromx4

In order to solve such state space problem, one solution is that

“Fill the 4 gallon jug.” “Fillthe 3 gallon from the 4 gallon jug.” “Empty the 3 gallon jug” “Empty the 4 gallon into the 3 gallon jug.” “Fill the 4 gallon jug.” “Fill the 3 gallon from the 4 gallon again.”

So, the solution sequence of Rules (Actions) is:

1-6-4-8-1-6

There are lots of other problems that have been solved using similar techniques,

“Missionaries and cannibals problem” “Monkey and bananas problem” “8 puzzle problem”

However, “search techniques are applied in many more artificial intelligence applications like:languageunderstanding, where one may search through possible syntactic patterns; robotic engineering where wemay search for a good path for the robot to take, to visualize, where we may search for meaningfulinterpretations of features of the object to be identified. In order to solve real problems you generallyhave to put a lot more effort into representing the problem. You have to consider exactly what arepresentation of word state needs to be, what the start and target states are and what the availableoperators is that allow you to transform one state into another. You also need to decide whether or notstate space search is appropriate or it would be the problem reduction that would be better”. As aconclusion figure no.4.8 shows the production rules to solve the problem of water jug.

X4 X3

Page 62 of 248

Page 68: Self Learning Material Artificial Intelligence

Figure No. 4.8 Rules of Water Jug Problem

Check your Progress/Self -Assessment Questions

Q1. Which search methodology is used to solve the “Water Jug Problem”?

Q2. In------------------------------------we reach from initial state to final state using state spacerepresentation.

4.2 Water Jug Problem Algorithm

Water Jug Problem Algorithm

Problem: “We are provided with 2 jugs, a 4-litre one and a 3-litre one. Neither contains any gaugingmarkers on it. There is a pump that can be accessed to fill the jugs with water. How canwe obtainprecisely 2-litre of water in to the 4-litre jugs?”

Solution:

Page 63 of 248

Page 69: Self Learning Material Artificial Intelligence

This problem can be defined in the form of state space search as below:

“{(a, b) a = 0, 1, 2, 3, 4 b = 0, 1, 2, 3}”

Here in this problem, ‘a’ shows the number of liters of water in the two different utensils: “4-litre jug”and ‘b’ represents the number of liters of water in the “3-litre jug”. The starting state is (0, 0).It meansthat is no water on every jug. The objective state is to obtain (2, n) for any value of ‘n’.

(a, b) — (4, b) if a< 4.

“Fill the 4-liter jug, if 4-liter jug is not full.”

(a, b) — (a, 3) if b< 3.

“Fill the 3-liter jug, if 3-liter jug is not full.”

(a, b) — (I – s, b) if a> 0.

“Pour some water out of the ground, if 4-liter jug is not empty.”

(a, b) — (a, b – s) if b> 0.

“Pour some water out the 3-liter jug, if 3-liter jug is not empty.”

(a, b) — (o, b) if b> 0.

“Empty the 4-liter jug on the ground, if 4-liter jug is not empty.”

(a, b) — (a, o) if b> 0.

“Empty the 3-liter jug on the ground, if 3-liter jug is not empty.”

(a, b) — (4, b – (4 – I)) if (a + b) < = 4 & b< 0.

“Pour water from the 30-liter jug into the 4-liter jug until the 4-liter jug is full, if the combined content is> = 4 and 3-liter jug is not empty.”

(a, b) — (a, (3 – b), 3) if (a + b) > =3 & a> o.

“Pour water from the 4-liter into the 3-liter jug until the 3-liter jug is full, if the combined content is > = 3and 4-liter jug is not empty.”

(a, b) — (a + b, 0) if (a + b) > = 4 and a> 0.

“Pour all the water from the 3-liter jug into the 4-liter jug if the jug, combined content is < = 4 and 3-literjug is not empty.”

(a, b) — (0, a + b) if (a + b) < = 3 and a> 0.

“Pour all the water from the 4-liter jug into the 3-liter jug, if the combined content is < = 3 and 4-liter jugis not empty.”

4.3. The Water-jugs Problem with PROLOG

Page 64 of 248

Page 70: Self Learning Material Artificial Intelligence

The programimplements solution to the “water jug problem”. It would be better if rather than filling froman infinite water resource; we should start with a finite start charge with utensil.

This is simpler method. Here we have to take only two actions. We need to draw a policy which isflexible. We also know that we have limited supply from the supply of water.We can use filled reservedwater with a capacity greater than the combined capacities of the jugs, so that the stock of water cannever be emptied. The water jugs solution are often calculated by a simple breadth first search and statespace search

Water jugs Program

Low Capacity = 3,

High Capacity = 4,

Supply is LowCapacity+HighCapacity+1,

weight ( small, Capacities, Low Capacity),

weight (large, capacities, High Capacity),

weight ( supply, capacities, Supply),

weight (low, initial, 0),

weight ( high, initial, 0),

weight (supply, Start, Supply),

weight (high, Final, 2),

water jug (Start, Capacities, Initial, Solution),

sentence (narrative (Solution, Capacities, Final), Chars),

put chars (chars).

“Water jugs (+initial, +capacities, +final? solution)” carries when solution is the last stage in a state spacesearch, starting with a start point in which the water-jugs have capacities and contain the start weight.The end node is reached when the water-jugs contain the end volumes. “Water jugs (initial, capacities,final, solution)solve jugs ([initial (initial)], capacities, [], final, solution).”

“Solve jugs (+nodes, +capacities, +visited, +final, ?solution)” contains when solution of the problem isthe end point in a state space search. We need to begin with a first open point in available points. It willbe finishing when the water jugs carries only the end weights. Capabilities define the capacities of thewater jugs while visited is a list of points in the problem solution. The“breadth-first operation”of solvejugs is due to the existing nodes being appended to the new nodes. If the new nodes were adjusted to theexisting nodes, the operation would be “depth-first.”

Page 65 of 248

Page 71: Self Learning Material Artificial Intelligence

“Solve jugs ([node | nodes], capacities, visited, final , solution)node state (node, state)(State=final ->

solution = node;otherwise ->

find all (successor,successor (node, capacities, visited, successor),successor),append (nodes, successor, new nodes),solve jugs (new nodes, capacities, [state | visited],

end,solution)

).”

“Successor (+Node, Capacities, + Visited, ?Successor)” Successor is a “successor of Node”, for waterjugs with “Capacities”, if there is a legal transition from Node’s state to Successor’s state.“Successor’sstate” is not a member of the Visited States.

“Successor (Node, capacities, visited, successor):-Node state (node, state),Successor = node (Action, State1, Node),Jug transition (State, Capacities, Action, State),\+ member (state, visited).

jug transition(+State, +Capacities, ?Action, ?successor state)”

contains when action describes a valid transition.

There are 2 kinds of actions which can be performed in this particular problem.

1. “Empty into (source, target)”: This condition will bevalid on the basis of few conditions.Condition is that if source is not already empty and the combined components from start pointand final in state are not greater than the available capacity of the final utensil. Few of thesources willbecome empty in successor state. But some of the states will reach at the targetjug which is having the combined contents from source and target in state.

2. “Fill from (Source, Target)”: This condition will be againvalid on the basis of fewconditions. It will be valid if starting point is not already empty and the combined contentsfrom start and finish in state are greater than the capacity of the target in state are greater thanthe capacity of the target jug. The target jug becomes full.

“Volume (?jug, ?state, ?volume) holds when jug (“high”, “low” or “supply”) has volume in state.

Volume (low, jugs (low, _high, supply), low).

Volume (higher, jugs (low, _higher, supply), high).

Page 66 of 248

Page 72: Self Learning Material Artificial Intelligence

Volume (reservoir, jugs (low, _high, supply), supply).”

“Jug permutation (?source, ?target, ?unused) holds when source, target and unused are permutation oflow, high and supply. Jug permutation (source, target, unused):-

Select (source, [low, high, reservoir], residue),

Select (target, residue, [unused]).”

“Node state(?node, ?state) holds when the contents of the water jugs at node is described by state.

Node state (start (state), state).

Node) state(node (_transition, state, _predecessor), state).”

Check your Progress/Self- Assessment Questions

Q3.Name two actions that can be performed on the water jug Problem?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

4.4 Production System

Knowledge demonstration formalism comprises collections of rules. While working on a problem set, weproduce steps to solve the problem. A large amount of database is needed to customize the rules. There isneed of a Production System Interpreter. This system willmanage the operation of the rules. This systemwill contain control mechanism of a Production System. This system will format the order in whichProduction Rules are getting fired.We need to have a system that utilizes all of the available knowledgerepresentation. This knowledge representation is known as a production system. A production system hasa set of rules and various factors. The system has the specific knowledge which is programmed in adeclarativefrom. Following figure no.4.9 shows production system which is used in artificial intelligenceand that system include a set of rules of the form Situation.

Page 67 of 248

Page 73: Self Learning Material Artificial Intelligence

Figure No.4.9 Production System

We can take several examples to understand this concept of production system. We can build rules usingcontrol statements. Like: “IF the initial state is a goal state THEN quit”. The main parts of a productionsystem of artificial intelligence include:

1. “A large database”2. “A set of rules used for production”3. “A control system”

Various rules can be applied to the production system. Then various logics and decisions are appliedon those systems to generate various facts. Figure No.4.10 shows the production of rules to generatefacts

Page 68 of 248

Page 74: Self Learning Material Artificial Intelligence

Figure No.4.10. Role of Production Rules

The objective database is the central data structure. This data structure is utilized by an AI productionsystem. The production rules are based upon the global database. Every rule has a requirement. Theserequirements are either pleased or not. In any case,if the requirement is pleased, then it means that rulecan be applied. Applicationof the rule may vary for the database.The control system selects whichrelevant rule should be applied.What are the conditions that need to be applied on the database to bepleased?

Figure No. 4.11.Reasoning with Production Rules

4.4.1. “Classes of Production Systems”

1. A “monotonic” production system2. A “non-monotonic” production system3. A “partially commutative” production system4. A “commutative” production system.

4.4.2. Advantages of Production Systems

1. Production systems provide us an instrument for providing structure to artificial intelligenceprograms.

2. Production Systems generate the individual rules. It updates, modifies these rules. Rules can beremoved independently.

3. The production rules are generated in a natural form. We can use simple English sentences torepresent the statements enclosed in the knowledge base.

Page 69 of 248

Page 75: Self Learning Material Artificial Intelligence

4.4.3. Disadvantages of Production Systems

The difficulty with the production system is that it may be very hard to analyzethings. It may be hard toestimate the flow of control. Control can be inside or outside the insidea production system. But theproblem is that, the individual rules don’t call each other. Production systems use lot operations toperform the task.

4.4.4. Production System Characteristics

1. Can production systems, simply be implemented to formulate the solution of problem?2. Whatever the relationships is among problem types and the various types of production systems,

are all the types are best matched to solving the problems?3. Different classes of production system fulfill the task of problem solving differently?

4.4.5. Problems in the designing of Search Programs

1. Which direction needs be carried out in order to do search?2. How we can to match the best applicable rule from the available rules?3. How to get symbolize every element in order to search processes?

4.5. Production systems: “Introduction to Rule based systems”“Rule based systems” are fairly simple. These systems are having of little more than a set of if-then rules.These systemsprovide the basis which is referred as expert systems. These are widely used and popular inmany fields of artificial intelligence. The concept of a production system in this the knowledge of anexpert in encoded into the rule set to generate desired results from the problem domain. Figure no.4.12shows the decision making concept of production system using rule productions.It represents how rulebased systems helps in solving the problem. The system always learns from the environment. Importantrules are built up on the basis of opinion of the experts.

Page 70 of 248

Page 76: Self Learning Material Artificial Intelligence

Figure No.4.12. Decision making in Rule Based Production System

Rule based systems are a fundamental model that helps in solving number of problems. In artificialintelligence a rule based system has its opportunities. Production system may have many constraints.Before taking any move it musttake those constraints before deciding if it’s the appropriate technique tosolve problem. The whole rule based systems needs to be understood first. It is really only feasible forsuch problems in which any kind of knowledge in the problem area can be written in the form of somerules. Let say, the procedures are if-then procedures; it means that problem area is not large. Thefollowing figure no.4.13 shows the different modules of knowledge base system.

Page 71 of 248

Page 77: Self Learning Material Artificial Intelligence

Figure No.4.13. Modules of Knowledge Base System

While constructinga rule based system for a given problem, you must have the following:

1. A set of facts to needs to be defined. It is necessary to represent the starting working memory.2. A set of rules and procedures are required to take any or all actions. These actions are taken that

should be taken within the scope of a problem. The system can be affected by the number of rulesand procedures in the system working for that particular problem.

3. Conditions which can be inside or outside the production system determine that a solution hasbeen found or we have to declare that no solution exists. This is required to finish some rule basedsystems which are found in infinite loops otherwise.

Check your Progress/Self-Assessment Questions

Q4.What“Production system” consists of?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q5.“Knowledge” is programmed in a ----------------------------

Q6.What is the components of Production System?---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q7. For which system relevant rule should be applied, when we get good database satisfying allconditions?

Q8.Name the classes of Production system.---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Q9. Write any two advantages of Production System.---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Q10. Write any disadvantage of Production System---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q11. Theorem proving falls under ---------------------------------------------------- communicative system.

Q12.What is the issues in the design of search program?---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 72 of 248

Page 78: Self Learning Material Artificial Intelligence

4.6 Summary

This chapter focus on the state space search.The thought of State Space Search is broadly used inArtificial Intelligence. The plan is thata problem can be solved by probing the steps which might be takenfor the solution. The state space illustration permits for a formal definition of the problem astherequirement to exchange some given situation into some preferred situation by means ofa set ofallowable operations. A system that utilizes this form of knowledge representation is known as aproductionsystem. A production system includes rules and factors. Knowledge is programmed in adeclarativefrom which includes a set of rules of the form. A production system in which the applicationof a specific sequence of rules transformsstate X into state Y, then any permutation of those rules that ispermissible also convertsstate x into state Y. In water jug problems, neither jug contains any gaugingmarkers on it. There is a pumpthat can be accessed to fill the jugs with water.

4.7 Glossary

Heuristic Search: It resolve multifaceted problems competently, it is essential to negotiate the needs ofthe immovability and systematically.Production System: A system which is used to represent knowledge in a sophisticated manner.State Space Search: In this, the plan is that a problem can be solved by probing the steps whichmight betaken for the solution.Water Jug Problem: Deals with filling up of utensil with water and this water is taken from anotherutensil on the basis of come conditions.There is a pump that can be accessed to fill the jugs with water.

4.8 Answers to check your Progress/Self –Assessment Questions

1. Search Space States2. Water Jug Problem3. Empty into, Fill from (Source, Target)4. Rules and factors.5. “Knowledge” is programmed in a declarativeForm. Itincludes a set of rules of the form Situation.6. A large database, A set of rules, A control system.7. The control system8. A monotonic ,non-monotonic, partially commutative, commutative production system.9. “Production systems offer an exceptional tool for structuring AI programs. Production Systems

are extremely modular since the individual rules can be added, updated , modified or removedindependently.”

10. Production systems uses various operations in order to carry out in a search for a solution to theproblem.

11. monotonic partially communicative system.12. The direction, How to choose applicable rules, How to symbolize every element in the process.

4.9 Model Questions

1. What is State Space Search?2. What are the various states in state space search?3. Elaborate the concept of state space search as water jug problem

Page 73 of 248

Page 79: Self Learning Material Artificial Intelligence

4. List problems related to state space search?5. What is Production System?6. Explain the classes of production system?7. What is the rule based systems?8. Explain various characteristics of production system?9. Discuss various classes, advantages, disadvantages of Production System?

Page 74 of 248

Page 80: Self Learning Material Artificial Intelligence

LESSON 5 : Search in Artificial Intelligence

Structure of the Lesson

5.1. Introduction

5.2. Necessity of Search.

5.3. How search fits in AI?

5.4. The Steps of Search.

5.5. Types of Search.

5.5.1. Depth First Search,

5.5.2. Breadth First Search

5.5.3. Advantages and Disadvantages.

5.6. Summary

5.7. Glossary

5.8. Answers to check your Progress/ Self-Assessment Questions

5.9. Model Questions.

5.0. Objectives

After studying this chapter, the student will be able:

Understand the meaning of search.

Why search is necessary in Artificial Intelligence.

How Search fits in the concept of Artificial Intelligence.

Step by step procedure to do search.

Different Types of Search.

Depth First Search and Its advantages and disadvantages.

Breadth First Search its advantages and disadvantages.

5.1. Introduction

Search is done in daily life by all of us. Search is one of the important concepts of artificial intelligence toprovide the base behind artificial intelligence. Search is an algorithm. It takes a problem as input. Afterthat it returns with a selection from the search space. This space is the set of all solutions. The term “statespace search” is the search where the problem is to find a target. This target is achievedfrom somestarting point of the state to target state. A state space is collection of states. It has several arcs betweenthem. We can consider the help of a tree to understand the help of search concept. Search algorithm findsa solution always. For any given problem, it tries to find out solution of different sequences of actions.

Page 75 of 248

Page 81: Self Learning Material Artificial Intelligence

We can understand the concept of searching by taking the example of figure no.5.1.This figure states thatwe want to go to some particular destination from one place to another place. Let say, I want to go tospend my holidays in a beautiful beach. So, I have to travel for that destination. I will start from my homewhich is my initial state and then I will find a lot of ways to reach to the destination.

Figure No.5.1 Example of Search

5.2. Necessity of Search

Check your Progress/Self-Assessment Questions

Q1. Search space is the set of -----------------------------------------------------------------------------------

Q2. A state space is collection of-------------------------------------------------------------------------------

Page 76 of 248

Page 82: Self Learning Material Artificial Intelligence

Now the question arises in our mind that why there is need for search? We know the destination place is abeach. We can start straight way and will reach the destination one day.Search is considered as auniversal problem solving mechanism. It is considered very helpful in artificial intelligence. Thesequence of steps required to solve a problem. Sometimes we do not know the steps of solution. It mustbe determined by a systematic exploration of alternatives that can be used to solve a specific problem.There are several important reasons which show that there is need of search. Some of the reasons arelisted below which shows that there is need of search:-

1. No model of the world is complete. No model is consistent. No model is computable. This is

a shock or surprise for intelligent system.

2. Solutions to particular problems cannot be precompiled. There are so many problems that are

solved only on the basis of the observed data.

3. There is flexibility to deal with anenvironment that requires search.

4. There is confusion in interpretation of data. It requires search interpretation. It may be locally

confused. There are some global constraints which may permit unambiguous interpretations.

5. If we want to do creativity, it is only possible with searching; Search can result from searching

through many possible designs.

5.3 How Search Fits Into Artificial Intelligence

“Search” was raisedin nearly every area of artificial intelligence. Because the artificial intelligence wastrying to model human intelligence in machines.

1. “Logic”: - A theorem proved searches for steps of proofs that will prove a desired output.

2. “Natural language”: - A parser search for the best ways of designing structure and meaning

to sentences that is ambiguous.

3. “Planning”: -A planner search for a procedures of actions that will accomplish a target.

4. “Perception”: - These are the raw input which is often ambiguous. The “perception program”

searches for a good set of interpretations of the input.

5. “Learning”: - A learning program searches for data which is considered as a set of training

instances.

6. “Expert system”: - It uses search to find out various rules applicable to the current problem.

Check your Progress/Self-Assessment Questions

Q3.The------------------------------------- required to solve a problem is not known and it must bedetermined by a systematic exploration of alternatives.

Q4. Ambiguity in interpretation of perceptual data requires search interpretation may be locally

ambiguous, but global constraints may permit an-------------------------------------.total

interpretation.

Page 77 of 248

Page 83: Self Learning Material Artificial Intelligence

Check your Progress/Self-Assessment Questions

Q5. Define Learning.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q6. What is Perception?

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q7. Define Logic.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q8. What do you mean by Natural Language?

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q9. Define Planning.-

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

5.4. The steps of search

The search involves the following steps:-

1. “Devise a representation scheme for states”

2. “Describe starting and a ending state”

3. “Describe operators”

4. “Select which state to expand next”

5. “Recognize the goal when generated”

Advantages of Search

Many kinds of problems can be observed using search concepts. In order to solve a problem using search,it is required to code the operations which are being used. Search algorithm is capable offinding thesequence of actions to get the desired result. Several examples can be used to understand the concept ofsearch. Let say, we are writing a program to play chess by using search algorithm. This task is onlypossible only if one knows the rules of chess.

Disadvantages of Search

Page 78 of 248

Page 84: Self Learning Material Artificial Intelligence

Most problems have search spaces very large. These are so large thatsometimes it is impossible to searchthe full space chessboard game whichhas been estimated to have“1042 possible moves”. The rapid growthof combinations of possible moves is known the “combinatory explosion problem”.

5.5 Types of Search

Search can be divided in following two categories:

1. Uniform search (blind search)

2. Informed search

Uniformed search

“Uniformed search” has no informed about the number of steps. It has no estimation ofthe paths costsfrom the current state to the goal. These types of search can only differentiate a target state from a non-target state. There is no bias to move forwards the desired goal.

A blind search has no information about its domain. The only thing that a blind search can do is that itcan distinguishanunusual state form a useful state.

Let us understand this concept with help of a map. Why I have chosen this topic of map as examplebecause we are familiar with this since from our junior classes. We have a simplified figure of map ofPunjab. Assume thatyou are in “Mansa” and we want to go to “Kapurthala”. If we produce a search tree,at level 1 we will have three districts, “Sangrur, Ludhiana andJalandhar”. A blind search will never havepreference as to which nodes it should explore first. You may wonder why we should use a “blindsearch” when we could use the search with some built in intelligence. The simple answer is that theremay not be any information we have found it until we see it.

Check your Progress/Self-Assessment test.

Q10. What are the Steps of Search?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 79 of 248

Page 85: Self Learning Material Artificial Intelligence

Figure No.5.2 shows Map of Punjab

The “blind searches” we are about to consider only differ in the order in which we move towards thenodes. This may have a major impact as to how well the search is performing. The following methods areused for blind search:

1. Breath-first search2. Depth first search3. Depth limited search4. Iterative deepening5. Bidirectional

5.6. “Breadth first search”

“Breadth first search” generates new states in the order of their distance from the start state. Here it isconsidered that all states at level I are examined before any states at level i+1 are examined. BFS is

Check your Progress/Self-Assessment test.

Q11. Name types of Search.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q12. What are the Methods of Blind Search?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 80 of 248

Page 86: Self Learning Material Artificial Intelligence

performed by exploring all nodes at a given level before proceeding to the next level. It uses a queuestructure to hold all generated but still unexplored nodes.

This search pattern will be used as an example node set. The initial state will be nodeA, and the goal stateis node L. Between initial state and goal state various intermediate nodes are available. In search tree.Search process starts with start node. A search procedure will complete in the following step

Initial State

Step1:

In this Stage search tree is ready to being search where queue is empty, nodes expanded are NIL andcurrent action is also Nil.

Step2:

We being with our initial state’s the node labeled A. Queue size contains value 1 of node A. Size ofqueue indicate the no. Of nodes which are available in queue. But here expansion of node A is notexecuted. So, Value of expended nodes is zero (0).

Step 3:

Node A is not a goal node. Node A is removed from the queue then each revealed node is added to theend of the queue. Result: Expansion of current action.

Size of Queue: 0 Queue: Empty

Nodes expanded: 0 Current Action Current level: N/A

AB C D E F

I J K L MG H N PO

Q R S T U V W X ZY

A

B C D E F

Page 81 of 248

Page 87: Self Learning Material Artificial Intelligence

Step 4:

In this stage, expanded nodes are stored in queue, then the size of queue changes (5) and queue containschild nodes BCDEF. The search then moves to the first node in the queue.

Step 5:

Node B Selected as a starting node from queue and examined as algorithm. Node B is not a goal node,expand it. We then backtrack to expand node C and the process continues.

Step 6:

In this step, node C expanded and successor of node C put in queue at the end. Then we backtrack tonode D and expand its offshoot and put at the end of queue, then the size of queue is 8, current actions isexpanding, current level is 1 and expanded nodes are 4.

A

B C D E F

A

B C D E F

A

B C D E F

G H

Page 82 of 248

Page 88: Self Learning Material Artificial Intelligence

Step 7:

At this stage, node E examined and expanded, successor are put on queue at end side. We then backtrackto expand node F and put child on end of queue here, all nodes of level generated.

Step 8:

After step 7, the first node of queue of G. Examine and expand it and put offshoots of node G on end ofqueue.

Step 9:

This stage is examined first, node H of queue, and remove node H and put children at end of queue,backtrack on I and examine. Then put the generated successor at the end of queue. Follow the sameprocess with node J.

A

D ECB F

O PNMI J K LG H

I J K LG H

A

B C D E F

I J K LG H M N PO

Q

Page 83 of 248

Page 89: Self Learning Material Artificial Intelligence

Step 10:

Node K examined and put all successors (only node U) at end of queue and then examines next the nodein queue is L, which is goal node of search tree, which means solution found in “search process”.

Advantages

1. It provides us the guarantee that we will able to find an optimal solution.2. It is capable of always finding a goal node if one exists.

A

B C D E F

I J K LG H M N PO

Q R S T

A

B C D E F

I J K LG H M N PO

Q R S T U

Size of Queue: 0 Queue: Empty

Nodes expanded:11

Finished Search Current level: 2

Page 84 of 248

Page 90: Self Learning Material Artificial Intelligence

Disadvantages

1. It requires a lot of storage capacity.

5.7. Depth-first search

“Depth first search” applies operators to search newly generated state, trying to drive directly towards thegoal. DFS differs from BFS only in how the new paths are added to the list.

Characteristics

1. It needs modest memory requirements. Only needs to store the path from the root to the leaf nodeas well as the unexpanded nodes.

2. If “depth first search” goes down an infinite branch, it will not terminate if it does not find a goalstate.

The following example illustrates a depth first search of 26 nodes with the initial state of node A and agoal state of node L.

Initial state

Goal stateB C D E F

I J K L MG H N PO

Q R S T U V W X ZY

A

Check your Progress/Self-Assessment test.

Q13. What is Breadth First Search?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q14. Write advantages and disadvantages of Breadth First Search?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 85 of 248

Page 91: Self Learning Material Artificial Intelligence

Step 1:

The step 1 indicates the ideal position of search tree where, queue is empty because search procedure isnot executed.

Step 2:

This stage begins with the initial node a, node A is in queue; so, the size of queue is 1. We begin with ourinitial state, the node labeled A.

Step 3:

Node A is expanded. This being not good is deleted from the queue. Each node is added to the starting ofthe queue.

Step 4:

Node B is expanded and removed from the queue. Revealed nodes are added to the FRONT of the queue.

Size of Queue: 0 Queue: Empty

Nodes expanded: 10 Current action: Current level: N/A

A

Size of Queue: 1 Queue: A

Nodes expanded: 0 Current action: Current level: 0

A

B C D E F

Size of Queue: 1 Queue: A

Nodes expanded: 0 Expanding Current level: 0

Page 86 of 248

Page 92: Self Learning Material Artificial Intelligence

Step 5:

The process now continues until the goal state is achieve

Step 6:

A

B C D E F

Size of Queue: 5 Queue: B, C, D, E, F

Nodes expanded: 1 Expanding Current level: 1

A

B C D E F

G H

Size of Queue: 6 Queu2: G, H, C, D, E,F

Nodes expanded: 1 Expanding Current level: 1

A

B C D E F

Page 87 of 248

Page 93: Self Learning Material Artificial Intelligence

Step 7:

Step 8:

G H

Q

A

B C D E F

G

Q

I JH

R S

Size of Queue: 5 Queu2: H, C, D, E, F

Nodes expanded: 4 Expanding Current level: 3

Size of Queue: 5 Queu2: S, J, D, E, F

Nodes expanded: 8 Expanding Current level: 2

A

B C D E F

G I JH

R S T Page 88 of 248

Page 94: Self Learning Material Artificial Intelligence

Step 9:

Advantages

1. Low storage requirement, linear with tree depth.2. Easily programmed.

Disadvantages

1. It may find a suboptimal solution which can becostly than the best solution.2. Incomplete without a deep length, one may not find a solution even if one exists.

Q

Size of Queue: 3 Queue; empty

Nodes expanded: 11 Backtracking Current level: 2

A

B C D E F

G

Q

I JH

R S T

K L

U

Size of Queue: 0 Queue; empty

Nodes expanded: 14 Finished Current level: 2

Page 89 of 248

Page 95: Self Learning Material Artificial Intelligence

Figure No. 5.3. Comparison b/w Depth & Breadth First Search

5.8. Summary

A “state space” is collection of states. It consists of several arcs between them. There can be a non-emptyset of start stats and goal states.Search algorithm finds a solution for a given problem. It tries differentsequences of actions to find a solution.It is not necessary that sequence of steps required to solve aproblem is known. Most of the time these are not known. It must be determined by a systematicexploration of alternatives.To solve a problem using search, it is only necessary to code the operations.Search will find the sequence of actions that will provide the desired result.Most problems have “searchspaces” so large that it is impossible to search the whole space. Breath-first search, “Depth first search”,“Depth limited search”, “Iterative deepening”, “Bidirectional search” are the various types of search.BFSis performed by exploring all nodes at a given level before proceeding to the next level.It is guaranteed tofind an optimal solution in BFS.One can always find a target state if one exists in BFS.If depth firstsearch goes down an infinite branch, it will not stop if it does not find a goal state.

5.9. Glossary

Check your progress/Self-Assessment test

Q15. What is Depth First Search?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q16. Write advantages and Disadvantages of depth first search?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 90 of 248

Page 96: Self Learning Material Artificial Intelligence

Breadth First Search: It generates new states in the order of their distance from the start state. BFS isperformed by exploring all nodes at a given level before proceeding to the next level. It uses a queuestructure to hold all generated but still unexplored nodes.

Depth First Search:It applies functions to search newly generated initialstate. It tries to drive directlytowards the target.

5.10. Answers to check your progress/ Self-assessment Questions

1. Possible solutions.2. States and arcs between them. A non-empty set of start stats and goal states.3. The sequence of steps.4. Unambiguous total interpretation.5. “A learning program searches for a compact description of a set of training instances.”6. “The perception program searches for a consistent set of interpretations of the input parts.”7. “Atheorem proved searches for a sequence of proof steps that will prove a desired conclusion.”8. “A parser search for the best ways of designing structure and meaning to sentences that is

ambiguous.”9. “A planner search for a sequence of actions that will accomplish a goal”.10. “Devise a representation scheme for states, Describe an initial and a final state,operators, Select

which state to expand next, recognize the goal when generated.”11. Uniform search (blind search), informed search.12. “Breath-first search”, “Depth first search”, “Depth limited search”, “Iterative deepening”,

“Bidirectional search”13. “Breadth first search generates new states in the order of their distance from the start state. All

states at level I are examined before any states at level i+1 are examined.”14. It is guaranteed to find an optimal solution. It can always find a goal node if one exists. High

storage requirement is disadvantage.15. “Depth first search” applies operators to search newly generated state, trying to drive directly

towards the goal. DFS differs from BFS only in how the new paths are added to the list.16. “Low storage requirement, linear with tree depth, easily programed”. Cost is the disadvantage.

5.11. Model Questions

1. Discuss Search?2. Why there is need of Search?3. How search fits in artificial Intelligence?4. What are the various types of search?5. What is the difference between Informed and uniformed search?6. What are the advantages and disadvantages of search?7. Explain Depth First search with example?8. What are the advantages and disadvantages of Depth First search?9. Explain Breadth First Search?10. What are the advantages and disadvantages of Breadth First Search?

Page 91 of 248

Page 97: Self Learning Material Artificial Intelligence

LESSON 6 : Heuristic Search Techniques

Structure of the Lesson

6.0 Objectives

6.1 Introduction

6.2 Heuristic Search Techniques

6.3 Generate and Test Approach

6.4 Hill Climbing

6.5 Best FirstSearch

6.6 Depth Limited Search

6.7 Iterative Deepening Search

6.8 The A* Algorithm

6.9 Greedy Best First Search

6.10 Constraint Satisfaction

6.11 Means End Analysis

6.12 Summary

6.13 Glossary

6.14 Answers to Check your Progress /Self-Assessment Model Questions

6.15 Model Questions

6.0 Objectives

After studying this chapter, the student will be able to:

Introduction of Heuristic Search Techniques Understand the concept of Heuristic Search Techniques Study of Control approaches of Heuristic Search Techniques Understanding of “Generate and Test”,“Hill Climbing”, “Best First Search”, “Depth Limited

Search”, and “Iterative Deepening Search” with examples. The “A* Algorithm”, “Greedy Best First Search” “Constraint Satisfaction” problem and “Means End Analysis” method

Page 92 of 248

Page 98: Self Learning Material Artificial Intelligence

6.1. Introduction

In artificial intelligence, most of the problems are solved by straight techniques. Different techniques canbesolved only by good heuristic search techniques. These heuristic techniques canbe illustratedseparately. These techniques are applied on a particulardomain. These are knownas“WeakMethods”.They are explored to combinatorial explosion. They give us the frame work. Heredomain specific knowledge can be placed.

Each search process can be observed with the example of graph. Graphs are the methods which canrepresent the problem in a simplified manner. In graph, nodessymbolize problem states. The arcs standfor relationships among states. The search process tries to find out a path .Here the beginning point isconsidered as“an initial state” and ending in one or more“final states”. The issues discussed in the unithave to be considered before performing a search.

6.2. Heuristic Search Techniques

“Heuristic techniques” are known as weak methods. They are susceptible to combinatorialexplosion.These techniques provide a specific framework. Here all the domain specific knowledge can bepositioned in that particular framework. This can be established with the help of learning concept.Learning concept has a great influence in the progress of artificial intelligence and implementation of itsvarious techniques.The following are some commonpurpose “control approaches” which is used inartificial intelligence.

“Generate-and-test” “Hill climbing” “A* search Algorithm” “Constraint satisfaction” “Means-ends analysis”

A “heuristic process” is defined as having the following properties:

1. This process tries to locate good. It is not always possible that we are going to get optimum solutions.

2. It is quicker. It is easier to execute. It is better to work with this method than working with anyrecognized exact algorithm .Most of the times, heuristic search perk up the excellence of the path. Bymeans of good heuristics we can expect to acquire good solutions to tough problems like the travelingsalesman problem in less than exponential time. There are a number of good common purpose heuristicsthat are valuable in a broad variety of problems. It is also probable to create special purposeheuristics toresolve specific problems.

Check Your Progress/Self-Assessment Questions

Page 93 of 248

Page 99: Self Learning Material Artificial Intelligence

Q1. What is the meaning of Heuristic Techniques?

----------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

Q2------------------------------------------------Techniques give the “frame work into which domain specific

knowledge can be positioned”.

Q3.What is the control approaches of heuristic search techniques?

---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

6.3.“Generate and Test” Technique

This is the easiest search technique. It consists of the following steps:

It tries to produce a possible solution for some problems. This means that it has the purpose ofgenerating a particularpoint in the problem space.

Second step is of testing to observing process. Comparison is done between various componentsto get the solution.

After performing the specific functions if a solution has been found, then we quit. Otherwise wehave to return to step 1 again.

This algorithm is a depth first search practice. It works as to find complete possible solutions. Thesesolutionsare produced before test. It can be implemented on a search graph instead of a tree to get betterresults.

Check Your Progress/Self-Assessment Questions

Q4. Which algorithm is a “Depth first search practice”?

---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

Q5.Producing “A possible solution for some problems, this means generating a particular point in the”

---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

6.4.“Hill Climbing” Technique

Page 94 of 248

Page 100: Self Learning Material Artificial Intelligence

This is a selection of depth-first search. A feedback is utilized to decidethe movement in the search space.The test function works on a simple principle whether it will justaccept or reject a solution. But in “Hillclimbing” consists of a heuristicfunction. This function which offers an estimate. This estimate is abouthowclose we are from a known state to goal state. This technique works as follows:

Generally, first “Proposed solution” as performed in “Depth-first procedure”. Observation isneeded to check whether we get the right solution or not. If we are at the right point, the next stepis of quitting; otherwise we have to move n until we did not get the result.

Rules are needed to be used to produce solutions. For every element in a particular set, we have to apply test function. It is a solution andquit. One

more thing we have to observe whether we are closer to the goal state than the solutionalreadyproduced. If the answer seems to be yes, keep it in mind. Otherwise discard it.

We have to observe and take the best element which is far produced. We have to use it as thenext coming proposed solution.This step matches up to movements. Matching is done from theproblem space in the direction towards theobjectives.

We need to go back to solution of producing new set of solutions.

During the steps of finding the solution, it may be possible that we reach at that point which is not asolution. Then how we will reach to the solution? We have to come across the followingthree states:

1. A “local maximum which is a state improved than all its neighbors, but is not better thanotherstates farther away. Local maxim sometimes appears within sight of a solution.In such cases theyare known as Foothills”.

2. A “plateau which is a flat area of the search space, in which adjacent states have thesimilarvalue. On a plateau, it is not probable to verify the best direction in which to moveby makinglocal comparisons”.

3. A “ridge which is an area in the search that is superior to the surrounding areas, but cannot belooked in a simple move”.

In order to overcome such problems, we can take the following steps:

We can back track to some previous nodes. We can try to find the solution from any otherdifferent direction. This way we are dealing the problem of“local maxim”.

We can create a big jump. This is done with the purpose of finding a new area in the search.Before testing, we can apply several rules. This is a goodmethod. This deals with the problem of“plate and ridges”.

For example: A search algorithm that tries to locate a route that diminishes the number ofconnectionsutilize the heuristic that the longer the span of the flight, the greater the probabilitythat it takes thetraveler nearer to the target. Thus, the number of connections is diminished. Thisis an example of hillclimbing in the language of Artificial Intelligence.So we can say that Hill climbing is like depth firstsearching where the most promising child is selected for generating successors. When the successorshave been generated, alternative choices are evaluated using some type of heuristic functions. Hillclimbing can generate substantial saving over uninformed searches algorithms when an informative,reliable function is available to guide the search to global goal. A“heuristic search” that estimates

Page 95 of 248

Page 101: Self Learning Material Artificial Intelligence

distance to the goal can be used to guide a hill climbing search. A “discrete DFS” guided by such aheuristic is called “greedy best first search”. This can be very efficient in route finding, hill climbing andcould be implemented by selecting the next city which is closest to the goal.

Check Your Progress/Self-Assessment Questions

Q6. Write the name of algorithm in which complete possible solutions are produced before test?

---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

Q7. What is Hill Climbing Approach?

---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

Q8. Which three states can occur in Hill Climbing?

--------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------

6.5. Best First Search

The general strategy of “heuristic search is best-first search (BeFS)”.This works as follows:

In these techniques we select a particular node. This is chosen for expansion. Which is based on

an evaluation function, “f (n)”?

We expand the node. It is done with the help of lowest “evaluation”. This will be best approach

for evaluation.

Algorithm uses a heuristic function. “H (n):h (n) = estimated cost of cheapest path from node n to

a goal node”.

“Best First Search” Algorithm

1. First of all we begin with “OPEN holding the initial state”.2. Here we try to choose the best node on “OPEN”.3. After that we produce its successors.4. For every successor, we take some steps of evaluating, finding new paths, changing parents of nodes,updating cost of nodes.5. Finally we check for a goal whichis finally located or not. If no more nodes left in “OPEN”, we quit.Otherwise we keep on performing above steps in order to find the solution.

Page 96 of 248

Page 102: Self Learning Material Artificial Intelligence

So, we can say that Depth first is a good strategy. Here in order to find a solution, we need not tocompute all nodes. Breadth first search is good. It does not get trapped in dead ends. Best first searchallows us to switch between paths. It takes the benefit of both approaches.

Best first search also uses a heuristic concept to selects most promising path to the goal node. Best firstsearch differs from uninformed algorithms only in the way the nodes are saved and ordered on the queue.This algorithm is similar to“steepest ascent”. In “Hill climbing” once a move is chosen and the othersrejected. The rejected ones will never reconsider in hill climbing. It saves time and cost. The “Best firstsearch algorithm” will involve a graph which avoids the problems of node duplication. The algorithm canbe explained as follows.

In the search tree, there is an initial node and node L with value 0 is goal node. Each node contains theheuristic information or node path value in search tree. We start from initial node S and follow thealgorithm as follows:

5 3

7 12 8

14 9

6 5

2 5

Step 1:

Put S (Starting node) in queue and examine node S. it is not a goal then remove it and expand child’s andput in queue.

Step 2:

Arrange all nodes in ascending order.

Step 3:

S

C B A

H FG

J

I

D

I

LM<

E

Page 97 of 248

Page 103: Self Learning Material Artificial Intelligence

The next node is a (3). The process continues until goal node not found.

Check Your Progress/Self-Assessment Questions

Q9. Best First search permits us to switch among paths. It takes the benefits of two approaches

------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------

Q10.Best first search differs from -----------------------------algorithms only in the way the nodes are saved

and ordered on the queue.

6.6.“Depth-Limited Search” TechniqueThe problem with “Depth first search” was that the search can go on infinitely. “Depth limited search”avoid this problem by imposing a depth limit. It effectively terminates the search at that depth.

As long as the depth factor, 1 is set “deep enough” there is every guarantee to find a solution, if it exists.Therefore, it is complete as long as” 1>=d”. “d” is considered as the depth of the solution. If thecondition is not met, then we can conclude that depth limited search is not complete.

Disadvantages

1. It’s hard to guess how deep the solution lies.2. If the estimated depth is too shallow, the search fails to find a solution and the computation time

is wasted.

Check Your Progress/Self-Assessment Questions

Q11.What is the disadvantages of Depth Limited Search?

---------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------

6.7.‘Iterative Deepening Search” TechniqueIn case of “Depth limited search” we have to decide on a suitable depth parameter. Lets take a look onthemap of Punjab. There are a lot of cities. We can observe from the following figure that to reach to anycity will take maximum path length of 16. Figure 6.1 shows the map of Punjab.

Page 98 of 248

Page 104: Self Learning Material Artificial Intelligence

Figure No.6.1 Map of Punjab

A closer examination states that any city is reachable in at most 8 steps. For this problem the depthparameter can be considered as 8. But, of course, this is not always an obvious idea. In order to choose aparameter is one reason why depth limited searches is avoided.

To overcome this problem there is another search .The search is named as “Iterative deepening search”. Ittries to find all possible depths whose limits starts with 0, then 1, then 2nd so on .This process repeatsuntil a solution is found. Iterative deepening begins a search with a depth bound of 1, and then increasesthe bound by 1. This process goes on until we find a solution. It may appear wasteful sometimes as weare expanding nodes many times in order to get the solution by making it complex. Here, the overhead issmall in comparison to the growth of an “exponential search tree”.

The following example presents an” Iterative deepening search of 26 nodes with an initial state of node aand a goal state of node L”.

Initial state

Goal state

B C D E F

I J K L MG H N PO

Q R S T U V W X ZY

A

Page 99 of 248

Page 105: Self Learning Material Artificial Intelligence

Step 1:

Step 2:

We again begin with initial state. The first iteration carries on from the 0th .That why all the nodes areexpanded by some value is already set to 1.

Step 3:

Node A is expanded, then removed from the queue, and the revealed nodes are added to the front

Step 4:

The search now moves to level one of the node set.

Size of Queue: 0 Queue; empty

Nodes expanded: 0 Current action Current level: N/A

A

Size of Queue: 1 Queue: A

Nodes expanded: 0 Current action Current level: 0

ASize of Queue: 1 Queue: A

Nodes expanded: 1 Current action Current level: 0

Size of Queue: 5 Queue: B, C, D, E, F

Nodes expanded: 2 Expanding Current level: 0

B C D E F

A

Page 100 of 248

Page 106: Self Learning Material Artificial Intelligence

Step 5:

We now backtrack to expand node C and the processes continues

Step 6:

The nodes C, D, E, and F are visited, but solution is not found.

Step 7:

Again, we expand node A to reveal the level one nodes, then the depth limited=2.

B C D E F

A

Size of Queue: 4 Queue: C, D, E, F

Nodes expanded: 3 Expanding Current level: 1

B C D E F

A

Size of Queue: 0 Queue: Empty

Nodes expanded: 6 Expanding Current level: 1

A

Size of Queue: 0 Queue: A

Page 101 of 248

Page 107: Self Learning Material Artificial Intelligence

Step 8:

Node A is removed from the queue and each revealed node is added to the front of the queue.

Advantages

1. Finds an optimal solution.2. Has the low storage requirement of depth first search.

Disadvantages

1. Computation time is wasted in re exploring the higher parts of the search tree, cost is notimpinging.

Check your Progress/Self-Assessment Questions

Q12.What is the advantages of Iterative Deepening Search?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Q13.What is the disadvantage of iterative deepening search?

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

6.8. The“A* Algorithm”

Nodes expanded: 7 Current action: Current level: 0

B C D E F

A

Size of Queue: 1 Queue: A

Nodes expanded: 1 Expanding Current level: 0

Page 102 of 248

Page 108: Self Learning Material Artificial Intelligence

Best first search is a simplified form of “A*”.This works as follows:

1. We start with “OPEN”which holds all the initial nodes.

2. After that we try to choose the “BEST node on OPEN such that f = g + h’ is minimal.”

3. Then we check a condition: “If BEST is goal node quit and returns the path from initial to BESTOtherwise

4. Eradicate BEST from OPEN and all of BEST’s children, labeling each with its path from initial node”.

A* Search

It gives us the benefit of reducing whole estimated cost in order to find a solution. We measures nodes by combining”g (n) – the cost to reach node n, and h (n) – the cost to

getfrom node n to the goal, thusf (n) = g (n) + h (n) = estimated cost of the cheapest solutionthrough n”.

“A*” is most constructive if”h (n) is an admissible heuristic – that is, h (n) never overrates thecost toreach the goal”.

Disadvantages of A*

The computation time is toolarge. All nodes are kept in memory. It has space problem. It is not practical for many large problems.

Eight puzzle Example:The heuristic of number of tiles out-of-position is definitely less than the definitenumber of moves to the goal state. So this heuristic (united with best-first search) is a permissiblealgorithm. So is the heuristic sum of the distances of out-of position tiles, since it too undervalues thedefinite number of moves needed to arrive at a goal state.

6.9.“Greedy Best-first Search” Technique

Here we develop node which is closest to the goal. We choose path with lowest “h (n)”. We evaluate nodes. It is done by using heuristic function: “f (n) = h (n)”.

6.10.“Constraint Satisfaction” ApproachMany troubles in AI can be regarded as problems of “constraint satisfaction”. We have to find goal statebut on the basis of some constraint.This can be solved by means of some searchapproaches. FigureNo.6.2 shows the example of problems which are solved using concept of “constraint satisfaction”.

Page 103 of 248

Page 109: Self Learning Material Artificial Intelligence

Figure No.6.2 “Constraint Satisfaction” Problem Example

Page 104 of 248

Page 110: Self Learning Material Artificial Intelligence

Figure No. 6.3 Initial states of Constraint Satisfaction Problem

Figure No. 6.4 Solution to Constraint Satisfaction Problem

Check your Progress/Self-Assessment Questions

14. Many troubles in AI can be regarded as problems of-------------------------------------where the

goalstate pleases a specified set of constraint.

15. Constraint satisfaction problems can be solved by means of any of the-----------------------------------

approaches.

6.11.Means-ends Analysis

During search process, we go forward or backward in direction in order to find the solution. If we choosean approachof mixing both directions will be suitable. This way we will be able to solve the major partsof problem first and after that we can solve the lesser problems. This is all possible when combine themtogether. This technique is known as “Means-ends Analysis”.

Here we have an early state and objective state, a set of operations with a set of preconditions. Thesepreconditions have their applications. These preconditions have difference functions which calculatethedifference among two states.

Page 105 of 248

Page 111: Self Learning Material Artificial Intelligence

“The means-ends analysis process centers about locating the difference amongcurrent state and goalstate”.

In order to solve a problem, we follow the steps:

We start with the current state. We try to find target state and we don calculations for this. Wecompute the difference between the current and target state.

We satisfy the preconditions. We try to reduce the difference. If present state is not goal state then in order to form a solved a

goal, means- ends analysis is applied recursively. If the sub goal is solved state, then work resumed on the original problem.

Means-ends analysis is functional approach. It is good for many human planning activities.

Check the Progress/Self-Assessment Questions

Q16. The----------------------------------process centers about locating the difference among current

stateand goal state.

6.12. Summary

This chapter focuses on various Heuristic search techniques. These methods are known as weakmethods.As they are susceptible to combinatorialexplosion. These techniques provide a specificframework. Here all the domain specific knowledge can be positioned in that particular framework. Thiscan be established with the help of learning concept. This process tries to locate good. It is not alwayspossible that we are going to get optimum solutions. It is quicker. It is easier to execute. It is better towork with this method than working with any recognized exact algorithm .Most of the times, heuristicsearch perk up the excellence of the path. By means of good heuristics we can expect to acquire goodsolutions to tough problems like the traveling salesman problem in less than exponential time. There are anumber of good common purpose heuristics that are valuable in a broad variety of problems. It is alsoprobable to create special purpose heuristics to resolve specific problems. “Generate-and-test”, “Hillclimbing”, “A* search Algorithm”, “Constraint satisfaction”, “Means-ends analysis” are discussed in thischapter.

6.13. Glossary

Best First Search: It is an amalgamation of “depth first and breadth first” searches.

Constraint Satisfaction: Target is found on the basis of specified set of constraint.

Generate and Test Algorithm: This algorithm is a depth first search practice. It works as to findcomplete possible solutions. These solutions are produced before test.

Page 106 of 248

Page 112: Self Learning Material Artificial Intelligence

Greedy Best-first Search (GBFS): Here we develop node which is closest to the goal.We choose pathwith lowest “h (n)”. We evaluate nodes. It is done by using heuristic function: “f (n) = h (n)”.

Heuristic Techniques: These are known as weak methods.They are susceptible to “combinatorialexplosion”.

6.14. Answers to check your Progress/Self-Assessment Questions

1. “Heuristic techniques” are known as weak methods.They are susceptible to “combinatorialexplosion”.

2. Heuristic techniques3. “Generate-and-test”, “Hill climbing”, “A* search Algorithm”, “Constraint satisfaction”, “Means-

ends analysis”.4. Generate and Test5. In the problem space6. Hill Climbing7. “Hill climbing” consists of a heuristicfunction. This function which offers an estimate. This

estimate is about howclose we are from a known state to goal state.8. local maximum, plateau, ridge9. Breadth First Search, Depth First Search10. Uninformed11. It’s hard to guess how deep the solution lies. If the estimated depth is too shallow, the search fails

to find a solution and the computation time is wasted.12. Finds an optimal solution. Has the low storage requirement of depth first search.13. Computation time is wasted in re exploring the higher parts of the search tree, cost is not

impinging.14. Constraint Satisfaction.15. Means of Search Approaches.16. Mean End Analysis.

6.15. Model Questions

1. What are Heuristic techniques? Illustrate why the Heuristic techniques are considered asweak methods.

2. Enlighten various properties of heuristic process.

3. Explain the steps used in Generate and Test technique.

4. Depict the working of Hill Climbing technique.

5. “Best First Search is an amalgamation of depth first and breadth first searches”. Comment.

6. Make distinction between A* Algorithm and Greedy Best-first Search (GBFS) algorithm.

7. Illustrate the process of solving constraint satisfaction problems.

Page 107 of 248

Page 113: Self Learning Material Artificial Intelligence

8. Explain the functioning of Means-ends Analysis technique with examples.

9. Discuss the steps used in solving Means-ends Analysis problem.

10. Explain the advantages and disadvantage of A* algorithm.

LESSON 7 : Game Playing

Structure of the Lesson

7.0. Objective

7.1. Introduction to Game Playing

7.2. History of Game Playing

7.2.1. Chess

7.3. Game Playing in Artificial Intelligence

7.4. MiniMax Search Algorithm

7.5. Alpha Beta Cutoffs

7.6. Planning in Game Playing

7.7. Non Linear Planning

7.8. Hierarchical Planning

7.9. Summary

7.10. Glossary

7.11. Answers to check your progress / self-assessment questions

7.12. Model Questions

7.0. Objective

After studying this chapter, the student will be able to:

Explain the concept of game playing Describe History of Game Playing Explain MiniMax Algorithm Describe Alpha Beta Cutoffs Explain the concept of Planning for Game Playing

7.1. Introduction to Game Playing

Page 108 of 248

Page 114: Self Learning Material Artificial Intelligence

The search problems we have perused so far lead us to a particular conclusion. It states that a hardsituation is not going to change. Let say, I am searching for a route between two cities. The cities do notmove during the search. Game playing has a different case.Let say, I am playing Chess game and therecan be several moves during the play. Both the parties will provide their best to win the game. If onemake a move during playing the game, then second person will obviously going to move next. Onecannot be certain what the actual board position will be after the move. Your opponent will try his best towin the game. The scientists and the mathematicians are trying to simulate “classical games” to developexpert artificial players. “Chess”has been one of the most popular and interesting game from manydecades .Research isfocusing on the creation of “grandmaster standard computer programmers”. Gamesare good ways to search because they are well formalized, self-controlled, and small in play. Easilyprogrammed games can be good models of competitive situations which can be applicable to practicalproblems. The game playing concept of computer science and engineering has been found, analyzed,learned and studied for many years by researches and scientists of artificial intelligence. Game playing isstructured task which is an interested area of researchers. Most of the work was focused on the creationof games having useful and perfect knowledge to perform tasks.Such as“tic-tae-toe”, “chess” etc.Basically, it was considered that the machine would play a successful game by cleverly analyzing andunderstanding and then taking decisions among different strategies from database.

7.2. History of “Game Playing”

“Game playing” has a long history within artificial intelligence research. Chess has been the “holy grail”of game playing programs. It has propounded particular interest in“Deep blue beating Kasparov in 1997,albeit with specialized hardware and brute force search, rather than artificial intelligence techniques”.Since 1950, chess game was one of the areas of interest to computer scientist’s researchers.

7.2. 1. Chess

On 9 march 1949s,Claude Shannon, presented a research paper in New York. He presented about the“Size of the search space”. How deep the machine would have to search to find the next best movement.

“Working at 200 million positions per second, deep blue would require so many years to evaluate allpossible games. To elaborate it in some sort of broader area, the universe is only about 10*10 years oldand 10*120 is higher than the number of atoms is the universe”.

Next, “Shannon found that identifying to a depth of forty at a rate of one game per mms would take amachine 10*90 years to make its possible first move.”

In 1957, “Herbert Simon” claimed that “Deep blue” would beat a human at chess within 10 years.

“Simon” stated that “he was a little too farsighted with chess, but there was no way to do it withcomputers that were as slow as the ones back then. During 1958, the first computer was able to performtask of playing the game named chess was an IBM 704 with about one millionth deep blue capacities.”

In 1967,“Mac Hack” which was the name of the program was started raced successfully in humantournaments. In 1983, Belle which was the name of the program was found and got “Expert status” fromthe researchers of the “United States Chess Federation”.

Page 109 of 248

Page 115: Self Learning Material Artificial Intelligence

In mid-1980s, at “Carnegie Mellon University” scientists and researchers had started the work that was tobecome the “Deep Blue project. They used a Sun work station that could examine 50,000 positions persecond. The project moved to IBM in 1989.”

Chess still getsa great interest in scientists as a topic of research and turn to “Learning Techniques” thatpermits a machine to learn, understand and give power to play chess, rather than being told thosemachines how it play. “Kendall and Whitwell” presented a learning technique that permits the machine tolearn how to understandplay chess rather than being programmed with a strategy.

During 1952, “Arthur Samuel” developed a“First checkers program”. The original program was basicallydeveloped for an “IBM 701” computer. In 1954, the set of instructions were reformulatedfor an “IBM704” and added a feature of a “Learning mechanism”. What makes this program a great success to standout in artificial intelligence history as it was that program which was “Able to learn its own evaluationstrategy. Taking into account the IBM 704 had only 10,000 words of main memory, magnetic tapestorage and a cycle time of processes of minimum one-millisecond, it was a big achievement in thehistory of artificial intelligence for growth.”

“Samuel” made the program play in completion to it. “Within few days play, the program was able tobeat its developer and do competition on equal terms with strong human opponents.”

“Jonathan Schaeffer’s inventions”provide to the development of “Chinook”. During 1992,“Chinook wonthe US Open and subsequently challenged for the world championship. For over 40 years, Dr. MarionTinsley had been the world champion. During that time, he hadlost only three games.In August 1994, Dr.Tinsley had to withdraw for health reasons asthere was a re-match but the match ended prematurely”.Chinook was the official world champion.

Despite, the world champion, the search has continued for a checkers player that is developed using pureartificial intelligence. “Chellapilla and Fogel have founded Anaconda which is the name of the gameplaying, due to the strangle hold it places on its opponent. It is also called Blondie 24, when playing onthe internet, this name was selected due to a successful attempt to try and attract players on theperceptions that they were playing against a 24 year old female blonde”.

“Anaconda or Blondie 24” uses the technique of “Artificial neural network having 5000 weights, whichare evolved by an evolutionary strategy. The inputs to the artificial neural network are the initial boardposition and its output a value which is used in a mini-max search. During the training period of theprogram is provided zero information other than whether it won or lost. Anaconda is particularly notgiven any strategy and contains no database of starting and finishing game positions. Co-evolutions areused to develop anaconda, by playing games against it.”

“Poker” has also long popular research history with “Von Neumann and Morgensten findings with asimple, two-player, extension of poker in their seminal work on economics. They identified thataccomplished poker players regularly do bluffing during their game, which was needed to be developedfor in any automated poker player game”.

Page 110 of 248

Page 116: Self Learning Material Artificial Intelligence

Over a 20 year period, Findler kept on working on automated poker. He also did work on a simplying agame, based on “5-card draw poker” with no assumptions of betting positioning due to the machinealways playing last. He founded that “dynamic and adaptive algorithms” are needed for successful gameplaying and static mathematical models were not appreciated and easily beaten.

Luigi barone and Lyndon White did research into the “Automation of Poker”. They found that there aredifferent types of poker players:

Loose passive, Loose Aggressive, Tight Passive, Tight Aggressive players.

In their research work, they suggest using evolutionary strategies as a way of simulating an adaptivepoker player. They use a simple poker variant where each player has two private cards, access to fivecommunity cards and there is only one of betting. Their starting work incorporates three main areasof analysis”;

“Hand Capability” “Betting the Position” “Management of Uncertainty”

The work gives the idea that“How a player that has targeted new approaches can adapt its style to twotypes of table. In BAR99 they develop their 1998 work by presenting a hypercube which is n dimensionalvector, used to store candidate solutions. The hypercube has one dimension for the betting positioningand second dimension for the risk management”. At every step of game playing, the appropriatecandidatesolutions are taken from the hypercube and the decision is fetched whether to fold, call or rise.

Check your progress/ Self assessment questions

Q1. Who wrote the first checker’s Program?

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q2. What are the four types of poker players?

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

7.3. Game Playing in Artificial Intelligence

At the initial point, before training of the program, it does not know anything about the domain or thegame.It does not know the rules, limitations, objectives of the play and not even it has any understandingabout the influence on the game, the consequences of its various actions and it cannot see the objects inthe play. By trial and error method, it learns how it should behave to get a reward. It should be noted thatthe machine uses the same architecture for all distinguish plays without any game-specific knowledge orhints from the developers.

Page 111 of 248

Page 117: Self Learning Material Artificial Intelligence

Figure No.7.1 Game Playing Environment in AI.

The “Game Playing” concept of computer science and engineering has been learned and studied formany years by researches of artificial intelligence. Game playing is structured task which is an interestedarea of workers. Most work is focused upon the games of perfect information.Figure 7.2 shows that gamesystem of artificial intelligence makes it independent with three distributed independent systems.

Page 112 of 248

Page 118: Self Learning Material Artificial Intelligence

Figure No.7.2 Game System of Artificial Intelligence

So, we can say that distributed artificial intelligence is composed of three independent systems.

Meta AI

Navigation AI

Character AI

Page 113 of 248

Page 119: Self Learning Material Artificial Intelligence

Figure No.7.3 Working of Game System in Artificial Intelligence.

Check your progress/ Self assessment questions

Q3. Name independent components of distributed artificial intelligence system.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

7.4. MiniMax Algorithm

In 1994, “John Von Neumann” co-authored a book which delineated a search algorithm called“Minimax”. “Minimax algorithm” searches game tree. In this algorithm, we maximize our play and try tominimize the play of the opponent. Minimax works on a principle: “It uses a utility function whosevalues are good for player A when they are big and whose values are good for far player B when thevalues are small. The first playeragoal is to select a move that maximizes the utility function and thesecond player B goal is to select a move that minimizes the utility function”. A utility function is a wayof measuring how good your placement in the game is.

Page 114 of 248

Page 120: Self Learning Material Artificial Intelligence

The “minimax algorithm” is applied n two player games like “tic-tac-toe”, “checkers”, “chess”, “go” etc.All of the games have at least one thing in common: They are logic games. Itmeans that they areexplained by a set of rules. Using them, we can know form a given point in the gameplaying. What arethe next possible available moves in the game? So, consists of full information games. Before explainingthe algorithm, we discussed about search tree, which is a way to represent “Searches”. Here in theexplanation: “The squares are known as nodes and they represent points of decision in the search. Thenodes are connected with branches. The search starts at the root node, nodes for the available searchpaths are generated until no more decisions are possible. The nodes that referthe end of the search arecalledleaf nodes which are shown in figure by search trees”.

MAX

MIN

5

3 4 5

3 10 4 5 6 7

The “minimax algorithm” is applied n two player games like “tic-tac-toe”, “checkers”, “chess”, “go” etc.All of the games have at least one thing in common: They are logic games. Itmeans that they areexplained by a set of rules. Using them, we can know form a given point in the gameplaying. What arethe next possible available moves in the game? So, consists of full information games. Before explainingthe algorithm, we discussed about search tree, which is a way to represent “Searches”. Here in theexplanation: “The squares are known as nodes and they represent points of decision in the search. Thenodes are connected with branches. The search starts at the root node, nodes for the available searchpaths are generated until no more decisions are possible. The nodes that referthe end of the search arecalledleaf nodes which are shown in figure by search trees”.

MAX

MIN

5

3 4 5

3 10 4 5 6 7

The “minimax algorithm” is applied n two player games like “tic-tac-toe”, “checkers”, “chess”, “go” etc.All of the games have at least one thing in common: They are logic games. Itmeans that they areexplained by a set of rules. Using them, we can know form a given point in the gameplaying. What arethe next possible available moves in the game? So, consists of full information games. Before explainingthe algorithm, we discussed about search tree, which is a way to represent “Searches”. Here in theexplanation: “The squares are known as nodes and they represent points of decision in the search. Thenodes are connected with branches. The search starts at the root node, nodes for the available searchpaths are generated until no more decisions are possible. The nodes that referthe end of the search arecalledleaf nodes which are shown in figure by search trees”.

MAX

MIN

5

3 4 5

3 10 4 5 6 7

Page 115 of 248

Page 121: Self Learning Material Artificial Intelligence

Figure No. 7.4. MiniMax Problem

There are two players involved, “MAX” and “MIN”. A search tree is generated “Depth first search”. Itstarts the process with the initial game position up to the last game position. Thefinal game position ischecked from maximum point of view. The values of inner nodes are filled bottom-up with the checkedvalues. The nodes that belong to the “Maximum player”will receive the “Maximum value” of itschildren. The nodes for the “Minimum player” will get the “Minimum values” of its children.

Check your progress/ Self assessment questions

Q4. What is the logic of minimize algorithm concept?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Another example of MiniMax Problem is:

Page 116 of 248

Page 122: Self Learning Material Artificial Intelligence

Figure No.7.5 Solution of Problem using MiniMax Algorithm.

7.5. Alpha Beta Cutoffs

The situation in mimimax is: “we expand every node down to certain depth even though in certain caseswe are wasting our time”. To overcome the problem we can use a procedure known as alpha-betapruning. Alpha-beta pruning was probably developed by John McCarthy. This pruning uses a “Depthfirst search”, so it maintains two types of variables. Let say these two variables are “A and B”, where “A”is associated with “MAX” which can never decrease.“B” is associated with “MIN” which can neverincrease. Figure 7.6 shows the example of alpha beta cut offs.

Page 117 of 248

Page 123: Self Learning Material Artificial Intelligence

Figure No.7.6 Alpha Beta Cutoffs

7.6. Planning in Game Playing

In order to solve to problem, play a game or in a process which is restricted to two persons table or boardgame and we require the rule of the game. The number of rules that must be minimized and set can beproduced by expressing each rule. In general forms as possible, so well problems can be described as aset of rules.We must have to recompute the entire problem domain when we move from initial state tonext state. The word planning refers to the process of computing several process steps of a problemsolving procedure before executing any of domains. Each and every aspect of the real words isfullypredictable; and we must always be careful to have a plan to fail. Thus, if we design the plan by dividingany problem in as many sub problems, not the whole problem. “Planning” in AI is the problem of findingthe sequence of primitive actions to achieve some goal. Planning requires the following:

Representation of the goal to achieve Knowledge about what action can be performed Knowledge about state of world

We can use system that is finding a sequence of the primitive action to achieve targets that is called“planner system”. First planner developed was in 1972 by Hewitt .This was one of the first design for allprogramming languages based on the idea of an extends theorem proven.

Finally, we can state that a plan generates a set of action that can transform an initial state of the world togoal a state.

A planner is a planning system that modeled the state of some universe of discourse in term of anassociative database containing both assertion and theorem which function as procedures. A planningsystem performs the following function:-

Select best rule

Page 118 of 248

Page 124: Self Learning Material Artificial Intelligence

Apply to compute Identify the solution Identify the dead ends

The first function of planning system is to select the best rule from the database of system. If several rulesare collected, then we have the benefit of choosing from other heuristic information .For this process, wecan mean and search algorithm. The second function,selected rule apply to compute the new problemstate arises from its application. The selected rule one or morethanone, no problem.Inference processaccepts all this rules and produces the result. Once the interface process produces the result, then the thirdfunction is to start identification of the best state or final solution to produce the final plan.When the nosolution is found, there is the dead end. Here comes the fourth and final function of the planning systemto identify these basic ideas to handle interactive compound goals and use goal stack .The policy used by“STRIPS” is “Goal stack planning”.In “Goal stack planning” the problem solver makes use of a “goalstack”. It contains both sub goals and the actions have been processed to satisfy those sub goals and thedatabase of logical functionality which explains the current situation .The algorithm of goal stackplanning is summarized as below:

ALGORITHM :

1. First of all, replace the top of sub goal of “GOAL STACK”. This can be done by using anappropriate action.It will add its precondition the top of “GOAL STACK”.

2. As long as the top element of “GOAL STACK” is a sub goal, it has a situation. It cannot beproved from the formulas in database.

Next condition is that if the top element of sub goals, it can prove from formulas in database, pop“GOAL STACK”.

Now, if the element is “GOAL STACK” an action, pop it from “GOAL STACK”. Now we haveto apply it to database .Finally, append at the end of plan.

3. If“GOAL STACK =0”, we will need to check a condition. We have to check if the formulas inthe stock describing the goal configuration can be proved from database. Add to the Global stackformulas which could not prove from database.

How this method works? We take simple example of block word problem. Theaction is defined asoperator these operators are defining by STRIPS. So they are called STRIPS- style operator for the blockword operation and are simple rule such as these PRECONDITION list which isoften identical with thedelete list. This is the describe below:

The “Stack Action” occurs when the robot arm places the object “X”. It is holding on the top of theobject “Y”.

“Stack (X, Y):Pre: clear (Y) holding (X)

Del: clear(Y) holding (X)Add: clear (Y) empty (X, Y)”

Page 119 of 248

Page 125: Self Learning Material Artificial Intelligence

The “Unstack Action” is on the other side when the other robot arm picks an object “X” up from the topof the object “Y”.

“Unstack (X, Y):Pre: on (X, Y) clear (X) arm empty

Del: on (X, Y) arm emptyAdd: holding (X) clear(Y)”

Both are inverse of one another.

The “Pickup Action” occurs when the arm picks up an object x from the table.

“Pickup(X):Pre: clear (X) on table (X) arm empty

Del: on table (X) arm emptyAdd: holding (X)”

The put down action occurs when the arm place the object into the table.

“Putdown(X):Pre: holding (X)Del: holding(X)Add: on the table x arm empty”

In the above action the main three lists are described. The first is pre list is a precondition to be true. Thesecond list is the delete list of preposition that will become false,and third list is proposition list that willbecome true, this is called the add list.

Check your progress/ Self assessment questions

Q5. What are the functions of the Planning System?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

7.7. Non –Linear Planning

In “Non Linear planning”, there is least commitment. It is the case respect to time. If the resulting plan is“Nonlinear”, “Linearization” for a one agent and execution by many agents can be used. Orderingdecision isonline made when necessary. Partial plans are partial on operator. They are left unordered untilduring a certain condition. A “Nonlinear Planner” that use constraint posting as its approach to problemsolving. It is capable any nonlinear planning problem. The planning algorithm consists of repeatedlychoosing agoal. After then, it makes a plan to achieve it.It uses a model criterion to do this.The criterionshows that the process would be the entirely favorable all the way. The process chose one of them. Itmodifies the planaccordingly. If a set of constraints isinconsistent, “TWEAKBACKTRACKS”. Thenumber of the compilation of planis exponential in itssize. Here it is concluded thatcomputing if

Page 120 of 248

Page 126: Self Learning Material Artificial Intelligence

something is possible that will be extremely expensive. “TWEAK” is has been an incomplete plan whileworking on a problem.It could be solved in many ways. It shows a class of complete solution. A plan istotal order on some finite set of steps.

Sacerdotis ideas was developed byChapmanin 1987 and developed onthe basicNOAH planner to create aTWEAK Chapman provide the formal theory that Sacerdotis had talk about.Chapmen proved thatTWEAK was sound and complete TWEAK was the basic for the SNLP and pop algorithms.There aretwo kinds of Constraints in non linear planning.

Temporal Constraints Co-designation Constraints

Action of TWEAK

“TWEAK” is a formulation of actions which arelimited. It does not permit indirect side effects. Thisrequires a truth criterion to win the game. “Linear Planner” can be more powerful representation .Anotherlimitation is that postcondition; explicitly represented the main actions of TWEAK are as follows:

“Step Addition”:It creates a new step in a plan. “Promotion”: It will post a constraint that a “clobb” ever come after this situation it “clobbers”. “Demotion”: It presents the state which is opposite of promotion. “Declobbering”: It states that we want to place a step between two old steps. The reason behind is

that new step reasserts some precondition that have been clobbered. “Simple establishment”: It ensures the precondition of step. “Separation”:It prevents the assignment of certain value to a variable.

7.8. Hierarchical Planning

“Hierarchical planning” is the planning that can usea hierarchical of abstraction of a plan to solve theproblem. The ground plan is the from that lists executable operation. It level is above the increase inabstraction and simplicity. A hierarchical plan is describeshow totake an action in level of increasingrefinement and simplicity. The term: “Do something” will become more specific if I say: “Go to work”.Most plans are planned as hierarchical in nature.

The goal of “Hierarchical Planners” is to modifying the search. It is done in a simple manner andreasoning process by finding vague solutionat levels. The details are computationally overwhelming andrefined by them. There are two ways to form hierarchies, “Plan abstraction” and “Space Abstraction”.One states the higher level concepts as operators and second states the equivalence classes of states byignoring less critical precondition and sub goals.

Hierarchical planner creates vague plans and details incrementally. It is done until a fully specified planconstructed. The earliest hierarchical planner was “GPS; it was planned on an abstraction space in whichall logical connectives were represented by single symbol”. Example: suppose Iwant to go to “Amritsar”.

Page 121 of 248

Page 127: Self Learning Material Artificial Intelligence

I will not begin my plan by worrying about how to get the airport. One of the main important tasks is thatI have to find a flight to “Amritsar”. This is the most important thing to consider first.

Check your progress/ Self assessment questions

Q6. What is Hierarchical Planning?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

7.9. Summary

In this chapter, the concept of game playing in artificial intelligence is discussed. “Game playing” has along history within artificial intelligence research.Several search problems we have perused so far lead usto conclusion that the situation is not going to change.In order to solve to problem play a game or in aprocess which is restricted to two person table or board game and we require the rule of the game. Thenumber of rule that is must be minimized and set can be produced by expressing each rule. In Minimaxalgorithm,“Maximize” our play and try to “Minimize” the play of the enemy in this way, the concept ofplaying is cleared using this algorithm. Similarly, in the method of“Alpha beta cutoffs”,uses a depth firstsearch. This broader topic has the base of classical games and their theories. One needs to clear theirfundamental concepts in the classical games. One of the thing that is to be noticed; there is need ofplanning in order to do game playing in artificial intelligence.

7.10. Glossary

Game Playing-Game playing is structured task to focuses on games of perfect information.

MiniMax Algorithm– Minimax algorithm we try to maximize our points in the play. Our target is to tryto minimize the play of the enemy.

Planning– Planningrefers to the process of computing several process steps of a problem solvingprocedure before executing any of domains.

Non-Linear Planning- There is least commitment with the respect to time.

Hierarchical planning- The planning that can uses oh hierarchical of abstraction of a plan to solve theproblem.

7.11. Answers to check your progress / self assessment questions

1. Arthur Samuel, in 1952, wrote the first checkers program.

2. “Loose passive”, “Loose Aggressive”, “Tight Passive”, “Tight Aggressive players”.

3. Meta AI, Navigation AI, Character AI.

Page 122 of 248

Page 128: Self Learning Material Artificial Intelligence

4. In Minimax algorithm, “we maximize our play and try to minimize the play of the opponent.

Minimax uses a utility function whose values are good for player A when they are big and whose

values are good for far player B when the values are small. The first playeragoal is to select a

move that maximizes the utility function and the second player B goal is to select a move that

minimizes the utility function”. A utility function is a way of measuring how good your

placement in the game is.

5. Functions of Planning System are:

Select best rule

Apply to compute

Identify the solution

Identify the dead ends

6. Hierarchical planning is the planning that can use oh hierarchical of abstraction of a plan to solve

the problem.

7.12. Model Questions

1. Elaborate the concept of Game Playing.2. Explain the history of Game Playing.3. Explain Minimax Algorithm.4. Discuss MiniMax Algorithm with example.5. Explain the concept of Alpha beta cutoffs.6. What is planning? How it is done in Game playing?7. What are the functions of Planning?8. Explain the types of planning in artificial intelligence to take important decisions.

Page 123 of 248

Page 129: Self Learning Material Artificial Intelligence

LESSON 8: Knowledge Representation

Structure of the chapter

8.0. Objectives.

8.1. Concept of Knowledge in Artificial Intelligence.

8.2. Terminology used in Knowledge Based Systems.

8.3. Knowledge Representation in Artificial Intelligence.

8.3.1 Knowledge representation techniques

8.3.2 Automated reasoning engines

8.3.3 Automated reasoning engines

8.4. Importance of Knowledge in Artificial Intelligence.

8.5. Types of Knowledge.

8.6. Acquisition and Organization of Knowledge.

8.7. Characteristics/ Issues related with Knowledge Representation.

8.8. Back ward and Forward Reasoning.

8.9. Difference between Back ward and Forward Reasoning.

8.10. Summary of the chapter.

8.11. Glossary

8.12. Answers to check your progress / self-assessment questions

8.13. Model Questions

8.0. ObjectiveThe student will be able to explain the following concepts:

The importance of concept of knowledge in AI. The different kinds of knowledge. The acquisition and organization of knowledge in AI. The Characteristics/ Issues regarding Knowledge Representation. The Back ward and Forward Chaining. Comparison of the Forward and Backward Chaining.

8.1 Concept of Knowledge in Artificial Intelligence

Page 124 of 248

Page 130: Self Learning Material Artificial Intelligence

“Knowledge is the refined form of information which is used to solve specific problems.”

Knowledge provides power. Power to inform, power to decide and power to control. A knowledge basedsystem must have access to this power. An artificial intelligence system is capable ofelucidating andrepresenting knowledge along with storing and manipulating data.

Knowledge could be a collection of facts and principles build up by human.Figure no.1 shows the fullstructure of knowledge representation.

Figure No.8.1. Categories of Knowledge Representation in AI

8.2 Terminology used in Knowledge Base Systems:

1. Knowledge Based Systems:

The Artificial Intelligence programs that achieve expert- level intelligence for solving problems inspecific task areas aretermed as knowledge based systems. Knowledge based systems and ExpertSystemsrefer same kind of intelligent systems. The two terms knowledge base and Expert Systems areused synonymously.

Page 125 of 248

Page 131: Self Learning Material Artificial Intelligence

Figure No.8.2. Knowledge Based Systems

2. Task

Task means a goal-oriented, problem solving process or activity. Diagnosis, planning, scheduling,configuration and design some particular kinds of tasks discussed under expert systems.

3. Task Domain

The area of human intelligence about a particular problem is called task domain.

4. Knowledge Engineering

It is the process of fabricating or developing an“expert system”.

Page 126 of 248

Page 132: Self Learning Material Artificial Intelligence

Figure No.8.3 Knowledge Engineering

5. Knowledge Engineer

The practitioner who builds knowledge base is known as knowledge engineer. The knowledgeengineers must sure that the computer system has all the capabilities to solve a complex and particularproblem.

8.3 Knowledge Representation in AI

The objective of Knowledge representation is to represent knowledge in a manner that facilitates thepower to draw conclusions from knowledge.

Figure No.8.4 Concept of Knowledge Representation with Example

Here example of knowledge representation is explained with the help of animals. This fieldof artificial intelligence (AI) represents information about the real world that a computer system canuseit to solve complex tasks such as diagnosing a medical condition or having an interaction ina natural language. Knowledge representation deals withmethods about how humans solve problemsand represent knowledge in order to design procedures that will make complex systems easier todesign and build.

Knowledge-representation focuses on designing computer representations that capture informationabout the world that can be used to solve difficult and complex problems. Knowledge representationis used because conventional procedural code is not the best way to use to solve complex problems.

Page 127 of 248

Page 133: Self Learning Material Artificial Intelligence

Knowledge representation makes complex software easier to define and maintain than proceduralcode and can be used in expert systems.

8.3.1 Knowledge representation techniques

The various knowledge representation techniques are:

1. Semantic nets

2. Systems architecture

3. Frames

4. Rules

5. Ontology.

8.3.2 Automated reasoning engines

“Inference engines”, “Theorem Proves”, and “Classifiers”are examples of automated reasoning engines.

Check your progress/ Self assessment questions

Q1. Define Knowledge?

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q2. Who are Knowledge Engineers?

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q3. Define task and task domain.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

8.3.3 Types of Knowledge Representation in Artificial Intelligence:

There are 5 main types of knowledge representation in Artificial Intelligence.

1. “Meta” Knowledge – It is “Knowledge about knowledge”.2. “Heuristic” Knowledge - It represents knowledge of some expert in a field or subject.3. “Procedural” Knowledge –It gives information about how to achieve something.4. “Declarative” Knowledge - It’s about statements that describe a particular object. That object maycontain several attributes, including some behavior in relation with it.5. Structural Knowledge - It describes what relationship exists between objects.

Page 128 of 248

Page 134: Self Learning Material Artificial Intelligence

8.4. Importance and Manipulation of Knowledge in AI

AI has given new meaning and importance to knowledge. Now, it is possible to “bundled” specializedknowledge and sells it with a system that can use it to reason and draw conclusions. It is like reliableadvisor that gives high level professional advice in specialized areas, such as manufacturingtechniques, sound financial strategies, ways to improve one’s health, top marketing g sectors andstrategies, optimal framing plans,, and many more other important matters.

The Japanese recognized the potential uses of these kindsof knowledge systems and use them into thedevelopment of modern kind of ultra fast computers and other computing devices.

Knowledge representation system provides an economic advantage to the world.

Representation Scheme:

Agent use knowledge in the form of representationscheme. A representation scheme is used to specify thenature of the knowledge. A “Knowledge Base” is the representation of all of the knowledge that is storedby an agent. There could be several representation schemes.A good representation scheme is a consideredbest from number of techniques to attain targets.A representation should be capable of doing thefollowing tasks.

1. It should be able to express the knowledge needed to solve the problem.2. It should be as close to the problem as possible. It should be compact and maintainable.3. It should be easy to see the relationship between the representation and the domain.4. It should be able to acquire knowledge from people, data and past experiences.

Several different representation schemes have been designed like followings:

Figure No. 8.5 Representation Example

Check your progress/ Self assessment questions

Page 129 of 248

Page 135: Self Learning Material Artificial Intelligence

Q.4. What do you mean by Declarative Knowledge?

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q.5. Define Representation Scheme.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

8.5Types of Knowledge:

Knowledge can be classified into two categories:

1. Declarative Knowledge: It is passive in nature and is represents knowledge about a particular object.2. Procedural Knowledge: Procedural knowledge is used to solve a problem with the help of predefinedsteps or methods. For example: the steps used to solve acalculus problem.

8.6. Acquisition and Organization of Knowledge in Artificial Intelligence

“Knowledge Acquisition” is the process of acquiring and gathering information about a particular domainof problem from various sources. These sources could books, journals, and magazines, past experiences.I

Figure No.8.6. Knowledge Acquisition Facility

Page 130 of 248

Page 136: Self Learning Material Artificial Intelligence

The term knowledge acquisition is closely related to expert systems. Knowledge acquisition forms anintegral part of expert- based systems. After knowledge acquisition, knowledge is organized andpresented in the form of conditional rules and rules and facets. Sometimes the concept of scripts is alsoused to represent stereotype situations.

Knowledge Engineer

The knowledge engineer is someone who is capable of designing, building and testing an expert system.The knowledge engineer’s main task is:

Interviews the domain expert to find out how a particular problem is solved. Establishes what reasoning method the expert uses to handle facts and rules and decided how to

represent them is the expert system. Chooses some development software or an expert system shell, or look at programming languages

for encoding the knowledge. Responsible for testing, revising and integrating the expert system into the workplace.

Programmer

The programmer is the person responsible for the actual programming describing the domain knowledgein terms that a computer can understand. The programmer needs to have skills in symbolic programmingin such Al languages as LISP, Prolog and OPSS and also some experience in the application of differenttypes of expert system shells. In addition, the programmer should know conventional programminglanguages like java, C, Pascal FORTRAN and Basic.

Project Manager

The project manager is the leader of the expert system development team, responsible for keepingthe project on track. The project manager makes sure that all deliverable and milestones are met, interactswith the expert, knowledge engineer, programmer and end-user.

End-User

The end-user, often called just the user, is a person who uses the expert system when it is developed.The user must not only be confident in the expert system performance but also feel comfortable using it.Therefore, the design of the user interface of the expert system is also vital for the project’s success; theend user’s contribution here can be crucial.

Knowledge- Based Expert Systems

In the early seventies, Newell and Simon form Carnegie-Mellon University proposed a productionsystem model, the foundation of the modern rule-based expert system. The production model is based onthe idea that human solve problems by applying their knowledge (expressed as production rules) to agiven problem represented by problem.

Page 131 of 248

Page 137: Self Learning Material Artificial Intelligence

Knowledge Organization in AI

In Artificial intelligence, knowledge ids organized though frames and slots.

Check your progress/ Self assessment questions

Q.6. Define Knowledge Acquisition?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q.7. what is a Frame?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

8.7. Characteristics of Knowledge/ Issues regarding Knowledge representationIn 1985, “Ron Brahman” categorized the core issues for knowledge representation as follows:

1. “Rudimentary/ Primitives”: Semantic networks and other data structures are used to representknowledge in Artificial Intelligence systems primarily. Both were the first knowledgerepresentation primitives. So, there is a strong relationship of data structures and algorithms withAI in computer science. Frames and Rules are important primitives in representing knowledge.Frame languages had various methods for expressing and enforcing constraints on frame data.Frames are further divided into slots and all data in frames are stored in slots. First OrderLogic (FOL) is another technique to represent knowledge in AI.

2. Meta-Representation: The word Meta means”beyond”. Meta – representation means storing andelucidating Information about data stored in a knowledge base, i.e. it represents data about data.Meta-representation means the knowledge representation language is itself expressed in thatlanguage.

3. Definitions and Universals vs. facts and defaults: They are general statements about the worldsuch as "The sun rises in the east".

4. Reasoning: Reasoning here stands for heterogeneous reasoning. The knowledge representationbinds facts with assertions and rules and justify them with proper logic i.e. either by predicatelogic or prepositional logic.

5. Incompleteness: Incompleteness is another important issue which is often faced wheninformation is represented in knowledge base

8.8. Forward and Backward Reasoning

Forward Chaining:It is one of the two main methods of reasoning used in an inference engine. It is avery common approach for “expert systems”, business and production rule systems.

Page 132 of 248

Page 138: Self Learning Material Artificial Intelligence

Figure No. 8.7 Forward Chaining in AI

Forward chaining starts with the available data. This is an initial data and uses inference rules. It helps inextracting more data until a goal is reached. An inference engine using forward chaining searches theinference rules until it finds one. Here the antecedent is known to be true. Whenever such a rule is found,the engine can concluderesults.

For example: “A doctor usually begins to diagnose a patient by asking him about the symptoms he or shesuffers from, such as high blood pressure, temperature, headache, sore throat, coughing…etc. Then thedoctor uses this information to draw a reasonable conclusion or to establish a hypothesis to explorefurther. This way of reasoning is called in an expert system, is called forward-chaining”.

An inference engine using forward chaining searches the inference rules until it finds solution. Herethe“IF” clause is known to be true. When found it can conclude. It mayinfer the “THEN” clause. It willresult in the addition of new information to the dataset. It means that it starts with some facts and appliesrules to find all possible conclusions. Therefore, it is also known as“Data Driven Approach”.

Definition of a forward chaining system follows the following sequence of operations:

1. “Examine the rules to find one who’s IF part is satisfied by the current contents of WorkingMemory”.

2. “Fire the rule by adding to Working Memory the facts that are specified in the rules Then part.

Page 133 of 248

Page 139: Self Learning Material Artificial Intelligence

(The Then part may perform other actions as well, but that can be ignored for now.)This control cycle continues until no rules have satisfied If parts”.

Flowchart of ForwardChaining:

Figure No. 8.8. Flowchart of ForwardChaining

Backward Chaining:An inference engine using “Backward Chaining” would search the inference rulesuntil it finds one which has a “THEN clause” that matches a desired goal. If the “IF clause” of thatinference rule is not known to be true. At the very next step, it will add to the list of goals. In other words,this approach starts with the desired conclusion and works backward to find supporting facts. Therefore,it is also known as “Goal-Driven Approach”.

Figure No. 8.9. Backward Chaining in AI

For example: A doctor may suspect some problems with patient. After checkup, he attempts to prove bylooking for certain symptoms of the disease.

Page 134 of 248

Page 140: Self Learning Material Artificial Intelligence

Flowchart of BackwardChaining:

Page 135 of 248

Page 141: Self Learning Material Artificial Intelligence

“Backward-chaining Systems” try to satisfy the goals. They do this by finding rules that can conclude theinformation needed by the goal. It tries to make the If parts of those rules satisfied. It works as follows:

It will check the conclusions of the rules. This is used to find all rules that can satisfy the top goal on thestack. You need to process these rules one at a time. One has to evaluate the conditions in the rules. Itmay be possible that the condition is currently unknown. Simply you have to push a goal to make thatcondition known. At last, one has to recursively invoked the system. It might be possible thatthecondition whichis known to beunsatisfied. We have to continue with the loop till the last. It mightbepossible that it is difficult to determine whetherthecondition was satisfied, continue with the loop.If allthe conditions in the selected rulearesatisfied. Then we can add to Working Memory. After that popthegoaloff the stack. Finally, return from this invocation ofthesystem.The system will terminate withsuccess when the goalstackis empty. It will terminate with failure if the system runs outofrules.

8.9. Comparison between forward and Backward Chaining:

Forward Chaining Backward Chaining

Forward Chaining starts with new data. Backward Chaining starts with somehypothesis or goal or possible solution.

It asks few questions. It asks many questions.

It examines all rules. It examines some rules.

Forward Chaining is a slow approach. Backward Chaining is a fast approach.

It produce large amount of informationfrom small amount of data.

It produce small amount of informationfrom available data.

Forward Chaining is primarily datadriven.

Backward Chaining is primarily GoalDriven.

It uses input; searches rules for answers. It proves the hypothesis.

It is a form of Top-Down reasoning. It is a form of bottom up reasoning.

Works forward to find conclusions fromfacts.

Works backward to find facts that supportthe hypothesis.

It tends to breath – first. It tends to depth – first.

Forward Chaining is suitable for problemsthat start from data collection; e.g.planning, monitoring and control.

Backward Chaining is suitable forproblems that start from hypothesis, e.g.diagnosis.

This type of chaining is non-focused This type of chaining is focused to prove

Page 136 of 248

Page 142: Self Learning Material Artificial Intelligence

because it infers all conclusions, mayanswer unrelated questions.

the goal and search as only the part ofknowledge base that is related to theproblem.

Explanation is not facilitated in ForwardChaining.

Explanation is facilitated in BackwardChaining

All data is available. Data must be acquired interactively (i.e.on demand)

It deals with less number of initial statesand many results.

It deals with less starting goals and manyfacts.

Forming a goal is difficult in case ofForward Chaining.

Forming a goal is easy in case ofBackward Chaining.

8.10. Summary

In this chapter, the concept of Knowledge and its importance in Artificial Intelligence is discussed indetail. The Knowledge base acquires its contents from various sources, organize them then use them totake a decision and solve a difficult and complex problem. Knowledge plays an important role indesigning AI supported systems. Different kinds of Knowledge and their sources have been elaboratedclearly and the then concept of forward and backward chaining is rose out. The differences betweenForward and Backward Chaining is also elaborated.

8.11. Glossary

Knowledge– It is the refined form of information.Forward Chaining – It refers to a scenario where the AI has been provided with a specific problem. Itmust "work forwards" to finds out how to solve the problem.

8.12. Answers to check your progress / self assessment questions

1. Knowledge is the refined form of information.2. The practitioners who build knowledge base are known as knowledge engineers.3. Task means some goal-oriented, problem solving activity.4. Declarative knowledge is a kind of knowledge which represents particular object.5. It is used to depict information in an agent.6. The process used to define the rules for a knowledge-based system.

7. Frame is a data structure used to represent knowledge in an Artificial Intelligence.

8.13. Model Questions

1. What do you mean by Knowledge? Explain concept of Knowledge from the perspective of AI.

Page 137 of 248

Page 143: Self Learning Material Artificial Intelligence

2. Discuss the importance of Knowledge in AI. How knowledge is manipulated in AI?

3. What do you mean by Knowledge Representation? Discuss the concept of Representation Scheme.

4. Explain Knowledge Acquisition and Organization in AI along with different types of Knowledge.

5. Elaborate Forward Chaining and Backward Chaining with the help of respective examples.

6. Differentiate Forward and Backward Chaining.

Page 138 of 248

Page 144: Self Learning Material Artificial Intelligence

LESSON 9 :LOGIC IN ARTIFICIAL INTELLIGENCE

Structure of the Chapter

9.0. Objectives.

9.1. Introduction to Logic.

9.2. Types of Logic in artificial intelligence.

9.2.1. Prepositional Logic.

9.2.2. Predicate Logic.

9.2.3. First Order Predicate Logic (FOPL).

9.3. Logical Reasoning.

9.3.1. Representing Simple facts in Logical Reasoning.

9.3.2. Representing instance and IS A relationship.

9.4. Resolution Principle.

9.5.1. Examples of Resolution Principle.

9.5.2. Clausal form Representation and inference.

9.5. Summary.

9.6. Glossary.

9.7. Answers to check your Progress/ Self-Assessment Questions.

9.8. Model Questions.

9.0. Objectives

After completing this chapter, the students will be able to understand:

Importance of Logic in AI.

Various types of logic in AI.

Representing Simple facts,Logical Reasoning and IS A relationship.

Resolution Principle and its example.

Clausal form Representation and inference.

First Order Predicate Logic.

Page 139 of 248

Page 145: Self Learning Material Artificial Intelligence

9.1. Introduction to Logic.

Logic is the study of reasoning. It is a study of methods and principles used to differentiate valid andinvalid reasoning.

It is supposed to elaborate the laws of thought in a detail and sound manner with proper support ofreasons. It is applied to prove things, whether mathematical, philosophical, or scientific. It is the basis fora branch of computer programming used in artificial intelligence. It can be applied to perform softwareverification.

Basically, logic is a systematic method for clearly expressing and demonstrating truths.

Logic is a process by which we arrive at a conclusion from known statements with the use of laws oflogic. In the middle of the nineteenth century, George Boole and then Augustus De Morgan presentedsystematic mathematical treatments of logic. So the logic relevant to mathematics i.e. mathematical logicis called Boolean Logic.

We focus on symbolic logic, that is, a logic where the statements are expressed as symbols that representconcepts. We start with propositional logic where our statements are either true or false. This is atraditional two-valued logic. Fuzzy logic is another form of logic which deals with statements thatcontain a degree of truthfulness, evaluated as a real number between 0 and 1.

In logic, we may write a statement in English, in propositional calculus, in predicate calculus, or throughsome other means. A statement should be well-formed.

9.2. Types to Logic

Many different types of logic exist in study but the following three types of logics found wideapplications in artificial intelligence.

Page 140 of 248

Page 146: Self Learning Material Artificial Intelligence

9.2.1. Prepositional Logic

Preposition: Sentence is sensible combination of words. Sentences are usually classified as declarative,exclamatory, interrogative or imperative. But here we will discuss only those declarative sentences whichare either true or false. “Proposition is a declarative sentence which is true or false.”

Truth Value

Truth value of a statement or proposition depends upon its truthness or fallacy. If a statement is true wesay its truth value is ‘True’ denote it as ‘T’ or ‘1’ while if a statement is false we say its truth value is‘False’ denote it as ‘F’ or ‘0’.For example “2 is the only even prime number” is true and has truth value Tor 1.On the other hand “7 ≥ 9” is false and has truth value ‘F’ or ‘0’.

Example:-Which of the following are proposition and write their truth value.

(i) 4 is the only even prime number.(ii) 6 ≥ 10.(iii) The moon is very cold body.(iv) x − 4x + 8 = 0.(v) Open your mouth.(vi) Do you like pizza?(vii) The sum of two plus two is four.

LO

GIC

S IN

AR

TIF

ICIA

LIN

TE

LL

IGE

NC

E PREPOSITIONALLOGIC

PREDICATELOGIC

FIRST ORDERLOGIC

Page 141 of 248

Page 147: Self Learning Material Artificial Intelligence

Solution:

(i) This is a proposition and its truth value is T or 1.

(ii) This is a proposition and its truth value is F or 0.

(iii) This is a proposition and its truth value is T or 1.

(iv) This is not a proposition. Moreover it is an open sentence.

(v) This is not a proposition. It is rather a Command.

(vi) This is not a proposition.

(vii) This is a proposition and its truth value is T or 1.

Simple Proposition

A proposition whose authenticity/factualness or fallacy does not explicitly depend on other statement.e.g. “Every prime number is multiple of itself ‘’is a simple or elementary statement.

Compound Proposition

Two or more simple proposition can be combined to form a compound or composite proposition. e.g.“Paris is capital of France and Sum of angles of a rectangle is 360°" is a compound proposition.

Logical Connectives

To form a compound statement or proposition, simple proposition are connected by some phrases orwords or symbol known as logical connectives or sentential connectives or connectives. Some of theimportant connectives are “and”, “or”, “if then” etc. e.g. “Taj mahal is in Agra or 2+3=5”. Here “or” is alogical connective.

Check your progress/ Self-assessment questions

Q1. What do you mean by Logic?

Solution:

(i) This is a proposition and its truth value is T or 1.

(ii) This is a proposition and its truth value is F or 0.

(iii) This is a proposition and its truth value is T or 1.

(iv) This is not a proposition. Moreover it is an open sentence.

(v) This is not a proposition. It is rather a Command.

(vi) This is not a proposition.

(vii) This is a proposition and its truth value is T or 1.

Simple Proposition

A proposition whose authenticity/factualness or fallacy does not explicitly depend on other statement.e.g. “Every prime number is multiple of itself ‘’is a simple or elementary statement.

Compound Proposition

Two or more simple proposition can be combined to form a compound or composite proposition. e.g.“Paris is capital of France and Sum of angles of a rectangle is 360°" is a compound proposition.

Logical Connectives

To form a compound statement or proposition, simple proposition are connected by some phrases orwords or symbol known as logical connectives or sentential connectives or connectives. Some of theimportant connectives are “and”, “or”, “if then” etc. e.g. “Taj mahal is in Agra or 2+3=5”. Here “or” is alogical connective.

Check your progress/ Self-assessment questions

Q1. What do you mean by Logic?

Solution:

(i) This is a proposition and its truth value is T or 1.

(ii) This is a proposition and its truth value is F or 0.

(iii) This is a proposition and its truth value is T or 1.

(iv) This is not a proposition. Moreover it is an open sentence.

(v) This is not a proposition. It is rather a Command.

(vi) This is not a proposition.

(vii) This is a proposition and its truth value is T or 1.

Simple Proposition

A proposition whose authenticity/factualness or fallacy does not explicitly depend on other statement.e.g. “Every prime number is multiple of itself ‘’is a simple or elementary statement.

Compound Proposition

Two or more simple proposition can be combined to form a compound or composite proposition. e.g.“Paris is capital of France and Sum of angles of a rectangle is 360°" is a compound proposition.

Logical Connectives

To form a compound statement or proposition, simple proposition are connected by some phrases orwords or symbol known as logical connectives or sentential connectives or connectives. Some of theimportant connectives are “and”, “or”, “if then” etc. e.g. “Taj mahal is in Agra or 2+3=5”. Here “or” is alogical connective.

Check your progress/ Self-assessment questions

Q1. What do you mean by Logic?

Page 142 of 248

Page 148: Self Learning Material Artificial Intelligence

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q2. Who proposed the theory of Boolean Algebra?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q3. Name tree types of logic used in AI.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q4. Define Proposition.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q5. Give an example of Compound Proposition.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q.6. Fill in the blank:

“Proposition is a ………………………sentence which is true or false.”

Truth Table

It is the table to check the truth value of a compound statement. It contains finite number of rows andcolumns. The number of rows in the table equal to 2 , where n is equal to number of simple statements inthe compound statement while number of columns depends upon the number of simple statements andhow they are involved in relationships.

Basic Logical Operation and truth tables

1 Conjunction:

When two simple statement say p and q are connected by word ‘and’ called conjunction of p and qdenoted as ‘p Ʌ q’ and read as p and q.

Since ‘p Ʌ q’ is also a proposition so it has definite truth value.If p and q are true, then ‘p Ʌ q’ is trueotherwise it is false.It also be shown by following table:

Truth table p Ʌ q

Page 143 of 248

Page 149: Self Learning Material Artificial Intelligence

P q p Ʌ q

T T T

T F F

F T F

F F F

Consider the statements:

Ottawa is capital of Canada. Golden Temple is a gurdwara.

The conjunction is “Ottawa is capital of Canada and Golden Temple is a gurdwara.”

Example: Consider the following Statements:

(i) p: 3> 2q: Odd number is not divisible by 2.p Ʌ q: 5 > 4 andodd number is not divisible by 2.Since p is true and q is also true. Therefore truth value of p Ʌ q is true (T).

(ii) p: 7> 6q: Every odd number is divisible by 2.p Ʌ q: 7> 6 and every odd number is divisible by 2.Since p is true and q is false. Therefore truth value of p Ʌ q is false (F).

(iii) p: 7< 4q: Odd number is not divisible by 2.p Ʌ q: 5 < 4 and odd number is not divisible by 2.Since p is false and q is true. Therefore truth value of p Ʌ q is false (F).

(iv) p: 5 < 4q: Every odd number is divisible by 2.p Ʌ q: 5 < 4 and every odd number is divisible by 2.Since p is false and q is also false. Therefore truth value of p Ʌ q is false (F).

2 Disjunction:

When two simple statement say p and q are connected by word ‘or’ called disjunction of p and q denotedas ‘p V q’ and read as ‘p or q’.

Since ‘p V q’ is also a proposition so it has definite truth value. If p and q are false, then ‘p V q’ is alsofalse otherwise it is true. It also be shown by following table:

P q p V q

Page 144 of 248

Page 150: Self Learning Material Artificial Intelligence

T T T

T F T

F T T

F F F

Consider the statement:

Degree of pendent vertex is one. Triangle is a complete graph.The disjunction is: Degree of pendentvertex is one or Triangle is a complete graph.

Example:

(i) p: 2 is the only even prime numberq: 5+7 = 12p V q: 2 is the only even prime number or 5+7 = 12.Here p and q both are true.Therefore truth value of ‘p V q’ is true (T).

(ii) p: 2 is the only even prime numberq: 5+7 ≠ 12p V q: 2 is the only even prime number or 5+7 ≠ 12.Here p is true but q is false.Therefore truth value of ‘p V q’ is true (T).

(iii) p: Set of even prime is an empty set.q: 5+7 = 12p V q: Set of even prime is an empty set or 5+7 = 12.Here p is false and q is true. Therefore truth value of ‘p V q’ is true (T).

(iv) p: Set of even prime is an empty set.q: 5+7 ≠ 12p V q: Set of even prime is an empty set or 5+7 ≠ 12.Here p and q both are false. Therefore truth value of ‘p V q’ is false (F).

3 Negation:

Negation of proposition p is denoted as ‘¬ p’ or ‘~p’ while read as ‘not p’. It is obtained from statement pby writing “It is not the case that” or “It is false that” before p or by inserting in p the word “not”properly.

Since negation of proposition is also a proposition therefore it has definite truth value. If p is false then‘~p’ is true and if p is true then ‘~p’ is false. . It can be shown by following table:

Page 145 of 248

Page 151: Self Learning Material Artificial Intelligence

Truth table

p ~p

T F

F T

Consider the statement: Amritsar is a holy city.

Negation of above statement can be given one of the ways as follows:

(a) Amritsar is not a holy city.(b) It is not the case that Amritsar is a holy city.(c) It is false that Amritsar is a holy city.

Examples:

(i) p: 8 – 5 = 3.~ p: 8 – 5 ≠ 3.Clearly truth value of p is true (T) while truth value of ~p is false (F).

(ii) p: Every odd integer is prime.~p: Every odd integer is not prime.Here truth value of p is false (F) while truth value of ~p is true (T).

Page 146 of 248

Page 152: Self Learning Material Artificial Intelligence

Check your progress/ Self-assessment questions

Q7. What do you mean by Truth Table?

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q8. Draw truth table for Conjunction and Disjunction operations?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q9. Which logical gate is used in conjunction and negation operation respectively?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 147 of 248

Page 153: Self Learning Material Artificial Intelligence

Tautologies and Contradiction

Tautologies are those propositions which are true for any truth value of their variables involved or theseproposition contain only T in the last column of their truth tables. e.g “p V ~p” is a tautology.

p ~p p V ~p

T F T

F T T

Contradiction are those propositions which are false for any truth value of their variables involved orthese proposition contain only F in the last column of their truth tables. e.g. p Ʌ ~p is a contradiction.

p ~p p Ʌ ~p

T F F

F T F

Note: Negation of a tautology is a contradiction while negation of a contradiction is a tautology.

Logical Equivalence& Implication

Equivalence: Any two propositions are said to be logically equivalent if they have identical truth table orTwo propositions p and q are equivalent if p ↔ q is a tautology. e.g. p → q and ~p V q are logicallyequivalent as shown below. We write it as p → q ≡ ~p V q.

p q ~ p ~ p V q p → q

T T F T T

T F F F F

F T T T T

F F T T T

Clearly 4th and 5th columns are identical.∴ ~ p V qand p → q are logically equivalent.

Implication: Let p and q be any two propositions. We say p implies q if p → q is a tautology.e.g (p →q) Ʌ ~ q ⇒ ~ p (contrapositive law) is an implication.

Page 148 of 248

Page 154: Self Learning Material Artificial Intelligence

Truth table

p q p → q ~ q (p → q) Ʌ ~q

~ p (p → q) Ʌ ~ q ⇒ ~p

T T T F F F T

T F F T F F T

F T T F F T T

F F T T T T T

Converse, Inverse and Contrapositive

If p → q is a conditional statement then

(i) q → p is called its converse.(ii) ~ p → ~ q is called its inverse.(iii) ~q → ~ p is called its contrapositive.

Example: Find the converse, inverse and contrapositive of the following statement:

“Ifit is cold then he will wears a hat.”

Solution:

(a) Converse: If he will wears a hat then it is cold.(b) Inverse: If it is not cold then he will not wears a hat.(c) Contrapositive: If he will not wear a hat then it is not cold.

Check your progress/ Self-assessment questions

Q10. What is Tautology?

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q11. Differentiate Tautology and Contradiction.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q12. Which logical gate is used in disjunction and negation operation respectively?

Page 149 of 248

Page 155: Self Learning Material Artificial Intelligence

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q13. Define Equivalence.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Laws of Algebra of Proposition

Proposition satisfy different laws given below which can be easily verify by their truth table.

(i) Commutative laws(a) p V q≡ q V p (b) p Ʌ q≡ q Ʌ p

(ii) Associative laws(a) (p V q)V r≡ p V (q V r) (b) (p Ʌ q)Ʌ r≡ p Ʌ (qɅ r)

(iii) Idempotent laws(a) p V p≡ p (b) p Ʌ p≡ p

(iv) Null laws(a) p V 1≡ 1 (b) p Ʌ 0≡ 0

(v) Identity laws(a) p V 0≡ p (b) p Ʌ 1≡ p

(vi) Compliment Laws(a) p V ~p ≡ 1 (b) p Ʌ ~p ≡ 0

(vii) Distributive law(a) p V (qɅ r)≡ (p V q) Ʌ (p V r) (b) p Ʌ (qV r)≡ (pɅ q) V (p Ʌ r)

(viii) DeMorgan’s law(a) ~(p V q)≡ ~ pɅ ~q (b) ~(p Ʌ q)≡ ~ p V ~q

(ix) Absorption law(a) p V (pɅ q)≡ p (b) p Ʌ (pV q)≡ p

(x) Involution law~(~p) ≡ p

Check your progress/ Self-assessment questions

Q14. Name different laws of Proposition Logic.

Page 150 of 248

Page 156: Self Learning Material Artificial Intelligence

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q15. Fill in the blanks:

1. p Ʌ 1≡ ………….

2. p Ʌ (qɅ r) ≡…………………………………..

3. p V (qɅ r)≡ (p V q) Ʌ (p V r) is known as……………………..law.

4. (p V q)V r≡ p V (q V r) is called……………..law.

9.2.2. Predicate Logic

Propositions are used to represent singularstatements, such as “It is raining” or “the car is black”. Butwhat if I want to express statements about various cars, not just the class car? For instance, we mightwant to say that “Italian sports cars are fast” but not necessarily other cars. Or “Joe’s car is fast butSusan’s car is not fast”? We need to enhance our logic from propositions to predicates. A predicate is astatement, much like a proposition, that contains one or more variables which represent instances. Avariable can have one of two scopes, for all (everything) or there exists (a single item). With predicates,we can enrich our logic to be far more expressive. Predicates, unlike propositions, will include variablesin parentheses (we might also call these arguments) and the predicates are typically preceded withquantifiers which dictate the scope of the variable(s). We will use two quantifiers, the universal

quantifier, , means “for all”. The existential quantifier, , means “there exists”.

NOTE: predicates in some texts are indicated with upper case letters and variables with lower caseletters. Here, all variables will be indicated using lower case letters, and predicates will either be lowercase single letters, or lower case words.

The statement x: p(x). means that, for all x, it is a p, or “everything is a p”. For instance, we might say x: round(x). which means “everything is round”. This of course is untrue. So we are more likely touse the universal quantifier in an implication rule. Returning to an earlier statement, “all men aremortal”, we can state this as “for everything in the universe, if it is a man then it is mortal”. This can bewritten as x: man(x) mortal(x). Thus, we can write “truth preserving rules”, implications that, ifthe condition is true, then the conclusion must be true.

The existential quantifier is used in an argument to show that at least one instant exists. We might usethis to say that “the United States has a president”. This could be expressed as x: presidentofus(x). Ifwe assume that US is a constant that represents the United States, and the predicate president takes twoarguments, the person and the country, then we could also write this as x: president(x, US). We canalso use the same predicate to say ~ x: president(x, England). That is, while the US has a president,England does not.

Statements can have multiple quantifiers including quantifiers of both types. Here are some examples:

( x)( y)( z) : father(x, y) * father(y, z) grandfather(x, z)

Page 151 of 248

Page 157: Self Learning Material Artificial Intelligence

“If x is y’s father and y is z’s father, then x is z’s grandfather.”

( x)( y) : student(x) * teacher(y) canteach(y, x)

“If x is a student and y is a teacher then y can teach x.”

( x)( y) : student(x) teacher(y) * canteach(y, x)

“If x is a student, then there exists someone who teaches x.”

This could also be stated as “all students have a teacher.”

NOTE: We would place [ ] around the entire implication statement to properly denote the scope rule, but

we will omit that for brevity. So for instance, the first statement really should read: ( x)( y)( z) :

[Father(x, y) * Father(y, z) Grandfather(x, z)].

Let’s go through some examples of translating English sentences into predicate calculus statements.

John loves only Mary: ( x) loves(John, x)Mary(x).

“if there is anything that John loves, it is Mary”

Only John loves Mary: ( x) loves(x, Mary) John(x).

“if anything loves Mary, it is John.

All dogs chase all rabbits: ( x) ( y) dog(x) * rabbit(y) chase(x, y).

Some dogs chase all rabbits: ( x) ( y) dog(x) * rabbit(y) chase(x, y).

Some dogs chase rabbits: ( x) (y) dog(x) * rabbit(y) chase(x, y).

Only dogs chase rabbits: ( x) ( y) chase(x, y) * rabbit(y) dog(x).

Dogs chase only rabbits: ( x) ( y) chase(x, y) * dog(x) rabbit(y).

Notice the subtlety here in how the quantifier can change our interpretation of what the statement means.

It can be very tricky!

When we negate a qualifier, we must be careful in what we negate because the position of the negation

will change our interpretation of the statement. Consider “Everything is beautiful”, which can be written

as ( x) beautiful(x). If we write ~( x) beautiful(x), we are saying “nothing is beautiful”, (“there does

not exist an x that makes beautiful(x) true”). Here are some additional examples that include two

quantifiers (let’s assume that the negation of loves is hates):

Everybody hates somebody: ( x) (y): ~loves(x, y)

Somebody loves everybody: ( x) ( y): loves(x, y)

Somebody hates everybody: ( x) ( y): ~loves(x, y).

Page 152 of 248

Page 158: Self Learning Material Artificial Intelligence

What if we want to negate a statement. For instance, the negation (opposite) of “everything is beautiful”

is really “it is false that everything is beautiful” which means “somethings are not beautiful”. This is

expressed as ( x) ~beautiful(x). So notice that to negate a universal quantifier, we change the quantifier

and move the negation to be in front of the predicate.

Negating a statement with a quantifier should remind you something of DeMorgan’s law. In

DeMorgan’s law, we moved the negation in front of each proposition and we changed the sign from

AND to OR (or OR to AND). Here, we change the quantifier from universal to existential (or existential

to universal) and move the negation to appear in front of the predicate (in fact, we are not moving the

negation in front of the predicate but rather we are negating the predicate). The negation of “nothing is

beautiful” is “some things are beautiful”. We can write these two statements as ( x) ~beautiful(x) and (

x): beautiful(x) respectively. Again, the two opposites are formed by taking the original, changing the

quantifier, and then negating the predicate (change ~beautiful(x) to beautiful(x)).

In summary, the opposite of ( x) p(x) is ( x) ~p(x), and the opposite of ( x) p(x) is ( x) ~p(x).

Predicate Calculus in AI

A number of Artificial Intelligence researchers use predicate calculus to represent knowledge. There are

two reasons for using predicate calculus:

1. Conclusions are truth preserving, and therefore, results from an AI system using predicate

calculus can be believed. Some approaches in AI are not based on a rigorous formalism and

therefore conclusions drawn may still be doubted.

2. There are available methods to use the represented knowledge. These are modus ponens, modus

tollens, resolution, and unification.

Here, we take a look at these methods. It should be noted that often times, literature refers to resolution

and modus ponens as the same thing. Here, we will look at Modus Ponens, Modus Tollens and

Unification.

Imagine that you have the following implication rule A B and that you know A is true. You can then

conclude B is true. Why? The implication truth table tells us that implication is true if either A and B are

both true or A is false. We make the assumption that our implication rule is true (truth preserving).

Therefore, since A is known to be true, B must also be true or else the implication rule is not true (it will

not match the truth table) and therefore is not truth preserving, violating our assumption. Now, assume

we have the following rules:

A BA C

Page 153 of 248

Page 159: Self Learning Material Artificial Intelligence

B * C DD E

We know A is true, this lets us conclude (eventually) that E is true because we can conclude that B and C

are both true, and therefore B * C is true and therefore D is true. This process of taking something that

we know is true, applying it to the antecedent of a rule, and then concluding the rule’s consequence, is

known as modus ponens. Its very simple yet very useful. Although this is formally called Modus

Ponens, we will see in chapter 3 and later, that the same process is used in what is known as data-driven

search, or forward chaining.

In Modus Tollens, we are using the implication rule but reversing the search process. If we known A

B and we know that B is false, then we conclude that A is false? Why? Again, recall the implication

truth table. B (the consequence) is false in two rows, T F and F F. However, the row T F is

false, and therefore we cannot conclude that A is true. Therefore, A must be false (again, under the

assumption that our rule is truth preserving). If we have the following rules:

A B

B C

C D

And we know D is false, we will be able to conclude that A must be false as well. If A were true, then B

and C will be true and therefore D would also have to be true. This “backward” approach is similar to,

but not exactly like, backward chaining, also known as goal-driven search.

When we use predicate calculus, we have a problem. Imagine that I know the following:

X: man(X) mortal(X).

man(Frank Zappa).

Can we conclude mortal(Frank Zappa)? No, because the rule says “X” and the predicate says “Frank

Zappa” and X is not Frank Zappa. So, we need an additional mechanism that allows us to unify the

variable in a predicate calculus term to the value in a predicate statement. That mechanism is called

unification. We denote the unification as {X/Frank Zappa} which means “substitute X with Frank

Zappa”. Now, I can conclude mortal(Frank Zappa).

Facts:

1) Poodles are dogs.

2) Cocoa is a poodle.

3) Every dog has his day.

4) Cats and dogs are enemies.

Page 154 of 248

Page 160: Self Learning Material Artificial Intelligence

5) Calicos are cats.

6) Fluffy is a calico.

Predicate Calculus form:

(note: V stands for "for all" and E stands for "there exists")

1) Vx: poodle(x) dog(x).

2) poodle(cocoa).

3) Vx Ey: dog(x) hasday(x, y).

4) Vx Vy: dog(x) * cat(y) enemies(x, y).

5) Vx: calico(x) cat(x).

6) calico(fluffy).

First, let’s try to prove “cocoa will have his day”. Apply 1 and 2 giving us dog(cocoa) by unifying x to

cocoa. Apply this conclusion with 3 gives us hasday(cocoa, y) therefore there exists a day that cocoa

“will have”.

Now find an enemy for cocoa. Again, 1 and 2 tell us dog(cocoa). Now 5 and 6 can be combined to

conclude cat(fluffy) by unifying y to fluffy. Taking these conclusions and applying them to 4 gives us

dog(cocoa) * cat(fluffy) enemies(cocoa, fluffy) or, fluffy is an enemy of cocoa, so we have found an

enemy of cocoa’s.

9.2.3. First Order Predicate Logic (FOPL).

A package of formal systems used in computer science is known as First-order logic is . The definition

of a formula in first order logic is analogous to the definition of formula in propositional logic. We first

define atomic formulas and then rules for construction more complex formulas. We use capital Roman

letters such as F, G, and H to represent formulas in propositional logic. In first – order logic we reserve

these letters for other uses and instead we use lower case Greek Letters such as theta, gamma and sigh to

denote formulas.

Prior to defining formulas, we must define the following terms:

1.Term:Terms are defined inductively by the following two rules:

Rule 1: Every variable f is constant.

Rule 2: If f is an m-ary function and t1,...,tm are terms.

The use of quantifiers makes it different from propositional logic, which has no use of quantifiers.

A theory about some entity is normally first-order logic in lieu with a particular area. When “theory" is

considered in a more structured and formal way,ii is considered as sentence written in first-order logic.

Page 155 of 248

Page 161: Self Learning Material Artificial Intelligence

The keyword "first-order" distinguishes first-order logic from higher-order logic in which there are

predicates having functions as arguments, or in which one or both of predicate quantifiers or function

quantifiers are permitted. In first-order logic, predicates and sets are packaged with each other.

There are several deductive systems for first-order logic which are both sound and complete .

Sound:All statements are having reasonable and valid proofs.

Complete: All statements which are true in all models are provable.

As we know the propositional logic deals with simple propositions, first-order logic covers both

predicates and quantification.

Predicate:

A predicate accepts an entity or entities as input and outputs either True or False.

For example:

Consider the two sentences:

1. "Ram is a philosopher”.

2. "Sham is a philosopher".

First Order Logic Quantifiers

First Order logic uses different kinds of quantifiers. These are

1. Conditional Quantifier.()

2. “for every” Quantifier.(∀)

3. “there exists” Quantifier. (∃)

1. Conditional quantifier ( )

Variables are used to reasoning about properties that are shared by many objectsin First order logic

allows.

For example: Let Phil (a) that a is philosopher

and Schol (a) is a scholar.

Then the formula

Phil (a) Schol (a)

assertsthat if a is philosopher then a is scholar. The symbol is used to denote a condition (if/then)statement. So, it is conditional quantifier. The hypothesis lies to the left of the arrow and the conclusion to the

Page 156 of 248

Page 162: Self Learning Material Artificial Intelligence

right. The truth of this formula depends on which object is denoted by a, a and on the interpretation of “Phil” and“Schol”.

2. “for every” (∀) quantifier

Assertions of the form

“for every a , if a is a philospher then a is a scholar” requires both the use of variables and te use

of quantifier.

For example: Let Phil (a) assert a is a philospher and

Schol (a) assert a is a scholar.

Then , the First Order Sentence∀ a (Phil (a) Schol (a))

Asserts that no atter what a represents , if a is a philospher then a is a scholar. ∀ is a universal quantifier ,

expresses the idea that the calim in () holds for “all “choices of a.

3. “there exists” (∃) quantifier

To show the claim

“If a is philosopher then a is scholar” is a false, one would show there is some philosopher who is not a

scholar. So, ∃ can be used here and as follows∃a (Phil (a) ∧ ¬ Scholar (a))So, in the above statement we also used Negation Quantifier (¬ )

Conjuction Quantifier (∧)Differences between First order logic and Propositional Logic:

S.No. First Order Logic Propositional Logic

1. It uses quantifiers. It uses predicates.

2. Predicates are associated with sets in

first order logic.

Predicates are associated with sets of

sets.

Page 157 of 248

Page 163: Self Learning Material Artificial Intelligence

3. There are many deductive systems

for first order logic that are “sound

and complete”.

Rarely uses of deductive systems in

Propositional Logic.

4. First Order logic predicates and

quantification additionally with

simple declarative propositions.

Propositional Logic deals with simple

declarative propositions

5. In First Order logic, the sentences can

be expressed in a parallel manner

using a single predicate.

Sentences are treated as unrelated

propositions.

6. First Order Logic express predicates

with more than one parameter.

In Propositional logic predicates can only

take one parameter at a time.

9.3. Logical Reasoning

Logical reasoning refers to technique of reasoning in which logical operators like conjunction,disjunction, negation etc. are used.

9.3.1. Representing Simple facts in Logical Reasoning.

By using Propositional Logic:

One can represent real world facts using propositional logic written as well-formed formulas.

Example 1:

It is raining. RAINING

It is sunny. SUNNY

It is Windy. WINDY

If it is raining, then it is not sunny RAINING ¬WINDY

In logic, the simple facts can be represented by following axioms in propositional logic:

1.Modus Ponens (MP):

X, X Y |= Y

2. Modus Tollens (MT):

X Y, ¬Y |= ¬X

3. There are many deductive systems

for first order logic that are “sound

and complete”.

Rarely uses of deductive systems in

Propositional Logic.

4. First Order logic predicates and

quantification additionally with

simple declarative propositions.

Propositional Logic deals with simple

declarative propositions

5. In First Order logic, the sentences can

be expressed in a parallel manner

using a single predicate.

Sentences are treated as unrelated

propositions.

6. First Order Logic express predicates

with more than one parameter.

In Propositional logic predicates can only

take one parameter at a time.

9.3. Logical Reasoning

Logical reasoning refers to technique of reasoning in which logical operators like conjunction,disjunction, negation etc. are used.

9.3.1. Representing Simple facts in Logical Reasoning.

By using Propositional Logic:

One can represent real world facts using propositional logic written as well-formed formulas.

Example 1:

It is raining. RAINING

It is sunny. SUNNY

It is Windy. WINDY

If it is raining, then it is not sunny RAINING ¬WINDY

In logic, the simple facts can be represented by following axioms in propositional logic:

1.Modus Ponens (MP):

X, X Y |= Y

2. Modus Tollens (MT):

X Y, ¬Y |= ¬X

3. There are many deductive systems

for first order logic that are “sound

and complete”.

Rarely uses of deductive systems in

Propositional Logic.

4. First Order logic predicates and

quantification additionally with

simple declarative propositions.

Propositional Logic deals with simple

declarative propositions

5. In First Order logic, the sentences can

be expressed in a parallel manner

using a single predicate.

Sentences are treated as unrelated

propositions.

6. First Order Logic express predicates

with more than one parameter.

In Propositional logic predicates can only

take one parameter at a time.

9.3. Logical Reasoning

Logical reasoning refers to technique of reasoning in which logical operators like conjunction,disjunction, negation etc. are used.

9.3.1. Representing Simple facts in Logical Reasoning.

By using Propositional Logic:

One can represent real world facts using propositional logic written as well-formed formulas.

Example 1:

It is raining. RAINING

It is sunny. SUNNY

It is Windy. WINDY

If it is raining, then it is not sunny RAINING ¬WINDY

In logic, the simple facts can be represented by following axioms in propositional logic:

1.Modus Ponens (MP):

X, X Y |= Y

2. Modus Tollens (MT):

X Y, ¬Y |= ¬X

Page 158 of 248

Page 164: Self Learning Material Artificial Intelligence

3. Conjunction (Conj):

X, Y |= XÙ Y

4. Simplification (Simp):

X Ù Y |= X, Y

5. Addition (Add):

X |= X v Y

6. Disjunctive Syllogism (DS):

X v Y, ¬X |= Y

7. Hypothetical Syllogism (HS):

X Y, Y Z |= X Z

Example 2:

Honey is man. HONEYMAN

Manveer is man. MANVEERMAN

All men are mortal. MORTALMAN

In this example, we cannot draw any conclusion about similarities between Honey and Manveer.

Also, we can’t understand the relationship between any individual being a man and that individual beinga mortal.

By using Predicate Logic:

Honey is man. man (honey)

Manveer is man. man (manveer)

All men are mortal. ∀ X (man (X) mortal(X))

mortal(Honey).

So, we can conclude that there is difference between representing simple facts using propositional logicand predicate logic.

S.No. Propositional Logic Predicate Logic

1. Theorem proving is decidable in this case. Theorem proving is not decidable in this case.

2. Cannot represent objects and quantification Can represent objects and quantification.

3. Conjunction (Conj):

X, Y |= XÙ Y

4. Simplification (Simp):

X Ù Y |= X, Y

5. Addition (Add):

X |= X v Y

6. Disjunctive Syllogism (DS):

X v Y, ¬X |= Y

7. Hypothetical Syllogism (HS):

X Y, Y Z |= X Z

Example 2:

Honey is man. HONEYMAN

Manveer is man. MANVEERMAN

All men are mortal. MORTALMAN

In this example, we cannot draw any conclusion about similarities between Honey and Manveer.

Also, we can’t understand the relationship between any individual being a man and that individual beinga mortal.

By using Predicate Logic:

Honey is man. man (honey)

Manveer is man. man (manveer)

All men are mortal. ∀ X (man (X) mortal(X))

mortal(Honey).

So, we can conclude that there is difference between representing simple facts using propositional logicand predicate logic.

S.No. Propositional Logic Predicate Logic

1. Theorem proving is decidable in this case. Theorem proving is not decidable in this case.

2. Cannot represent objects and quantification Can represent objects and quantification.

3. Conjunction (Conj):

X, Y |= XÙ Y

4. Simplification (Simp):

X Ù Y |= X, Y

5. Addition (Add):

X |= X v Y

6. Disjunctive Syllogism (DS):

X v Y, ¬X |= Y

7. Hypothetical Syllogism (HS):

X Y, Y Z |= X Z

Example 2:

Honey is man. HONEYMAN

Manveer is man. MANVEERMAN

All men are mortal. MORTALMAN

In this example, we cannot draw any conclusion about similarities between Honey and Manveer.

Also, we can’t understand the relationship between any individual being a man and that individual beinga mortal.

By using Predicate Logic:

Honey is man. man (honey)

Manveer is man. man (manveer)

All men are mortal. ∀ X (man (X) mortal(X))

mortal(Honey).

So, we can conclude that there is difference between representing simple facts using propositional logicand predicate logic.

S.No. Propositional Logic Predicate Logic

1. Theorem proving is decidable in this case. Theorem proving is not decidable in this case.

2. Cannot represent objects and quantification Can represent objects and quantification.

Page 159 of 248

Page 165: Self Learning Material Artificial Intelligence

9.3.2. Representing instance and IS A relationship

Isa and instance relationships

Two keywords isa and instance play a vital role in number of areas of knowledge representation.

They both are widely used to represent because they support inheritance .hence provide the facility toreuse code and data and finally save time and cost of developing Artificial Intelligence program.

isa-- used to show class inclusion, e.g. isa(mega_star,rich).

instance-- used to show class membership, e.g. instance (prince, mega_star).

For example:

Pompeian (Ram)"x: Pompeian(x) Indian (x)instance (Ram, Pompeian)"x: instance(x, Pompeian) instance(x, Indian)instance (Ram, Pompeian)isa(Pompeian, Indian)"x: "y: "z: instance(x, y) Ù isa(y, z) instance(x, z)

From the above it should be simple to see how to represent these in predicate logic.

9.4. Resolution Principle.

Resolution is a sound and complete inference procedure for FOL.

Resolution rule for propositional logic:

A1A

2 ... A

n

A1B

2 ... B

m

Resolvent: A2 ... A

nB

2 ... B

m

Examples

A and A B : derive B (Modus ponens)

(AB) and (B R) : derive A R

A and A : derive False [contradiction!]

(AB) and (AB) : derive True

9.3.2. Representing instance and IS A relationship

Isa and instance relationships

Two keywords isa and instance play a vital role in number of areas of knowledge representation.

They both are widely used to represent because they support inheritance .hence provide the facility toreuse code and data and finally save time and cost of developing Artificial Intelligence program.

isa-- used to show class inclusion, e.g. isa(mega_star,rich).

instance-- used to show class membership, e.g. instance (prince, mega_star).

For example:

Pompeian (Ram)"x: Pompeian(x) Indian (x)instance (Ram, Pompeian)"x: instance(x, Pompeian) instance(x, Indian)instance (Ram, Pompeian)isa(Pompeian, Indian)"x: "y: "z: instance(x, y) Ù isa(y, z) instance(x, z)

From the above it should be simple to see how to represent these in predicate logic.

9.4. Resolution Principle.

Resolution is a sound and complete inference procedure for FOL.

Resolution rule for propositional logic:

A1A

2 ... A

n

A1B

2 ... B

m

Resolvent: A2 ... A

nB

2 ... B

m

Examples

A and A B : derive B (Modus ponens)

(AB) and (B R) : derive A R

A and A : derive False [contradiction!]

(AB) and (AB) : derive True

9.3.2. Representing instance and IS A relationship

Isa and instance relationships

Two keywords isa and instance play a vital role in number of areas of knowledge representation.

They both are widely used to represent because they support inheritance .hence provide the facility toreuse code and data and finally save time and cost of developing Artificial Intelligence program.

isa-- used to show class inclusion, e.g. isa(mega_star,rich).

instance-- used to show class membership, e.g. instance (prince, mega_star).

For example:

Pompeian (Ram)"x: Pompeian(x) Indian (x)instance (Ram, Pompeian)"x: instance(x, Pompeian) instance(x, Indian)instance (Ram, Pompeian)isa(Pompeian, Indian)"x: "y: "z: instance(x, y) Ù isa(y, z) instance(x, z)

From the above it should be simple to see how to represent these in predicate logic.

9.4. Resolution Principle.

Resolution is a sound and complete inference procedure for FOL.

Resolution rule for propositional logic:

A1A

2 ... A

n

A1B

2 ... B

m

Resolvent: A2 ... A

nB

2 ... B

m

Examples

A and A B : derive B (Modus ponens)

(AB) and (B R) : derive A R

A and A : derive False [contradiction!]

(AB) and (AB) : derive True

Page 160 of 248

Page 166: Self Learning Material Artificial Intelligence

Resolution rule for First Order Logic

Given sentences

A1 ... A

n

B1 ... B

m

In conjunctive normal form:

each Piand Q

iis a literal, i.e., a positive or negated predicate symbol with its terms,

If Pjand Q

kunify with substitution list θ, then derive the resolvent sentence:

Subset (θ, A1... A

j-1A

j+1... A

nB

1 …B

k-1B

k+1... B

m)

Example

from clause A(x, f(a)) A(x, f(y)) B(y)

and clause A(z, f(a)) B(z)

derive resolvent A(z, f(y)) B(y) B(z)

using θ = {x/z}

A Resolution Proof Tree

9.4.1. Examples of Resolution Principle.

• KB:allergies(P) sneeze(P)cat(Q) allergic-to-cats(P) allergies(P)

Resolution rule for First Order Logic

Given sentences

A1 ... A

n

B1 ... B

m

In conjunctive normal form:

each Piand Q

iis a literal, i.e., a positive or negated predicate symbol with its terms,

If Pjand Q

kunify with substitution list θ, then derive the resolvent sentence:

Subset (θ, A1... A

j-1A

j+1... A

nB

1 …B

k-1B

k+1... B

m)

Example

from clause A(x, f(a)) A(x, f(y)) B(y)

and clause A(z, f(a)) B(z)

derive resolvent A(z, f(y)) B(y) B(z)

using θ = {x/z}

A Resolution Proof Tree

9.4.1. Examples of Resolution Principle.

• KB:allergies(P) sneeze(P)cat(Q) allergic-to-cats(P) allergies(P)

Resolution rule for First Order Logic

Given sentences

A1 ... A

n

B1 ... B

m

In conjunctive normal form:

each Piand Q

iis a literal, i.e., a positive or negated predicate symbol with its terms,

If Pjand Q

kunify with substitution list θ, then derive the resolvent sentence:

Subset (θ, A1... A

j-1A

j+1... A

nB

1 …B

k-1B

k+1... B

m)

Example

from clause A(x, f(a)) A(x, f(y)) B(y)

and clause A(z, f(a)) B(z)

derive resolvent A(z, f(y)) B(y) B(z)

using θ = {x/z}

A Resolution Proof Tree

9.4.1. Examples of Resolution Principle.

• KB:allergies(P) sneeze(P)cat(Q) allergic-to-cats(P) allergies(P)

Page 161 of 248

Page 167: Self Learning Material Artificial Intelligence

cat(AliP)allergic-to-cats(Aromi)

• Goal:sneeze(Aromi)

9.5. Summary

This chapter provides a reasonable knowledge of use of logic concept in Artificial Intelligence. Logic

plays a major role in representing, organizing, acquisition and manipulating knowledge in Artificial

Intelligence Systems. Logic is the study of reasoning. It is a study of methods and principles used to

differentiate valid and invalid reasoning. Different types of logics i.e. propositional logic, predicate logic

and first order logic is discussed in this chapter. A table also shoes differences between propositional

logic and first order logic. A comprehensive view on resolution principle, isa and instance relationship is

also discussed.

9.6. Glossary

1. Logic: Logic is the study of reasoning.

2. Proposition:Proposition is a declarative sentence which is true or false.”

3. Composite proposition:Two or more simple proposition can be combined to form a compound orcomposite proposition.

4. Involution law: It states that the complement of complement of any variable is equal to a variable.

5. Tautologies:Tautologies are those propositions which are true for any truth value of their variablesinvolved or these propositions contain only T in the last column of their truth tables.

6. Contradiction:Contradiction are those propositions which are false for any truth value of theirvariables involved or these proposition contain only F in the last column of their truth tables.

7. Equivalence: Any two propositions are said to be logically equivalent if they have identical truth tableor two propositions p and q are equivalent if p ↔ q is a tautology.

9.7.Answers to check your progress / self-assessment questions

1. Logic is the study of reasoning.

2. George Boole.

3. Proposition logic, Predicate logic, First Order Logic.

4. “Proposition is a declarative sentence which is true or false.”

Page 162 of 248

Page 168: Self Learning Material Artificial Intelligence

5. “Paris is capital of France and Sum of angles of a rectangle is 360°" is a compound proposition.

6. Declarative.

7. It is the table to check the truth value of a compound statement.

8. Truth Table for Conjunction i.e. for p Ʌ q

P q p Ʌ q

T T T

T F F

F T F

F F F

Truth Table for Conjunction i.e. for p Ʌ q

P q p V q

T T T

T F T

F T T

F F F

9. AND and NOT gate.

10. Tautologies are those propositions which are true for any truth value of their variables involved or

these propositions contain only T in the last column of their truth tables.

11. Tautologies are those propositions which are true for any truth value of their variables whereas

Contradiction are those propositions which are false for any truth value of their variables.

12. OR and NOT gate.

13. Any two propositions are said to be logically equivalent if they have identical truth table or Two

propositions p and q are equivalent if p ↔ q is a tautology.

14. Do it yourself.

15. 1. p 2. (p Ʌ q)Ʌ r 3. Distributive 4. Associative.

Page 163 of 248

Page 169: Self Learning Material Artificial Intelligence

9.8. Model Questions

1. Discuss the importance of logic in Artificial intelligence and why it is used?

2. What are the different types of Logics used in Artificial Intelligence and discuss propositional logic.

3. What do you mean by proposition? Exemplify simple proposition and compound proposition.

4. Explain the concept of truth table by taking various examples in lieu of conjunction, disjunction and

negation.

5. Elaborate the terms tautology and contradiction with the help of examples and truth tables.

6. Differentiate Tautology and Contradiction.

7. Differentiate Propositional logic and First Order Logic.

8. What do you mean by Logical Equivalence& Implication? Explain with the help of truth tables and

examples.

9. Discuss the concept of Converse, Inverse and Contrapositive with the help of examples and truth

tables.

10. Explain laws of propositional logic.

11. State and prove distributive law and associative law.

12. State and prove Demorgan’s theorem.

13. Explain Predicate Logic in detail.

14. Discuss the importance of predicate logic in Artificial Intelligence.

15. What do you mean by First order logic? Why it is used?

16. Discuss different quantifiers used in First order Predicate Logic in detail.

17. Discuss syntax and semantics of first order logic in detail along with examples.

18. What do you mean by Logical Reasoning? How will you represent Simple facts in Logical

Reasoning?

19. How will you represent instance and IS A relationship in logical reasoning?

Page 164 of 248

Page 170: Self Learning Material Artificial Intelligence

20. State Resolution Principle in detail. Give its example.

Page 165 of 248

Page 171: Self Learning Material Artificial Intelligence

LESSON 10: Probability and Bayes’ Theorem

Structure of the Chapter

10.0. Objectives.

10.1. Introduction to Reasoning.

10.2. The logical approach to AI

10.3. Concept of Statistical Reasoning.

10.4. Probability

10.4.1. Probabilistic Reasoning

10.4.2. Definition of Probability

10.4.3. Terminology used in Probability

10.4.4. Advantages of Probability

10.4.5. Disadvantages of Probability.

10.5. Bayes Theorem

10.6. Belief Networks

10.6.1. Introduction of Bayesian belief networks.

10.6.2. Definition of Belief Network.

10.6.3. Applications of Belief Networks.

10.7. Default Reasoning

10.8. Summary.

10.9. Glossary.

10.10. Answers to check your Progress

10.11. Model Questions.

10.0. Objectives.

After completing this chapter, the student will be able to understand:

The concept of Reasoning and Statistical Reasoning.

Probability and Bayes Theorem.

The Concept of Fuzzy Logic and Fuzzy Sets.

Decision Making and Utility Functions.

Page 166 of 248

Page 172: Self Learning Material Artificial Intelligence

10.1 Introduction to Reasoning.

Reasoning is the process of obtaining answers from certain assumptions using a given methodology. AProcess of thinking, logically arguing, and drawing inference is termed ad reasoning. A system use theconcept of reasoning when told to do something for very first time and has not provided anything inadvance. The system should find out what it needs to know from what it already knows. Different typesof reasoning have been recognized, but several logics relating to their logical and mathematical propertiesstill controversial.

10.2. The logical approach to AI

AI is based on the following three points from logical view point:

1. The decision making machines will know their environment very well.2. These will use declarative approach to represent knowledge about their environment.

We have two basic kinds of knowledge: Declarative Knowledge:Explicitly present in computer in the form of statements and facts. Procedural Knowledge:Gained through number of procedures and steps.

10.3. Concept of Statistical Reasoning.

Statistical methods give a method for showing principles that are not certain i.e. uncertain but for whichthey may be some assisting confirmation. Statistical methods propose benefits in two wide scenarios:

1. The first one is Genuine Randomness where card games are a good instance. We may not becompetent to forecast any outcomes with certainty but we have knowledge regarding thepossibility of certain items (such as like being dealt an ace) and we can exploit this.

2. The second one is Exceptions. Symbolic methods can symbolize this. However, if the number oftasks for instance. Statically techniques can summarize huge exceptions without restoringenumeration.

Check your progress/ Self-assessment questions

Q1. Define the term “Reasoning”?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q2. Name two scenarios of Statistical reasoning.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 167 of 248

Page 173: Self Learning Material Artificial Intelligence

Q.3. Fill in the blank:

Symbolic logic can represent …………………..

10.4. Probability

The theory of probability owes its origin to the study of games of chance or gambling. Suppose a man ispermitted to toss a coin on payment of Rs. 2 and is offered Rs. 3 as a prize if the throw of coin results inhead. If the coin shows tail, he does not get anything. Now question is whether or not to play such abetting game. I n games of chance, under the given conditions, more than one result is possible and whichone of these results will actually appear cannot be predicted.

The aim of probability theory is to provide a mathematical solution to all such situations arising in thegames of chance.

10.4.1. Probabilistic Reasoning

If we wish to represent uncertain knowledge related to a set of propositional variables x1……………x2 by their jointdistribution P (x1………….xn), it will require some 2n entries to store the distribution explicitlyFurthermore, a determination of nay of the marginal probabilities xi requires summing Up(x1………………………..xn) over the remaining n-1 variables.

The Bayesian approach depends on the use of known-prior and likely probabilities to compareconditional probabilities.

In addition to methods based on formal theories the more pragmatic ad hoc approaches to uncertainreasoning were examined. In particular, the procedures used in “MYCIN” which combines measures ofbelief and disbelief into certainty factors been patterned after this method.

Finally, heuristic, nonnumeric approaches to the uncertainly problem were considered. Here,endorsements for a given alternative would outweigh negative factors of general rules, data and otherdomain knowledge provided stronger support. The SOLOMON and AM systems use a form a heuristiccontrol to reason with uncertain knowledge.

10.4.2. Definition: The “probability of an uncertain event A is a measure of the degree of likelihoodof occurrence of that event.”

Fig: 10.1: Probability

A probability is quantitative measure of uncertainty.

Page 168 of 248

Page 174: Self Learning Material Artificial Intelligence

10.4.3. Terminology used in Probability:

1. “Sample Space”:A set of all possible outcomes of an experiment and isdenoted by S.For example:

1. In tossing a coin, sample space is given by S= {H, T}.2. In tossing “two coins” simultaneously, sample space is given by S= {HH, HT, TH, TT}.3. In tossing “three coins” simultaneously, sample space is given by S= {HHH, HHT, HTH,

THH, TTH, THT, HTT, TTT}.4. In throwing a dice, sample space is S= {1, 2, 3, 4, 5, 6}.

Two Dices One Dice

2. Random Experiment: An experiment can be defined as a methodthat outputs one of a given setof possible outcomes.

For example:When a dice is thrown (or rolled) once. It will showany one of its “6 faces” pointingupward. It will resultin any one of the numbers “1, 2,3,4,5 and 6” which are appearing on the top face.

We call 1, 2,3,4,5 to 6 as an outcome of this activity. The set S of all possible outcomes is gives byS= {1, 2, 3, 4, 5, 6}.

Each element of S is called a sample point. This activity (of throwing a dice) is called a randomexperiment, or simply an experiment.

An event whose outcomes cannot be predicted in advance or determined in advance is a random event.

“A probability measure is a function P (.) Which maps event outcomes E1, E 2….from S into realnumbers and which satisfies the following axioms of probability”?

1. 0 ≤ P (A) ≤ 1for any event A⊆ S.2. P(S) =1, a certain outcome.

3. For Ei ∩Ej = Infinity, P ( E1∪E2∪E3 …) = P (E1) + P (E2) + P(E3) + …”

The basic laws of probability can be derived with the help of these three axioms.

10.4.3. Terminology used in Probability:

1. “Sample Space”:A set of all possible outcomes of an experiment and isdenoted by S.For example:

1. In tossing a coin, sample space is given by S= {H, T}.2. In tossing “two coins” simultaneously, sample space is given by S= {HH, HT, TH, TT}.3. In tossing “three coins” simultaneously, sample space is given by S= {HHH, HHT, HTH,

THH, TTH, THT, HTT, TTT}.4. In throwing a dice, sample space is S= {1, 2, 3, 4, 5, 6}.

Two Dices One Dice

2. Random Experiment: An experiment can be defined as a methodthat outputs one of a given setof possible outcomes.

For example:When a dice is thrown (or rolled) once. It will showany one of its “6 faces” pointingupward. It will resultin any one of the numbers “1, 2,3,4,5 and 6” which are appearing on the top face.

We call 1, 2,3,4,5 to 6 as an outcome of this activity. The set S of all possible outcomes is gives byS= {1, 2, 3, 4, 5, 6}.

Each element of S is called a sample point. This activity (of throwing a dice) is called a randomexperiment, or simply an experiment.

An event whose outcomes cannot be predicted in advance or determined in advance is a random event.

“A probability measure is a function P (.) Which maps event outcomes E1, E 2….from S into realnumbers and which satisfies the following axioms of probability”?

1. 0 ≤ P (A) ≤ 1for any event A⊆ S.2. P(S) =1, a certain outcome.

3. For Ei ∩Ej = Infinity, P ( E1∪E2∪E3 …) = P (E1) + P (E2) + P(E3) + …”

The basic laws of probability can be derived with the help of these three axioms.

10.4.3. Terminology used in Probability:

1. “Sample Space”:A set of all possible outcomes of an experiment and isdenoted by S.For example:

1. In tossing a coin, sample space is given by S= {H, T}.2. In tossing “two coins” simultaneously, sample space is given by S= {HH, HT, TH, TT}.3. In tossing “three coins” simultaneously, sample space is given by S= {HHH, HHT, HTH,

THH, TTH, THT, HTT, TTT}.4. In throwing a dice, sample space is S= {1, 2, 3, 4, 5, 6}.

Two Dices One Dice

2. Random Experiment: An experiment can be defined as a methodthat outputs one of a given setof possible outcomes.

For example:When a dice is thrown (or rolled) once. It will showany one of its “6 faces” pointingupward. It will resultin any one of the numbers “1, 2,3,4,5 and 6” which are appearing on the top face.

We call 1, 2,3,4,5 to 6 as an outcome of this activity. The set S of all possible outcomes is gives byS= {1, 2, 3, 4, 5, 6}.

Each element of S is called a sample point. This activity (of throwing a dice) is called a randomexperiment, or simply an experiment.

An event whose outcomes cannot be predicted in advance or determined in advance is a random event.

“A probability measure is a function P (.) Which maps event outcomes E1, E 2….from S into realnumbers and which satisfies the following axioms of probability”?

1. 0 ≤ P (A) ≤ 1for any event A⊆ S.2. P(S) =1, a certain outcome.

3. For Ei ∩Ej = Infinity, P ( E1∪E2∪E3 …) = P (E1) + P (E2) + P(E3) + …”

The basic laws of probability can be derived with the help of these three axioms.

Page 169 of 248

Page 175: Self Learning Material Artificial Intelligence

To understand the concept of probability one must understand the basic concept of distribution which canbe employed with the help of following approaches:

1. The usage of theoretical statements which precisely represents the features of a processes.2. The usage of own personal knowledge and knowledge of the fundamental concepts.3. Acquiring and Gathering practical data which can be linearly and quantitatively measured and

distributions can be made.Due to our weak believes, the most of knowledge about chances and probability are uncertain in natureand their conclusions represent a face of uncertainty. The value of probability or solution of a probabilityproblem that’s why always lies with in 0 and 1. It cannot be 0 or 1 i.e. true or false. The decisions areoften live proof and recorded experiences, which is mostly incomplete. Therefore the conclusions are nomore than well supported and sound guesses. It is possible to yield half-baked knowledge related to thepossible object program of an event. .

In extensive situations Probabilistic reasoning is used when results are unpredictable. For example, whena doctor diagnoses a patient’s history, symptoms and test result provide some form of future guessing andstructured knowledge from him to advice medicine and further tests.

Similarly, weather forecasters “guess” next day weather. The physical relationship which supports thesephenomena is not fully understood; hence predictability is at distant point from fix result. Also a businessmanager should take decisions based on uncertain predictions when the market for new product isconsidered.

Examples:

1. “A bag has 3 white, 2 red and 7 black marbles. A marble is selected randomly. What is thepossibility of selecting a black marble in the event?”

Solution: Total number of marbles = 3+2+7= 12P (B) = 7/12.

2. “Six balls in a bag: 2 white, 3 blue and 1 yellow. Two balls are drawn randomly one after theother. What is the probability that the first ball is white, and the second ball is white?”What we know: Define A = the event the first selected ball is white,

B = the event the second selected ball is white.

What we want: ( ).P A B

Solution: Since P (A) is easy to find (2/6) and P(B|A) is easy to find (1/5), we use the formula:

( ) ( ) ( | ) (2 / 6)(1/ 5) 1/15 0.067P A B P A P B A

3. “A letter is selected randomly from the word “ASSASSINATION”. What will be the probabilityif the letter is (i) a vowel (ii) A constant”

Solution: ASSASSINATION

Page 170 of 248

Page 176: Self Learning Material Artificial Intelligence

Total number of letters: 13

Vowels are A, A, I, A, I, O

Therefore, number of vowels= 6

Therefore, probability of choosing a vowel= 6/13

Constants are S, S, S, S, T, and N

Number of constants=7

So, Probability of choosing a constant= 7/13

10.4.4. Advantages of Probability

Here is the description of the sampling methods:

1. The Probability sampling is independent from existing details.2. It provides an idea about result which should be unbiased and have measurable precision.3. The probability sample is used to compare the efficiency of different samples.

10.4.5. Disadvantages of probability

1. It is a time consuming and tedious process.2. Probability theory and its applications are hard to understand and use.3. It does not provide a proper fix result means the output of a problem is represented in between 0

and 1.4. Heterogeneous samples are required to draw a proper conclusion for a particular kind of problem.5. The result of a problem related to probability can’t be generalized to a great extent.6. As it is known as game of chance also, uncertainties are inherited in this branch of study.

Check your progress/ Self-assessment questions

Q4. What do you mean by the concept of Probability?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q5. Define Sample.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q6. Define Experiment.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 171 of 248

Page 177: Self Learning Material Artificial Intelligence

Q7. “A pile contains 9 papers of which 4 are red, 3 are blue and 2 are yellow. A paper is drawn at randomfrom the pile. Calculate the probability that it will be yellow”.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q8. “A pile contains 9 papers of which 4 are red, 3 are blue and 2 are yellow. A paper is drawn at randomfrom the pile. Calculate the probability that it will be red.”

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q9. “If 2/11 is the probability of an event, what is the probability of that event ‘not X’.”

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

10.5. Bayes TheoremThe concept of Bayes' theorem is provided the British statistician, Thomas Bayes.

Fig: 10.2: Rev. Thomas Bayes (c. 1701 – 1761)

This concept or theorem makes probability calculations after re-evaluating probabilities when yieldingstate-of-art information in a very useful phase of analysis of probability.

Fig: 10.3: Concept of Baye’s Theorem

PosteriorProbabiliti

es

Application ofBayes’Theorem

NewInformation

PriorProbabilities

Page 172 of 248

Page 178: Self Learning Material Artificial Intelligence

When given “P(A)” and “P(AB)”, we can calculate “P(B/A)” by manipulating the information in theproduct Rule. Also, we cannot calculate P (A/B).Similarly, when given “P(B)” and “P(AB)”, we can calculate “P(A/B)” by manipulating theinformation in the product rule. P (B/A) cannot be calculated in this case. In this situation, we can applyBayes’ Theorem.

In case of “Two Event Case”:

“P(A1/B) = P(A1)P(B/A1)

P(A1)P(B/A1) + P(A2)P(B/A2)

P(A2/B) = P(A2)P(B/A2)

P(A1)P(B/A1) + P(A2)P(B/A2)”

In case of “Multilevel Case”:

“P(Ai/B) = P(Ai)P(B/Ai)

P(A1)P(B/A1) + P(A2)P(B/A2) + … + P(An)P(B/An)”

A whole new approach to statistics develops from Bayes' Theorem despite its simplicity.

Examples related to Bayes Theorem:

1. A man has undertaken a job. The probabilities are 0.63 that there will be strike. , 0.80 that the jobwill be completed on time if there is no strike, and 0.32 that the contractor job will be completed ontime if there is a strike. Determine the probability that the contractor job will be completed on time.

Page 173 of 248

Page 179: Self Learning Material Artificial Intelligence

Answer to this question is explained as: “Let A be the event that the corresponding job will becompleted on time, and B be the event that there will be a strike.

Now P (B) =0.65

P (no strike) = P (B’) = 1-P (B) = 1-0.65=0.35

P (A | B) = 0.32 P (A| B’) = 0.80

Since events B and B’ form a partition of the sample space S,

Therefore, by theorem on total probability, we have

P (A) = P (B) P (A | B) + P (B’) P (A| B’)

= 0.65 X 0.32 + 0.35 X 0.8 = 0.208 + 0.28 = 0.488

i.e. that the probability that the construction job will be completed in time is 0.488”

So, Simply Bayes rule-based systems are not appropriate for uncertain reasoning:

1. Knowledge acquisition is very rigid.2. Too many-probabilities required.3. Calculation time is too large.4. Updating new information is hard and time consuming.5. Humans are not good probability estimators.

Check your progress/ Self-assessment questions

Q10. Who gave the concept of Bayes theorem?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q11. For how many cases, the Bayes Theorem can be applied?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q12. State Bayes formula for multi-event case.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q13. Write two disadvantages of Bayes Theorem.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 174 of 248

Page 180: Self Learning Material Artificial Intelligence

10.6. Bayesian Belief Networks

10.6.1. Introduction

Knowledge can be represented using network structures which can be illustrated or shown in the form ofgraphs that exhibit correlations and interdependencies among different but related pieces of knowledge.

Fig: 10.4. An example of Bayesian Belief Network.

10.6.2 Definition of Belief Networks

When number of events got dependent on each other and the concept of conditional probability is usedbetween them, them the network of these events is known belief network. It is used to find the actualrelationships between various samples.

The majority of work done in this area is to develop a formal/ general syntax and semantics for suchrepresentations. Typically, we use associative networks and conceptual graphs for this purpose. Networkrepresentations are commonly used to depict the degree of belief of propositions and the casualdependencies that exists between them. The decision making process of a belief network is related to theprobability and the given information through number of network nodes. These nodes could be inputnode or conclusion nodes.

The network representation of uncertain dependencies is motivated by observations.

10.6.3. Applications of Bayesian Belief Networks

Bayesian networks have following applications in are of artificial intelligence:

1. Bayesian belief networks are useful in analysis of participatory Systems.

2. They are easy to design for non-modelers –visuals.

Page 175 of 248

Page 181: Self Learning Material Artificial Intelligence

3. Bayesian belief networks serves as perfect integrating models i.e. different forms of data and

information can be represented by them.

4. They possess ability to link qualitative and quantitative factors of data in one model.

Fig: 10.5. Bayesian networks and their relationships with other fields.

5. Bayesian belief networks can represent complex data and information in a very efficient way.

6. They have the ability to quantify uncertainties through the use of probability.

7. Belief networks can be easily managed, updated and configured through the use of neural

networks.

8. They do not use trial and error method i.e. they perform, every task systematically.

9. They can rapidly perform diagnostic and sensitive analysis.

10. They are useful in developing strategic and operational plans.

Check your progress/ Self-assessment questions

Q13. Knowledge can be represented using ………. structures which can be illustrated or shown in theform of ………….

Q14. Define Bayesian Belief Networks.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q15. Write any four uses of Belief Networks.

Page 176 of 248

Page 182: Self Learning Material Artificial Intelligence

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

10.7. “Default Reasoning”A most important type non-monotonic reasoning is known as default reasoning. Here we want to sketch

conclusions based on what is most probably to be correct.

The following two strategies are used in this scenario:

1. Non-monotonic logic.

2. Default Logic.

Non-monotonic reasoning is common depiction of a class of reasoning.

Non-monotonic logic is a particular theory. The same is considered for Default reasoning and default

logic.

Non-Monotonic Logic:

Non- Monotonic logic is an extension to first order predicate logic.We deal with general knowledge andexceptions in this type of logics. When exception i.e. the expected results are not known then we usegeneral knowledge to make usual assumptions about data. Default reasoning is non-monotonic whichprevious results of our activities and calculations are not stored in the memory. When we add thatsomething is exceptional, we can’t conclude what we did before.A default is expressed asFormula:

a(x): Mb1(x),…,Mbk(x)

c (x)

Where a (x) is a precondition well-formed formula for the conclusion well-formed formula c(x), M is aconsistency operator and the b1(x) are conditions, each of which must be separately consistent with theKB of the conclusion c (x). As an example, suppose we wish to make the statement, “If x is an adult andit is consistent to assume that x can drive, and then infer that x can drive.” Using the above formula thiswould be represented as

ADULT (x): MDRIVE (x)

DRIVE (x)

Default theories consist of a set of axioms and set of default inference rules with schema like formula10.1. The theorem derivable from a default system is those that follow from the default rules.

Suppose a KB contains only the statements

Page 177 of 248

Page 183: Self Learning Material Artificial Intelligence

BIRD (x): MFLY (x)

FLY (x)

BIRD (tweety)

A default proof of FLY (tweety) is possible. But if KB also contains the class

OSTRICH (tweety)

OSTRICH (x) FLY (x)

FLY (tweety) would be blocked since the default is now inconsistent.

Default rules are especially useful in hierarchical knowledge bases. Because of the default rulesare transitive, property inheritance become possible. For example, in a hierarchy of living things, anyanimal could inherit the property has-heat from the rule∀ANIMAL (x) HAS –HEART (x)

Transitivity can also be a problem in knowledge bases with many default rules. Rule interactions canmake representations very complex.

Check your progress/ Self-assessment questions

Q16. “Default reasoning” is very general form of…………………… reasoning.

Q17. “Non-monotonic reasoning” is common depiction of a class of ………………

Q18. Define Non- Monotonic reasoning.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q19. Write formula to depict a default expression.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

10.8. Summary.

This chapter basically deals with the concept of statistical reasoning and probability. Probability is agame of chance and plays a pivot role in the field of artificial intelligence. Theconcept of reasoning and chance is deeply connected to probability. Bayes theorem provides a strongbase to probability in which multiplication rule is widely used. These all concepts form a major part ofknowledge representation, organizing, editing and manipulation in artificial intelligence. Next, we dealwith Bayesian belief networks that represent knowledge in the form of directed graphs. Bayesiannetworks have some features of first order predicate logic and large applications in logical reasoning. Thelast topic of tis chapter is default reasoning which is also an integral part of logic in artificial intelligence.This chapter provides a comprehensive study of probability theory and belief networks in lieu ofArtificial intelligence. Artificial intelligence theory of concept largely depends on environment factors

Page 178 of 248

Page 184: Self Learning Material Artificial Intelligence

and various types of logics and reasoning. So, this chapter provides a required basis of these stratifiedsampling concepts in case of AI.

10.8. Glossary

Reasoning – Reasoning is the act of deriving solution from certain premises using a given methodology.

Statistical Methods – Statistical methods give a method for showing principles that is not certain i.e.uncertain but for which they may be some assisting confirmation.

Probability: A game of chance.

Sample Space: The set of all possible events is called the sample space.

Experiment: An experiment is a procedure that yields one of a given set of possible outcomes.

Bayes Theorem: This concept or theoremmakes probability calculations after re-evaluating probabilitieswhen yielding state-of-art information in a very useful phase of analysis of probability.

Bayesian belief network: When number of events got dependent on each other and the concept ofconditional probability is used between them, the network of these events is known belief network. It isused to find the actual relationships between various samples.

Default reasoning: A general form of “non-monotonic reasoning”.

10.9. Answers to check your progress / self-assessment questions

8. Reasoning is the act of deriving solution from certain premises using a given methodology.

9. Genuine Randomness and Exceptions.

10. Exceptions.

11. Probability: “The probability of an uncertain event A is a measure of the degree of likelihood ofoccurrence of that event. It is a game of chance.”

12. Sample Space: The set of all possible events is called the sample space.

13. Experiment: An experiment is a procedure that yields one of a given set of possible outcomes.

14. 2/9

15. 4/9

16. 9/11

Page 179 of 248

Page 185: Self Learning Material Artificial Intelligence

17. Thomas Bayes

18. Multiple – event cases19. “P(Ai/B) = P(Ai)P(B/Ai)

P(A1)P(B/A1) + P(A2)P(B/A2) + … + P(An)P(B/An)”

20. Network, graphs.

21. When number of events got dependent on each other and the concept of conditional probability isused between them, them the network of these events is known belief network. It is used to findthe actual relationships between various samples.

22. 1. They have the ability to quantify uncertainties through the use of probability.2. Belief networks can be easily managed, updated and configured through the use of neuralnetworks.3. They do not use trial and error method i.e. they perform, every task systematically.4. They can rapidly perform diagnostic and sensitive analysis.

23. Non-monotonic.

24. Reasoning.

25. Non-monotonic reasoning is common depiction of a class of reasoning. Non-monotonic logic is aparticular theory. The same is considered for Default reasoning and default logic.

26. a(x): Mb1(x),…, Mbk(x)

c (x)

10.10. Model Questions

1. Explain the concept of statistical reasoning.

2. Discuss the concept of probability along with its basic terminology in detail.

3. Why Bayes theorem is used. Derive its formulas.

4. What is the concept of Bayesian Belief Networks? Discuss its applications.

5. Explain the concept of Default reasoning in detail.

Page 180 of 248

Page 186: Self Learning Material Artificial Intelligence

LESSON 11

Fuzzy Logic and Fuzzy Sets

Structure of the Lesson

11.0. Objectives.

11.1. Introduction to Fuzzy Logic.

11.2. History of Fuzzy Logic

11.3. Important Milestones in Fuzzy Logic

11.4. Facts about Fuzzy Logic

11.5. Why Use Fuzzy Logic?

11.6. Features of Fuzzy Logic.

11.7. Advantages and Disadvantages of Fuzzy Logic.

11.8. Fuzzy Sets.

11.9. Crisp Sets.

11.9. 1 Representation of Crisp Sets11.9.2. Operations on crisp Sets

11.10. Difference between Crisp Sets and Fuzzy Sets.

11.11. Fuzzy Set Operations.

11.12. Various Laws of fuzzy logic

11.13. Summary

11.14. Glossary.

11.15. Answers to check your Progress

11.16. Model Questions.

11.0. Objectives.

After completing this chapter, the student will be able to understand:

The concept of fuzzy logic.

History, milestones and important facts of Fuzzy Logic

Features and Uses of fuzzy logic.

Advantages and Disadvantages of Fuzzy Logic.

Fuzzy Sets and Crisp Sets

Difference between Crisp Sets and Fuzzy Sets.

Page 181 of 248

Page 187: Self Learning Material Artificial Intelligence

11.1. Introduction to Fuzzy Logic

It represents human knowledge in specific domain of the application for useful actions. In “Fuzzy logic”,the refined information storage is represented by “if-then rule” i.e. based on conditional as well asunconditional statements. In case of Bivalent logic, i.e. probability of having two states either 0 or 1 i.e.the element in a set is either inside or outside the set.

But in case of Fuzzy logic the membership value lies in between 0 and 1. It was first developed by Zadehwhich is known as Father of Fuzzy logic in 1960’s, for representing some types of approximateknowledge. Fuzzy logic is an advanced version if Boolean logic which can handle approximateknowledge.

Fig: 11.1 Lotfi Zadeh (Father of Fuzzy Logic)

Fuzzy set theory is represented by membership function. The value or membership function tells thepossibility of any random value that resides within the set. So, we can say that it is a possibility function.It does not act as a probability function. If the value of a membership function is zero, then it is not amember of Fuzzy set. If the value equals to unity (1) then the corresponding element is definitely withinthe set. Closer the value of membership function, closer is to the belonging value.

11.2. History of Fuzzy Logic:

Page 182 of 248

Page 188: Self Learning Material Artificial Intelligence

A Polish philosopher Jan Lukasiewicz introduced Fuzzy, or multi-valued logic in 1930.The traditionallogic operates with only two values 1 (true) and 0 (false), whereas Fuzzy logic deals with values between0 and 1.

Fig: 11.2. Jan Lukasiewicz

For example, the possibility that “a man 161 cm. tall is really tall might be set to the value of 0.61”. It islikely that man is tall.

Fig: 11.3. Fuzzy vs. Non-Fuzzy System

Lotfi Zadeh published his famous paper ‘Fuzzy Set’ in 1965 and this research gave birth to a new branchof logic which is now known as “fuzzy logic.”

The idea of this multi valued logic was developed by Zadeh in 1960 at University of California. In 1964he worked on a patent recognition as well as classification problem, which is basically linked with neural

Page 183 of 248

Page 189: Self Learning Material Artificial Intelligence

network. He defined a category, i.e. impreciseness for certain problems. It is also based on duplicate dataaccording to application.

11.3. Important Milestones in Fuzzy Logic

1. The first milestone was a controller whose basic function was to control a steam generator i.e.used in the steam engine for controlling the speed of the train.

2. Another milestone in the history of Fuzzy logic is the first “VLSI chip” for performing Fuzzylogic inference i.e. developed by “Motogai & Hwatanate” in 1986. This VLSI chip was designedto advance the functions of real time applications based on multi valued logic. It is basically usedin MATLAB i.e. mathematical lab for evaluating neural network problem. It was introduced in1994.

3. Another important research in Fuzzy logic identified increasing visibility of neural network in1980 for Neuro Fuzzy Technique. The most important outcome of this trend is the developmentof various techniques for identifying the milestones in a Fuzzy System with neural networklearning of neurons from previous neurons. The various combinations of neural networks, geneticalgorithms and Fuzzy logics help people from conventional methodology i.e. introduced the termsoft computing in early 1990’s.

Check your progress/ Self-assessment questions

Q1. What do you mean by Bivalent Logic?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q2. Define Fuzzy Logic.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q3. Who is considered as Father of Fuzzy Logic?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q4. What is the role of Jan Lukasiewicz in development of Fuzzy Logic?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

11.4. Facts about Fuzzy Logic

Page 184 of 248

Page 190: Self Learning Material Artificial Intelligence

1. Fuzzy logic and probability are computing techniques, but only one of them can be used to solve agiven problem.

2. Fuzzy logic is a clever measure of probability theory. In case of probability where actual outcomeis known but Fuzzy logic measures the degree to which outcome belong to element.

3. Fuzzy logic deals with narrow sense with multi value logic by introducing Linguistic variables forcompetition.

4. Fuzzy logic is a model less approach and does not required good understanding of the problem.The term modeless refers to fact that the design of Fuzzy logic control does not require anymathematical level.

5. Fuzzy logic controller cannot show to be stable because it can deal with multiple problems thatmay have a same application i.e. major advantage over conventional approach. It is bettertechnique for evaluating multiple problems but we have that software that deal with multipleapplications.

11.5. Why Use Fuzzy logic?

This type of logic is used to design to develop static and dynamic systems for “embedded control”. It is agroup of multiple applications in which it can enhance by combining multiple feature in a sampleapplication.

For this purpose, we deal with following five steps:

1. We can yield better performance of a system by reducing development cost and time.

2. Next we deal with sensors technology to configure mistakes and errors in the system if anywhere iscommitted manually. This service is provided by the concept of “membership functions”. Sensors help innumber of activities like planning, sensing and detecting errors and also they provide ways to deal withthese kinds of exceptional conditions.

3. Next, we develop linear simplified version of controller.

4. After developing the controller model, an algorithm is designed for its working.

5. The last step is to implement this algorithm to solve a particular problem like controlling an embeddedsystem. If the system is not satisfactory, then we try to redesign the whole system again. This involvesproper SDLC process again along with the use of axioms and parameters of “fuzzy logic”

By using Fuzzy logic approach we can redesign the entire controller with Fuzzy rule based system.

11.6. Features of Fuzzy Logic

1. Fuzzy logic helps in generating correct output from incomplete data.2. It does not solely depend on feedback inputs, multiple control outputs for its implementation.3. Number of inputs can be used in it to generate one or more outputs due to its rule-based nature.4. It can control “nonlinear system”which is very difficult or impossible to solve and map

mathematically.

Page 185 of 248

Page 191: Self Learning Material Artificial Intelligence

5. It is based on the degree of membership through which the application can evaluate.6. Any type of logic system can be used for “fuzzification”.7. It acts as a process of propagation with elastic constraints.

In case of fuzzy logic, the first step is to understand the behavior of knowledge which describes theprincipals of controls in terms of input and output. The last step is to simulate the design& if theperformance is not satisfactory, we only need to modify fuzzy rules and retry with same approach. It willhelp in multiple benefits such as reduce development time and simpler design methodology.

1. REDUCE DEVOPMENT TIME

We can eliminate redundant steps i.e. the steps which occurred again and again in the program and thusconsume extra time and space in the system by using it. We can modify the rules and reduce the lifecycleof a program in lieu of its running time by making changes in the compiler and it can be make possiblewith the help of applications of “fuzzy logic” .Controllers can be redesigned entirely and thus it results inproper functioning of the system with ease and preciseness of operations. Also, the fuzzy is rule based,sowe do not need to be expert in any language. Hence, it lowers down the speed the overall developmentcycle.

2. SIMPLE DESIGN METHODOLOGY

We can design a system using our own experience which we gained from our interactions with previoussystems and for its designing we can make use of natural language like English. “Fuzzy Logic” makes avery complex system a very easy one for understanding and designing. Its rules are very easy to learn.So, we can say that Fuzzy logic simplifies the design complexity as compared to conventional approach.

11.7. Advantages and Disadvantages of Fuzzy Logic.

Like other concepts, fuzzy logic has its own advantages and disadvantages:

Advantages of Fuzzy Logic:

1. It can handle incomplete information.2. It is a technique of soft computing.3. It is useful in representing and processing human knowledge.4. Approximate reasoning is possible with linguistic knowledge.5. No need of external languages.

Disadvantages of Fuzzy Logic:

1. It may introduce a degree within accuracy.2. It may be of slow process because of multi values.3. It needs knowledge and experience of problems by generation knowledge base.

11.8. Fuzzy Sets

Page 186 of 248

Page 192: Self Learning Material Artificial Intelligence

In the conventional approach where each set having a group of elements under some constraints, so itdeals with crisp logic for the evaluation. It is a logic technique that is useful for representing knowledgein control systems. Knowledge is represented by statement which may be joined together using multipleconnections. It may be process through reasoning by the various laws of logic. “Fuzzy Set Theory” wasformalized by Professor “Lotfi Zadeh” at the University of California in1965. .

Check your progress/ Self-assessment questions

Q5. Fill in the blanks:

1. Fuzzy logic is a clever measure of …………………………………………… theory.

2. Fuzzy logic is a ………………………..approach.

3. By using Fuzzy logic, designer can ……………. development cost and having………………performance.

Q6. What is the main reason to use Fuzzy Logic?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q7. Write any two advantages of Fuzzy Logic.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q8. Write any two disadvantages of Fuzzy Logic.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

11.9. Crisp Sets.

It is a collection of elements with a crisp boundary which may be represented by Venn diagram. For example: - Asymbol A denotes a set and set is denoted by X that is the largest set that could be considered in the system. Itcontains all possible values or elements and there cannot be any element outside it. The null set is denoted by Ø.

11.9. 1 Representation of Crisp Sets

Crisp sets can be represented as1. Enumeration = A= {a1, a2…an}2. Description= A= {x | p(x)}

Page 187 of 248

Page 193: Self Learning Material Artificial Intelligence

3. Characteristic function

1( )

0A

x Am x

x A

Fig: 11.4. Universal Set

11.9.2. Operations on crisp Sets

(1) MEMBERSHIP FUNCTION

It is mixture of multiple sets according to subset technique.

(2) COMPLEMENTATION

It is proportional to the initial sets having not all the members.

A complement of set A is set formed by all the elements outside A. It is denoted by A’.

Fig: 11.5. Complement of a Set

(2) UNION OPERATION

The union of two sets A and B is formed by all the elements in A and B. It is denoted by AUB. i.e. logical ORoperator.

A X A

Fig: 11.6. Union of two SetsPage 188 of 248

Page 194: Self Learning Material Artificial Intelligence

(3) INTERSCTION

It is set formed by all the elements that are common to bothA and B. It is denoted by A∩B i.e. logical AND operator.

Fig:11.7 Intersection of two Sets.

(4.) SUBSET

A set ‘A’ is subset of another set ‘B’ if all the elements in A contains in B. This is denoted by “A⊆B”. If A issubset of B and B is not subset of A then A is called to proper subset of B and denoted by A ⊂B.

Fig: 11.8 Concept of Subset

(5) SUBTRACTION:

The difference of set A with respect to set B is the collection of all the elements in universe that belongs to A butdo not belong to B. It is denoted by A-B.

Page 189 of 248

Page 195: Self Learning Material Artificial Intelligence

A crisp set is a collection of objects which share certain characteristics. .It is defined into two groups:members and non-members. The collection of elements in a universe is called whole set.

“An object X is a member of set A i.e. x ∈ B and if it is not a member of A, then x∉ A.”11.10. Difference between Crisp Sets and Fuzzy Sets.

Crisp set is based on classical set theory where multiple operations can be performed according to its value, while

“fuzzy sets convert the concept of Fuzzy Logic into algorithm”. It is a way to which we can extend. In other words,

it acts as human thinking through which data can be transfer to the computer.

It is aset of rules which define boundaries and instruct us how to solve problems. For example: The use of a

transistor instead of vacuum tubes i.e. development of Fuzzy. With the help of these technologies we can reduce

the size of application by decomposing each and every fragment into small modules and integrate them together

into more generalize systems.

For example: - Conversations of Super Computers to laptops for fuzzy logic can perform useful operation for

reducing external structure.

For the calculation of temperature in a room with respect to coldness, hotness with its variability by using the crisp

function according to which it is based on pipeline logic while fuzzy logic based on transitions from one stage to

another . It will not work abruptly because the variation in the temperature works slowly according to the

environmental structure.

Fig:11.9 Subtractions of Sets

Fig:11.10 Differentiate Crisp and Fuzzy Set

Page 190 of 248

Page 196: Self Learning Material Artificial Intelligence

Fig:11.11 Representing Fuzzy Values At Diff Temperatures

The most limiting feature of Bivalent sets is mutually exclusive nature i.e. it is based on the temperaturerather than the membership value. This phenomenon can be moved to fuzzy t according to the variationin the temperature.

11.11. Fuzzy Set Operations.

Fuzzy set is a tool through which we can convert the concept of fuzzy logic into algorithm. It is a way

through we can extend the binary logic and unable to take human like decisions. In other words it acts as

human thinking through which data can be transferred to the computer. Let A and B be fuzzy sets in

universe. For a given element x the operation like union, intersection and complement can be defined.

Union Fuzzy Operation

The “union of fuzzy sets A and B” is denoted by AUB i.e. the maximum value of membership function

between two sets.

Fig:11.12 Fuzzy Union Operation.

Fuzzy Intersection Operation

Page 191 of 248

Page 197: Self Learning Material Artificial Intelligence

The “intersection of fuzzy sets” A and B is denoted by A∩ B i.e. the common part between two fuzzy

sets. It represents the minimum value of membership function between two sets.

Fig:11.13 Fuzzy Intersection Operation

Fuzzy Complement

The “complement of fuzzy set” contains all these values that do not lie within the set. It will require only

a single set for evaluating it.

Page 192 of 248

Page 198: Self Learning Material Artificial Intelligence

Fig:11.14 Fuzzy Complement Operation

Examples:

1. Find the power set having three elements {1, 2, 3} in it.

Solution: A= {1, 2, 3}

P (A) = { {Ø } , {1},{2}, {3}, {1,2}, {1,3, {1,2,3}}

2. Given two fuzzy sets:A= {1/3, 0.2/3, 0.3, 0.6/6}B= {0.2/3, 0.3/4, 0.4/5, 0.5/6}Apply union, intersection and complement operations.

Solution:

UNION:-

AUB= {1/3, 0.3/4, 0.4/5, 0.6/6}

INTERSECTION

A ∩ B= {0.2/3, 0.2/4, 0.3/5, 0.5/6}

COMPLEMENT:

A’= {2/3. 3.8/4, 4.7/5, 5.4/6.}

B’= {2.8/3, 3.7/4, 4.6/5, 5.5/6}

11.12. Various Laws of fuzzy logic

1. “IDEMPOTENT LAW”:

A + A = A

A X A =A

2. “COMMUTATIVE LAW”:

A +B =B+A

A X B =B X A

Page 193 of 248

Page 199: Self Learning Material Artificial Intelligence

3. “ASSOCIATIVE LAW”:

(A+B) + C= A + (B+C)

(AXB) X C= A X (BXC)

4. “ABSORPTION LAW”:

A + (A X B) =AA X (A + B) =A

5. “DISTRIBUTIVE LAW”:

A + (B X C) = (A+B) X (A+C)

A X (B + C) = (AXB) + (AXC)

6.“DEMORGAN’S LAW”:

(A+B)’ =A’ X B’

(A XB)’ =A’ + B’

11.13. Summary

This chapter deals with fuzzy logic in which the output can lie between 0 and 1 or we can say that fuzzy logic is

the extended version of traditional set theory. Lotfi Zadeh which is known as Father of Fuzzy logic in 1960’sproposed it, for representing some types of approximate knowledge. Fuzzy logic is an advanced versionof Boolean logic which can handle approximates knowledge. By using Fuzzy logic approach we canredesign the entire controller with Fuzzy rule based system.This chapter also deals with the concept of fuzzy sets.

11.14. Glossary

Fuzzy Logic–It represents human knowledge in specific domain of the application for useful actions.Crisp Set –It is a collection of elements with a crisp boundary which may be represented by Venn diagram.

11.15. Answers to check your progress / self assessment questions

27. The logic which deals either with 0 or 1.

28. The logic in which the truth values of variables may be any real number between 0 and 1.

29. Lotfi Zadeh.

30. He introduced Fuzzy, or multi-valued logic in 1930.

31. 1. Probability 2. Model less 3. Lower, higher

Page 194 of 248

Page 200: Self Learning Material Artificial Intelligence

32. To yield lower cost and higher performance in the development of products.

33. Advantages of fuzzy logic:

a. It can handle incomplete information.

b. It is a technique of soft computing.

34. Disadvantages of Fuzzy Logic:

a. It may introduce a degree within accuracy.

b. It may be of slow process because of multi values.

11.16.Model Questions

1. What do you mean by “Fuzzy Logic”?

2. Describe the history of Fuzzy Logic.

3. Explain the various facts of fuzzy logic.

4. Why there is a need of fuzzy logic?

5. Discuss various features of fuzzy logic.

6. Describe the advantages and disadvantages of fuzzy logic.

7. Explain fuzzy sets in detail.

8. What is the difference between “fuzzy set and crisp set”?

9. Discuss various operations that can be applied on Fuzzy Sets.

10. How fuzzy operations differ from crisp operations?

11. Discuss the role of membership function in Fuzzy Logic?

12. Describe various identities of Fuzzy Logic.

Page 195 of 248

Page 201: Self Learning Material Artificial Intelligence

LESSON12 : Expert Systems

Structure of the Lesson

12.0. Objectives.

12.1. Introduction toExpert Systems.

12.2. History of Expert Systems.

12.3. Definitions of Expert Systems.

12.4. Features of an Expert System.

12.5. Components of an Expert System.

12.6. Categories of Expert systems.

12.7. Concept of Knowledge base in Expert System.

12.7.1. Knowledge based expert systems.

12.7.2. Knowledge representation in Expert Systems.

12.7.3 Development of Expert Systems.

12.8. Strategies used in Expert Systems.

12.9. Merits and Demerits of Expert Systems.

12.9.1 Merits of Expert Systems.

12.9.2 Demerits of Expert Systems.

12.10. Applications of Expert Systems.

12.11 The Expert System Business.

12.12. Summary.

12.13. Glossary.

12.14. Answers to check your Progress/ Self-Assessment Questions.

12.15. Model Questions.

12.0. Objectives.

After completing this chapter, the student will be able to understand:

Introduction of Expert Systems.

Meaning of Expert Systems.

History of Expert Systems.

The Characteristics, components and kinds of Expert System.

Definitions of Expert Systems.

Importance of Knowledge Base in Expert Systems.

Page 196 of 248

Page 202: Self Learning Material Artificial Intelligence

Strategies used in Expert systems.

Advantagesand Disadvantages of Expert Systems.

12.1 Introduction

This chapter deals with the basic structure of knowledge –based systems i.e. expert systems.

These are computer programs and latest product of Artificial Intelligence. They came into existence asuniversity research projects from 1960s to 1970s. They evolved as one of the important innovations ofAI.

Expert systems are considered as precise and accurate systems in number of task domains which requiresexpert advice. They have limitless applications:

Figure 12.1 Some Areas of Artificial Intelligence

12.2 Definitions of Expert System

1. The expert systems solve complex problems in a very easy way which matches level of humanintelligence and expertise.

2. An expert system cans perform a task that can be solved by a living expert.

3. An Expert System is a piece of software which uses stored information and convert it into usefulknowledge and make decisions and give advices to its clients.

4. An Expert System uses historical information and derives solutions to problems in a specific taskdomain along with decisions. .

Page 197 of 248

Page 203: Self Learning Material Artificial Intelligence

12.3 History of Expert Systems

S.No. Year Expert System Location Purpose1. 1960 DENDRAIL Stanford

UniversityDetermine thestructure ofchemicalcompounds.

2. 1970 MYCIN StanfordUniversity

Diagnoseinfectious blooddiseases

3. 1975 PROSPECTOR StanfordUniversity

Assist Geologistsin discovery ofmineral deposits

Check your progress/ Self-assessment questions

Q1. List some areas of Artificial Intelligence.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q2. Define Expert system.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q3. Name any three expert systems. What was the purpose of MYCIN?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

12.4 Features of an Expert System

An expert system should have the following characteristics:

1. Great Response: The expert system performs in a more precise manner than a human expert with the

production of precise and accurate decisions. The results of an expert systemshould match or more

accurate than that of an expert in the field. It means, the quality of the output given the system should be

unique and great. It means one could expect good response.

Page 198 of 248

Page 204: Self Learning Material Artificial Intelligence

2. Decent Response Time: The expert system should produce result in a very short time. It should take

reasonable time to take a decision. If it takes very long time i.e. a year to reach a decision would not be

very useful.

3. Soundness: It must be complete and sound i.e. its output should be verifiable by using mathematical

tools and holistic in the sense that it can serve full response to specifications. It should not be error prone.

Security of knowledge is the primary concern in developing these systems.

4. Understandable. The system must explain the steps of its working and reasoning i.e. Logic behind its

decision making power.Also, the output given by it should be understandable. The system should have an

explanation capability like human beings i.e. they must support their decisions and advices as human

beings do.

12.5 Components of an Expert System

An expert system has following components:

1. The Knowledge Base

Knowledge Base is the component of Expert System where the information is stored in the form of facts

and rules. In knowledge base the knowledge engineer writes the code for the expert system.

Syntax of Writing rules for Knowledge Base:

IF <assertion > THEN <decision>

The assertion acts as a precondition which needs to be true. When the assertion is fulfilled, the rule is

executed.

Page 199 of 248

Page 205: Self Learning Material Artificial Intelligence

Figure 12.2 Some Areas of Artificial IntelligenceComponents of an Expert System

2. Agenda

Rules are added to a queue data structure which is known as agenda after being satisfied. Order plays a

very little role in an expert system therefore knowledge bases are not expected to be ordered and as a

result rules may be fired in any order.

3. The User Interface

This component helps theuser to interact with the expert system. With the help of User Interface,

decisions are taken out according to asked questions. . User can interact with expert systems throughin

number of ways.

4. Inference Engine

The inference engine acts as a heart of any expert system. It is the back bone of any expert system. It

usesguidelines from the agenda to take decisions i.e. to inference an advice or output. If there are no

guidelines on the agenda, the inference engine contacts with user in order to add them. It uses knowledge

base toproduce output.

Page 200 of 248

Page 206: Self Learning Material Artificial Intelligence

Check your progress/ Self-assessment questions

Q4. Name different components of Expert System.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q5. What do you mean by Knowledge Base?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q6. What does Inference engine?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

12.6 Categories of Expert System

There are 4 categories of expert system:

1. Classification.2. Diagnosis.3. Advice.4. Planning.

12.7 Knowledge Base in Expert Systems

Knowledge Base stores knowledge about a particular field. Knowledge is recommended to represent

intelligence. The achievement of any Expert System mainlycenters on large collection of quality

knowledge.

What is Knowledge?

The data refers to raw facts and figures. Data produce information after processing. Knowledge is the

refined form of information. The combination of Data, information, and past experience.

Data Information Knowledge

Constituents of Knowledge Base

Page 201 of 248

Page 207: Self Learning Material Artificial Intelligence

Factual Knowledge − The Knowledge which depends on facts, rules and proofs is known as

factual knowledge. Knowledge Engineers and data scientistsuse it to represent and solve a

particular kind of problem in Expert System. Factual knowledge plays a vital role in the

knowledge base as its existence can be reasoned and proved.

Heuristic Knowledge –Heuristic knowledge is based on hypothesis. It is about exercising the old

assertions, statements, viewpoints and accurate judgment

Knowledge illustration

Knowledge illustration means knowledge representation which means organizing and formalizing

knowledge in the knowledge base. The knowledge is represented in the form of IF-THEN-ELSE rules.

Knowledge Recovery

Knowledge recovery refers to a process of gathering knowledge from number of heterogeneous

resources. These resources could be books, journals, research papers, own experiences and some one’s

recorder past experiences .Knowledge acquisition explain how knowledge is taken from human before it

is stored within a computer.

The success of expert system centers on the quality, completeness, and accuracy of the information

stored in the knowledge base.

The knowledge base is formed by Knowledge Engineers.

12.7.1 Knowledge-based Expert System

The user provides relevant information to the expert system and receives expert advice as output. The

expert system has two main building blocks:

1. Knowledge Base

2. Inference Engine

The knowledge base contains the knowledge which inference engineuse to draws results. These results

are the expert system’s responses to the user’s problems.

Figure 12.3demonstrates the basic functioning of a knowledge-based expert system.

Page 202 of 248

Page 208: Self Learning Material Artificial Intelligence

Figure 12.3 Basic Concept of an Expert System Function

The field of an expert system is known as the area in which it solves specific problems and provides

results. For example, in medical field especially in orthopedics it is used to diagnose fractureswhich

containknowledge about conditions and causesthat caused fractures. In this case, the knowledge field is

medicine and consists of knowledge about fractures along with their surgeries.

Figure 12.4 shows the relationship between the problem and knowledge domain. The knowledgefiled is

presented with in the problem filed. The area outside the knowledge filed depicts a portion in which there

is no knowledge about all the problems.

Figure 12.4A Possible Problem and Knowledge Domain Relationship

Page 203 of 248

Page 209: Self Learning Material Artificial Intelligence

12.7.2. Knowledge Representation inExpert systems

The features of an expert system can be represented in several ways. It can be enveloped in rules andobjects.

The most commonway of representing knowledge in the expert systems is the use of

IF... THEN…ELSE type – rules, for example

IF the light is green THEN move

If a fact exists that the light is green, then this will match the pattern "the light is green." The rule is

satisfied and performs its action of "move." Many important expert systems express the knowledge of

experts in the form of rules. In 1950s and 1960s, the artificial intelligence approach was fully dependent

on logical reasoning rather on knowledge. A few expert systems allow objects as well as rules like

CLIPS. In some expert systems, rules and objects can operate independently.

Expert systems are developed differently from traditional systems as they do not rely on algorithms and

derive their solutions by inference the available information. It must be able to explain its reasoning

because it relies on inference. An explanation facility is an important side of well formulated expert

systems.

12.7.3 Development of Expert systems

The development process of expert systems follows various steps which are summarized as follows:

1. Knowledge Elicitation: First of all, the knowledge engineer interacts with expert in order to gather

knowledge about his/her expertise. This step in System Development Life Cycle is known as

Requirements Analysis and elicitation.

2. Coding: After gathering and acquiring the knowledge from human expert, the knowledge engineer

enters the knowledge in the data base. Coding here means entering knowledge in data base.

3. Knowledge Representation: The most common way of representing knowledge in the expert systems

is the use of IF... THEN…ELSE type – rules.

4. Evaluation: The experience person then evaluates the expert system and evaluates the power and

ability of knowledge engineer.

Page 204 of 248

Page 210: Self Learning Material Artificial Intelligence

The above four steps of developing an expert system repeats until the system’s performance is concluded

by the expert to the satisfactory level. The following figure i.e. Figure 12.5 shows the development of

expert systems:

Figure 12.5 Development of an Expert System

Check your progress/ Self-assessment questions

Q9. What is Knowledge?

------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------------

Q10. Who is known as Knowledge Engineer?

------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------------------

Q11. Name two types of knowledge.

Page 205 of 248

Page 211: Self Learning Material Artificial Intelligence

------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------------

Q12. Fill in the Blank:

____________rule is used for knowledge representation.

Q13. What is Knowledge Acquisition?

------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------------------

12.8. Strategies used in Expert Systems

1. Forward Chaining

Forward chaining is one of the two main methods of reasoning used in an inference

engine. Forward chaining is a very common approach for expert systems, business and production

rule systems.For example, prediction of share market status as an effect of changes in interest

rates.

2. Backward Chaining

An inference engine using backward chaining would search the inference rules until it finds one

which has a THEN clause that matches a desired goal. If the IF clause of that inference rule is not

known to be true, then it is added to the list of goals (in order for goal to be confirmed it must also

provide data that confirms this new rule). In other words, this approach starts with the desired

Page 206 of 248

Page 212: Self Learning Material Artificial Intelligence

conclusion and works backward to find supporting facts. Therefore, it is also known as Goal-Driven

Approach. For example, diagnosis of blood cancer in humans.

12.9 ADVANTAGES AND DISADVANTAGES OF EXPERT SYSTEMS

12.9.1 Advantages:

Expert systems have a number of advantages:

1. Availability: Expert systems are easily available for any suitable computer hardware. High

production of software and applications also increase availability of expert systems in market.

2. Reduced Cost: Expert systems save company’s cost on handling and processing raw and

complex data to take decisions. Hence, expert systems provide an economical advantage to the

business world. Expert systems can be developed at reasonable cost. So, they are highly

affordable.

3. Reduced Risk: Expert systems operatein areas are dangerous for a human.

4. Stability: The expert system works in stable state.They work without being retired, quit, or die.

Their contents lastindefinitely. Also, they work without being emotional, tensed or fatigued.

5. Different views: The information and wisdom of number of experts work at a same time in these

systems. This level of expertise of knowledge may exceed that of a single human expert’s

knowledge.

Page 207 of 248

Page 213: Self Learning Material Artificial Intelligence

6. Reliability: The error rate in case of expert systems is much lower as compared to human errors.

Therefore, Expert systems are more reliable to solve a difficult and complex problem.

7. Explanation: The expert systems explain each and every content of problem in a very detailed

manner and use reasoning and inference techniques to reach on a solution.

8. Quick output: They provide quick response i.e. generate output in a very short span of time.

These Systems speed-up human work by factor of ten and sometimes by a factor of hundreds or

more. Numerous applications and problems need quick response and this requirement greatly

depends on components of this system. The tangible (“hardware”) and intangible (“software”)

components play a pivot role here.

9. Great Guide: The expert system can act as a great and helpful guide by providing suitable sound

and complete axioms to solve a problem in step by step manner.

10. Advanced database. Expert systems can be used to access a database in an advanced way.

11. Quality: Expert Systems produce quality decisions with great precision and accuracy along with

future trends.

12. Preservation: Expert Systems preserve the scarce resources and knowledge of those resources

that are going to retire or die. They then use this information for designing experts systems for

future problems. Knowledge in the expert systems is considered as permanent knowledge which

could be used in many different areas.

13. New Products: Expert systems introduce new products in the market time by time. A good

example of a new product is a pathology advisor that assists in diagnosis of diseased tissues.

12.9.2 Disadvantages:

The disadvantages related with expert systems are:

1. Limited Scope:These systems are limited in their scope and also they do not know their

limitations.

2. No age of capacity: Generally, the expert systems do not know when a problem posed by a user

is outside of capacity of the system.

3. Interaction:These systems face complex interactions when deal with other machines and people.

From a practical perspective, expert systems require complex and subtle interactions between

humans and machines where both learn from each other and accommodate and adapt each other’s

environment and behavior.

Page 208 of 248

Page 214: Self Learning Material Artificial Intelligence

4. Difficulty in Modification: It us very hard to modify the rule set presented in the knowledge base

even for the authors of these rules. So, the expert systems require flexible rule based system.

5. Knowledge Acquisition: Expert systems can capture tangible knowledge but not intangible

knowledge.

Check your progress/ Self-assessment questions

Q14. What do you mean by Preservation Quality?

------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------------------------

12.10. THE APPLICATIONS OF EXPERT SYSTEMS

The applications of expert systems have broadened dramatically since their inception. The applications of

Expertsystems can found in almost every area of business, government, medical and engineering etc.

1. Medical Diagnosis/Engineering Diagnosis

Medical diagnosis was one of the first knowledge areas to which ES technology was applied but

diagnosis of engineered systems quickly replaced medical diagnosis. There are probably more diagnostic

applications of ES than any other type.

2. Planning and Scheduling

These systems are used to plan and schedule the processes of complex and interactive systems. Planning

and scheduling applications of expert systems play a vital role in the commercial area like airline

scheduling of flights, personnel and other planning areas. These applications are having great commercial

potential, which has been recognized. Examples involve manufacturing job-shop scheduling; and

manufacturing process planning.

3. Hardware and software Configurations

Page 209 of 248

Page 215: Self Learning Material Artificial Intelligence

Expert systems are used to configure the solution of a problem which is derived from given set of rules

and constraints. In computer industry, the configuration of hardware and software is done by expert

systems by dividing them into modules. So, expert systems are basically used in manufacturing,

assembling and packaging industries on a great detail.

4. Financial Decision Making

Expert Systems provide financial services on a vigorous scale to the decision makers of a

company.

The advisory programs in expert systems have been created to assist bankers in determining

whether to make loans to businesses and individuals.

Insurance companies have used expert systems to assess the risk presented by the customer and to

determine a price for the insurance.

Foreign exchange trading is a typical application of expert systems in the financial markets.

5. Knowledge Publishing

Knowledge publishing is brand new, but a potentially strong application area of expert systems. The

rudimentary function of the expert system is to deliver knowledge that is relevant to the user's problem.

The two most widely distributed expert systems in the world are in this category.

1. An advisor which counsels a user on appropriate grammatical usage in a text.

2. A tax advisor that accompanies a tax preparation program and advises the user on tax strategy,

tactics, and individual tax policy.

6. Process Monitoring and Control

Expert systems also analyze real-time data with the objective of finding errors, predicting trends, and

controlling unwanted correction.

Steel making and oil refining industries are examples of real-time systems that actively monitor

processes.

7. Design and Manufacturing

Expert system also helps in the design ofhardware components. Their design level ranges from high-level

conceptual design to abstract designs.

Page 210 of 248

Page 216: Self Learning Material Artificial Intelligence

12.11 The Expert System Business

The expert systems are in great demand in the commercials market due to their large applications. The

main perspective of expert system business is providing services on paid terms. In this business of all

kinds of firms are participating.

The business of expert systems in USA in both large and small companies is growing exponentially as

the personnel and financial advisors of large organizations and manufacturing firms seeks expert advices

to top the market and sustain and maintain their position.

12.12. Summary

Expert and other knowledge-based systems are usually composed of at least a knowledge base, an

inference engine, and some form of user interface. The knowledge base which is separate from the

inference and control components contains the expert knowledge coded in some forms.

Expert system plays a very important role in present time where everyone is expecting advice or solution

for their complex problems. The acquisition of expert knowledge for knowledge –based systems remains

one of the main problems in developing these systems.

12.13. Glossary

1. Expert System: A system that is capable of taking decisions for difficult and complex problems like

human thinking using knowledgestored in database.

2. Knowledge: The refined form of information is known as Knowledge.

3. Knowledge Base: A database or repository of information used by Expert System for taking decisions.

12.14.Answers to check your progress / self-assessment questions

1. Robotics, Vision, Speech, Natural Languages, Expert Systems and Artificial Neural Networks.

2. An expert system is a computer application that performs a task that would otherwise be performed by

a human expert.

3. DENDRAIL, MYCIN and PROSPECTOR. The main purpose of MYCIN is to diagnose infectious

blood diseases.

Page 211 of 248

Page 217: Self Learning Material Artificial Intelligence

4. Knowledge Base, Agenda, User Interface, Inference Engine, Working Memory.

5. Knowledge Base is the component of Expert System where the information is stored in the form of

facts and rules (basically a series of IF statements). This is where the programmer writes the code for the

expert system.

6. It usesguidelines from the agenda to take decisions i.e. to inference an advice or output.

7. Backward Chaining.

8. A Forward chaining system gathers facts until enough evidence is collected those points to an outcome.

9. Knowledge is the refined form of information.

10. The knowledge engineer is a person who develops expert systems.

11. Factual Knowledge and Heuristic Knowledge.

12. IF-THEN-ELSE

13. Knowledge Acquisition is gathering knowledge from heterogeneous sources.

14. Expert Systems preserve the scarce resources and knowledge of those resources that are going to

retire or die. They then use this information for designing experts systems for future problems.

Knowledge in the expert systems is considered as permanent knowledge which could be used in many

different areas.

12.15. Model Questions

1. What is the importance of Expert Systems in AI? Discuss in detail.

2. Discuss History of Expert systems in detail.

3. Explain the components of Expert System in detail with the help of a well labeled diagram.

4. What are the different features of Expert System? Explain in detail.

5. What is Knowledge base? How it is important in Expert Systems?

6. Elucidate the role of Knowledge base and inference engine in the development of “Expert Systems”.

7. Explain concept of “Knowledge -based expert systems” in detail.

8. Discuss the pros and consof expert systems.

9. How “Expert systems” are useful in different areas of today’s world?

10. How expert systems are developed? Discuss in detail with the help of a diagram.

11. Explain the concept of forward and backward reasoning with the help of examples and diagrams.

12. Write a short note on Business of Expert Systems.

Page 212 of 248

Page 218: Self Learning Material Artificial Intelligence

Page 213 of 248

Page 219: Self Learning Material Artificial Intelligence

LESSON13 : Slots and Filler Structures

Structure of the Lesson

13.0. Objectives.

13.1. Weak Slot and Filler Structures.

13.2. Introduction to Sematic Networks.

13.2.1.Definition of Semantic Nets

13.2.2. History of Semantic Nets.

13.2.3. Essentials of Semantic Networks

13.2.4. Portraying Knowledge in Semantic Nets.

13.2.5. Decision making in Semantic Nets.

13.2.6. Extending Semantic Networks.

13.3. Concept of Frames.

13.3.1. Definition of Frame.

13.3.2. History of Frames.

13.3.3. Components of Frames.

13.3.4. General Frame Structure.

13.3.5 Example of Frame

13.3.6. Applications of Frame

13.4. Strong Slot and Filler Structures.

13.5. Conceptual Dependency (CD).

13.5.1. Definition of Conceptual Dependency

13.5.2 History of Conceptual Dependency

13.5.3. Conceptual Dependency Primitive Actions.

13.5.4.Advantages of Conceptual Dependency.

13.5.5. Disadvantages of Conceptual Dependency.

13.6. Scripts

13.6.1. Definition of Scripts

13.6.2. Applications of Script.

13.7. Summary.

13.8. Glossary.

13.9. Answers to check your Progress/ Self-Assessment Questions.

13.10. Model Questions.

Page 214 of 248

Page 220: Self Learning Material Artificial Intelligence

13.0. Objectives.After completing this chapter, the student will be able to understand:

The concept of weal slot and filler structures. Semantic nets, their history, basics, general structure and example. The Concept of Frames and their uses in AI. Strong Slots and Filler Structures. Conceptual Dependencies and their advantages and disadvantages in AI. Scripts in detail along with examples.

13.1. Weak Slot and Filler Structures.

Weak Slot and Filler Structures provide facilities to improve attribute values by speeding up declarationswhich areindicated by the important points. Here, binarystatements are pointed by first argument. E.g.team (Manveer-Singh, Thind). Features are simple to exemplify. It considers it easilyas it containsfeatures of object-oriented programming.

Slot: Frames are data structures used to represent information and slots are further division offrames.

Filler:A value that a slot can accept is known as filler. It could be numeric or

Weak Slot:A weak slot and filler structure does not represent anything. It acts just as a dummydata structure.

13.2. Semantic Nets

13.2.1. Definition of SemanticNets

A network which represents acceptable relations between concepts is called Semantic Net. It is alsoknown as Frame Network. A Semantic Network is a kind of graph that consist a set of nodes that areselectively interconnected by links labeled by the relationship between each pair of connected nodes.

Semantic net is mostly used for portraying knowledge. It is represented as a directed or undirectedgraph consisting of vertices, which represent concepts, andedges.A semantic net or semantic network is aknowledge representation technique widely use in proposition logic. It is also known as proposition netalso. The word semantic means “meaning”, hence the semantic networks conveys knowledge.

A labeled directed graph is used to define a semantic net as shown in Figure 13.1:

Page 215 of 248

Page 221: Self Learning Material Artificial Intelligence

Figure 13.1: A directed graph representing a Semantic network.

13.2.2. History of Semantic Networks

Fig 13.1. An illustration of semantic network

Charles S. Peirce used “directed graphs" in 1990. The use of directed graphsbegan the altercationbetween importance of "logic" and importance of "semantic networks." This altercationfinds that thesemantic networks are well defined form of logic and can be used to represent knowledge in precise,accurate and logical manner.

Richard H. Richens of the Cambridge Language Research Unit use "Semantic Nets" for the very firsttime as he was inventor of this concept in 1956 to translate natural languages into machine languages.

Figure 13.1: A directed graph representing a Semantic network.

13.2.2. History of Semantic Networks

Fig 13.1. An illustration of semantic network

Charles S. Peirce used “directed graphs" in 1990. The use of directed graphsbegan the altercationbetween importance of "logic" and importance of "semantic networks." This altercationfinds that thesemantic networks are well defined form of logic and can be used to represent knowledge in precise,accurate and logical manner.

Richard H. Richens of the Cambridge Language Research Unit use "Semantic Nets" for the very firsttime as he was inventor of this concept in 1956 to translate natural languages into machine languages.

Figure 13.1: A directed graph representing a Semantic network.

13.2.2. History of Semantic Networks

Fig 13.1. An illustration of semantic network

Charles S. Peirce used “directed graphs" in 1990. The use of directed graphsbegan the altercationbetween importance of "logic" and importance of "semantic networks." This altercationfinds that thesemantic networks are well defined form of logic and can be used to represent knowledge in precise,accurate and logical manner.

Richard H. Richens of the Cambridge Language Research Unit use "Semantic Nets" for the very firsttime as he was inventor of this concept in 1956 to translate natural languages into machine languages.

Page 216 of 248

Page 222: Self Learning Material Artificial Intelligence

13.2.3Essentials of semantic networksIt is used when we have proper awareness about a bunch ofinterrelated concepts.In majority, semanticnetworks are based on real world situations.Semantic networks basically follow the concept of graphsusually directed graphs in which arcs, vertices and weights are commonly used. In other words, we caninference that directed graphs formed backbone of semantic networks. They also support inheritance andreusability of concepts.

WordNet acts as best paradigm of a semantic network. It is a logical database of language English. Itdivides words written in English according to synonyms and establishes relation between them.

13.2.4. Portraying Knowledge in a Semantic Net

The natural features of a person can be shown as in Fig 13.2.

Fig. 13.2. A Semantic Network

These values can also be displayed in logic as: isa(person, mammal), instance(Mike-Hall, person)team(Manveer-Singh, Thind)

Page 217 of 248

Page 223: Self Learning Material Artificial Intelligence

Fig.13.3. A Semantic Network for n-Place Predicate

As a more complex example consider the sentence: John gave Mary the book. In the following figure, wedeal with number of forms of an event.

Fig. 13.4. A Semantic Network for a Sentence

13.2.5. Decision Making in Semantic Networks.

Decision making in Semantic Network refers to procedures and steps followed to draw conclusions fromthe network structures by carefully observing the relationships between different nodes and edges. Thewhole structure of directed graph and its contents is analyzed carefully to reach on a destination. Thebasic inference mechanism is: follow edges between vertices.

There are two methods to perform this task:

1. Intersection search

This search refers to finding the relationship between two nodes of the semantic network thatintersects at a common point. In case of intersection search, the different graph traversaltechniques like breath first search and depth first search are used. Intersection search is performedby attaching special tag to each visited tag.

2. Inheritance

Page 218 of 248

Page 224: Self Learning Material Artificial Intelligence

The isa and instance entities are worked in this strategy. Inheritance establishes relationshipbetween two nodes.

Inheritance also provides a way of dealing with basic reasoning. E.g. we could represent:

Emus are birds. Typically birds fly and have wings. Emus run. in the following Semantic net:

Fig. 13.5 A Semantic Network for a Basic Reasoning

To draw some special types of decisions we establish difference between the link that defines a new entityand attains its value and the other kind of link that correlates two present entities.

Consider the following in which the height of two persons is given and we also want to compare them.

We will use extravertices for the notion as well as its value.

Fig. 13.6 Two heights

Special methods are used to process these nodes, but without this difference the analysis would be verylimited.

Fig. 13.7 Comparison of two heights

Page 219 of 248

Page 225: Self Learning Material Artificial Intelligence

13.2.6 Expand Semantic Networks.

We can expand Semantic Networks to remove anomalies and represent information a best way.

Partitioned Networks:

Partitioned Semantic Networks permits for:

Propositions to be made without assurance to truth.

Expressions to be measured.

The basic idea to expand semantic networks is to modularize semantic network i.e. a directed graph

into spaces which consist of groups of nodes and arcs and regard each space as a node.

For Example: Andrew believes that the earth is flat. We can represent the proposition the earth is flat in

a space and within it have nodes and arcs the represent the fact (Fig. 13.8).

We have nodes and arcs to link this space the rest of the network to represent Andrew's belief.

Fig. 13.8 Partitioned network

Check your progress/ Self-assessment questions

Q1. What is Slot and Filler?

Page 220 of 248

Page 226: Self Learning Material Artificial Intelligence

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q2. Define Semantic Network.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q3. What do you mean by word “Semantic”?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q4. Fill in the blanks:

1. A…………………is an attribute pair in its simplest form.

2. A……..is a value that a slot can take.

3. A weak slot and filler structure does not consider the ________of the representation.

13.3. Concept of Frames.

13.3.1 Definition of Frame

An artificial intelligence data structure which is used to divideknowledge into modulesis known as

Frame.

Frames are also known as extended semantic networks.

13.3.2. History of Frames

Frame were introduced by Marvin Minsky in 1975 in his article "A Framework for Representing Knowledge"as a

data structure to represent a mental model of a stereotypical situation like driving a car, attending a meeting, or

eating in a restaurant.

13.3.3. Componentsof Frames.

Knowledge about an object or an event is stored together in memory as a unit. Then when a new situation isencountered, an appropriate frame is selected from memory for use in reasoning about the situation.

Slots: A single frame is composed of attributes or slots and associated values that depict real world situations.

Frames are record like structures which consists of collection of slots and slot values. The slots may be of any sizeor any type.

Facets:Slots typically have names and values of subfields called facets. Facets may also have names and anynumber of values.

Page 221 of 248

Page 227: Self Learning Material Artificial Intelligence

13.3.4. General Frame Structure

A general frame template structure is illustrated in Figure 13.9.

(<frame name>(<slot1>( <facet1><value1>…<valuek1>)

( <facet2><value2>…<valuek2>)...

(<slot2>( <facet1><value1>…<valuekm>)... )

Fig13.9. Syntax offrame structure

It is evident from above figure that a frame may have any number of slots, and a slot may have any

number of facets, each with any number of values. This gives a very general framework from which to

build a variety of general knowledge structures.

13.3.5 Example of Frame

An example of simple frame for Honey is depicted in Figure 13.10(honey

(PROFESSION (VALUE professor))(AGE (VALUE (42))(WIFE (VALUE (sandy))(CHILDREN (VALUE sue joe))(ADDRESS (STREET (VALUE 50 elm))

(CITY (VALUE chicago))(STATE (VALUE tx))(ZIP (VALUE (7500))))

Fig13.10. A simple instantiated person frame.

13.3.6 Applications of Frames:

1. Frames are used in number of Artificial Intelligence applications like vision and Natural Language

Processing (NLP).

2. Frames provide an efficient way to represent stereotype situations.

Page 222 of 248

Page 228: Self Learning Material Artificial Intelligence

3. Frames represent a situation that can be visual, complex and abstract.

Fig13.11.Characteristics of a hotel through frame.

4. Commonsense knowledge can be presented by Frames.

5. Frames represent three dimensional view of knowledge.

Check your progress/ Self-assessment questions

Q5. What do you mean by Frames?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q6. Name two building blocks of Frames.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q7. Who introduced the concept of Frames and When?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q8. Fill in the blanks:

1. Frames can be considered as an extension to …………………..

2. A……..is a compilation of attributes or slots and related values thatportray some actual world entity.

Page 223 of 248

Page 229: Self Learning Material Artificial Intelligence

13.4. Strong Slot and Filler Structures.

Strong Slot and Filler Structures symbolizes links among objects according to more firm rules, particular

notions of what type of objects and associations among them are given , and symbolize knowledge

regarding common situations.

13.5 Conceptual Dependency.

13.5.1 Definition of Conceptual Dependency

Conceptual dependency (CD) theory is based on the use of fundamental concepts and rules to represent

natural language sentences. Conceptual Dependency acts as a model to understand the concept of natural

languages in artificial intelligence systems. Conceptual Dependency basically developed to represent

knowledge acquired from natural languages.

13.5.2 History of Conceptual Dependency concept

The model of Conceptual Dependency was introduced by Roger Schank in 1969 at Stanford University

in the very first days of artificial intelligence. The students of Roger Schank used this model extensively

at Yale University such as Robert Wilensky, Wendy Lehnert, and Janet Kolodner.

This concept was developed by Schank to represent knowledge for natural language input into

computers. His objective was to make the semantics of the words used in the input independent. It means

if two sentences are having same meaning then they could be represented by single representation. The

system was also aimed at logical inferences.

13.5.3 Conceptual Dependency Primitive Actions:

S.No. Primitive Actions Intended Meaning1. ATRANS Transfer of an abstract entity

2. ATTEND Focusing attention on an object

3. CONC To think about something

4. EXPEL Expulsion of anything from the body.

5. GRASP Grasping or holding an object.

6. INGEST Ingesting something.

7. MBUILD Building on information

Page 224 of 248

Page 230: Self Learning Material Artificial Intelligence

8. MOVE Moving a part of the body.

9. MTRANS Transfer of mental information .

10. PROPEL Application of force.

11. PTRANS Physical transfer from one location to another.

12. SPEAK Emitting a sound

Fig13.13.Conceptual dependency primitive actions.

Fig13.13.Use of Conceptual dependency primitive actions.

13.5.4Advantages of CD:

1. The use of conceptual dependency involves rare inference rules.2. A large number of inference rules are in –built in CD structure.

13.5.5Disadvantages of CD:

Low level primitives are used to decompose knowledge. It is impossible or difficult to locate valid primitives. Representations can be complex even for relatively simple actions.

Check your progress/ Self-assessment questions

Q9. What is the use of Conceptual Dependency?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 225 of 248

Page 231: Self Learning Material Artificial Intelligence

Q10. Who gave the concept of Conceptual dependency and When?.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q11. Write advantages of Conceptual dependency,

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q13. What is purpose of MBUILD?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q13.Stae the purpose of SPEAK and GRASP conceptual dependency primitives.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

13.6. Scripts

13.6.1 Definition of Scripts

Page 226 of 248

Page 232: Self Learning Material Artificial Intelligence

Scripts are frame -like structures used to represent commonly occurring experiences such as going to the

movies,shopping in a supermarket, eating in a restaurant, or visiting a dentist. The script structure is

designed in terms of actors, roles, props, and scenes. Slots in a script which correspond to the part of the

event are filled with Conceptual Dependency primitives.

A script is like a thought sequence or a sequence of situations which could be anticipated. It could be

measured to comprise the number of slots or frames but with more specific roles.

13.6.2. Examples of ScriptExample 1. The concept of Script is exemplified by the following supermarket script:______________________________________________________________________________SCRIPT-NAME : food marketTRACK : supermarketROLES : shopper

deli attendantSeafood attendantcheckout clerksacking clerk

ENTRYCONDITIONS : shopper needs groceries

food market openPROPS : shopping cart

display aislesmarket itemscheckout standscashiermoney

______________________________________________________________________________SCENE1 : Enter Market

shopper PTRANS shopper into marketshopper PTRANS shopping-cart to shopper

SCENE2 : Shop for Itemsshopper MOVE shopper through aislesshopper ATTEND eyes to display itemsshopper PTRANS items to shopping cart

SCENE3 : Check Outshopper MOVE shopper to checkout standshopper WAIT shopper turn

Page 227 of 248

Page 233: Self Learning Material Artificial Intelligence

shopper ATTEND eyes to charges.shopper ATRANS money to cashiershopper ATRANS bags to shoppersacker ATRANS bags to shopper

SCENE4 : Exit Marketshopper PTRANS shopper to exit market

______________________________________________________________________________RESULTS: shopper has less money

shopper has grocery items.market has less grocery items.market has more money

______________________________________________________________________________

Fig13.14 A supermarket script structure.

Example 2: An example of simplified bank robbery is shown in Figure 13.15.

Page 228 of 248

Page 234: Self Learning Material Artificial Intelligence

Fig13.15:Simplified Bank Robbery Scripts

Check your progress/ Self-assessment questions

Q14. Why scripts are used?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 229 of 248

Page 235: Self Learning Material Artificial Intelligence

13.7. Summary

This chapter mainly deals with various knowledge representation techniques in AI. It explains the

concept of Frames, Slots, Facets, Conceptual Dependencies and Scripts along with suitable examples.

13.8. Glossary

1. Semantic Net:A network which represents acceptable relations between concepts is called SemanticNet.

2. Frame:An artificial intelligence data structure which is used to divide knowledge into modules isknown as Frame.

3. Knowledge Base: A database or repository of information used by Expert System for taking decisions.

4. Slots: Frames are divided into Slots.

5. Facets: Slots typically have names and values of subfields called facets. Facets may also have namesand any number of values.

6. Conceptual Dependencies: Conceptual Dependency acts as a model to understand the conceptof natural languages in artificial intelligence systems.

7. Scripts: Scripts are frame -like structures used to represent commonly occurring experiences such asgoing to the movies, shopping in a supermarket, eating in a restaurant, or visiting a dentist.

13.9. Answers to check your progress / self-assessment questions

1. Slot:A substructure of frame is called slot.Filler:Filler is a subpart of slot. Frame value that a slot can take –could be numeric, string (or anydata type) value or a pointer to a different slot.

2. Semantic Net:A network which represents acceptable relations between concepts is called SemanticNet. The word Semantic refers to “meaning”.

3. 1. Slot 2. Filler 3.Content4. Frame: An artificial intelligence data structure which is used to divide knowledge into modules is known as

Frame.

5. Slots and Facets are basic building blocks of Frames.6. Frame was introduced by Marvin Minsky in 1975.7. 1. Semantic Nets 2. Frames8. Conceptual Dependency acts as a model to understand the concept of natural languages in artificial

intelligence systems.9. The model of Conceptual Dependency was introduced by Roger Schank in 1969.10. Advantages of CD:

1. The use of conceptual dependency involves rare inference rules.

Page 230 of 248

Page 236: Self Learning Material Artificial Intelligence

2. A large number of inference rules are in –built in CD structure.11. MBUILD : Building on information12. SPEAK: Emitting a sound.

GRASP:Grasping or holding an object.13. Scripts are frame -like structures used to represent stereotypical situations.

13.10. Model Questions

1. What is the importance of weak Slot and Filler Structures?

2. Discuss the concept of Semantic Nets in detail.

3. What are Scripts? Illustrate the use of Scripts.

4. What are the different features of Expert System? Explain in detail.

5. Explain the various objectives of Conceptual Dependency.

6. Differentiate Frames and Scripts.

7. Discuss the concept of conceptual dependency with its advantages and disadvantages.

8. Explain Scripts with the help of examples.

9. Explain the concept of Frames with the help of general structure and examples.

10 What is relationship between Frames, Slots and Facets? Explain with the help of an Example.

11. Write a short note on Knowledge Base.

12. Explain Strong Slot and Filler Structures in detail.

Page 231 of 248

Page 237: Self Learning Material Artificial Intelligence

LESSON 14 : Natural Language Processing

Structure of the Lesson

14.0. Objectives.

14.1. Introduction to Natural Language Processing.

14.1.1. Linguistics.

14.1.2. Building blocks for the syntactic structures.

14.1.3. Levels of Knowledge Used in Language Understanding.

14.1.4. General Approaches to Natural Language Understanding.14.2. Syntactic Analysis/Reasoning.

14.2.1. Context Free Grammar (CFG).

14.2.2. Top down Parsing.

14.3. Semantic Analysis/ Discourse Process.

14.4. Morphological Processes.

14.5. Pragmatic Progress.

14.6. Communication: Communication among agents.

14.7. Formal grammar.

14.8. Parsing.

14.9 Functions of NLP.

14.10. Summary.

14.11. Glossary.

14.12. Answers to check your Progress/ Self-Assessment Questions.

14.13. Model Questions.

14.0. Objectives.

After studying this chapter, the student will be able to:

The concept of Natural Language Processing.

Understand the concept of Syntactic Reasoning.

Communication in Artificial Intelligence.

Understand the concept of Formal grammar, parsing, and grammar.

Page 232 of 248

Page 238: Self Learning Material Artificial Intelligence

14.1.Natural Language Processing

“Natural language processing (NLP)” is an important area of AIwhich deals with interaction of humanand computer through linguistics and natural human languages. Natural language systems convertinformation from computer into human language and human language into computer programs. Thenecessary components of an intelligent system are perception and communication. They provide thepower to effectively interact with environment.

Humans make use of its five basic senses i.e. Sight, hearing, touch, smell, and taste to producevalid andmeaningful statements. Sight and hearing are complex senses and therefore they require specialmechanism for inference.

It is very difficult to develop programs that understand natural languages because natural languages areso large.It is very important to developing programs in natural languages to make a communicationbetween user and computer. The critical factor in this process is to communicate effectively. AI programsshould be able to communicate with humans in a natural way, and natural language is most appropriateway to accomplish this goal. When a program starts to produce correct and acceptable output in lieu tothe inputit means it understands a natural language. For example, we say a student shows understandingif it responds with the correct answer a question.

14.1.1. Linguistics

It is not required to have prior knowledge about linguistics but the basic knowledge of grammar isessential to study natural languages. One should know how words and sentences are combined to producesentences before designing a sound and complete system that could understand the system. The sentenceis the basic language element in a natural language. A sentence is made up of words which express a

Page 233 of 248

Page 239: Self Learning Material Artificial Intelligence

complete sense. A sentence must have a subject and a predicate to express a valid idea. The subject iswhat the sentence is about, and the predicate says something about the subject.

Sentences are used to assert, query, and describe. The way a sentence is used determines its mood,declarative, imperative, interrogative, or exclamatory used determines its mood, declarative, imperative,interrogative, or exclamatory. Sentences are classified by structure and usage.

Simple sentence:A simple sentence has one independent clause comprised of a subject and

predicate. For example: Manveer like cold coffee.

Compound sentence:A compound sentence consists of number of independent clauses connected

by a connector. For example: Manveer like cold coffee, pizza and pasta.

In this example, Manveer, cold coffee, pizza, pasta are independent clauses connected by commas

and and connector.

Complex sentence:A complex sentence contains an independent clause and one or more

dependent clauses. For Example: Manveer like Honey but Jot like Manveer.

Check your progress/ Self-assessment questions

Q1. Expand NLP.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q2. State the term Natural Language Processing.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q3. Name two necessary components of intelligent system

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q4. Name five human senses.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q5. Why it is important to developing programs in natural languages?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Page 234 of 248

Page 240: Self Learning Material Artificial Intelligence

14.1.2. Building blocks for the syntactic structures:

1. Word:A word acts as a part of sentence in case of speech.

2. Noun:A noun is a name for something (person, place or thing).

For example: Manveer, Pasta, Pizza, Amritsar etc.

3. Pronouns: When the noun is already known, pronouns replace nouns.

4. Verbs:Verbs express action, being, or state of being, or state of being.

5. Adjectives:Adjectives are used to modify nouns and pronouns, and

6. Adverbs: Adverbs modify verbs, adjectives, or other adverbs.

7. Prepositions:Prepositions establish the relationship between a noun and rest part of the sentence.

8. Conjunctions:Conjunction combines words or sentences together.

14.1.3. Role of Knowledgein Understanding of Language.

A program should have reasonable information about the structure of the language to understand it.Itshould have proper sense about the words and their interrelationships with themselves and other phrasesand s sentences.The meaning of the words also be considered and also it matters how they contribute tothe meanings of a statement. To carry on a conversation with someone requires that a person (orprogram) know about the world in general know what other people know, and know the facts pertainingto a particular conversational setting. This all presumes a familiarity with the language structure and aminimal vocabulary.Below, a description is given to understand the components of a natural language:

1. Phonological :The word phonological deals with sounds to the words. The smallest unit of soundis known as aphoneme.

2. Morphological: The process of creating words from basic structures is known as morphologicalprocess.These basic structures are called morphemes. A morpheme is the smallest unit of meaningfor example, the construction of friendly from the root friend and the suffix ly.

3. Syntactic:Syntactic means syntax structure of the sentences. Thisfield relates to the procedure bywhich words structured and combine to other words to form grammatically correct sentences inthe language.

4. Semantic:Semantic means meaning of the sentence i.e. it deals with the process by which we cancombine words so that a meaningful and valid sentence can be generated. Also the differentcontexts a single word is considered here.

The approaches taken in developing languages understand programs generally follow the above levels orstages. When a string of words has been detected, the sentences are parsed or analyzed to determine theirstructure (syntax) and grammatical correctness. The meanings (semantics) of the sentences are thendetermined and appropriate representation structures created for the inference programs. The wholeprocess is a series of transformations form the basic speech sounds to a complete set of internalrepresentation structures.

Page 235 of 248

Page 241: Self Learning Material Artificial Intelligence

Understanding written language or text is easier than understanding speech. To understand speech, aprogram must have all the capabilities of a text understanding program plus the facilities needed to mapspoken sounds (often corrupted by noise) into textual form. In this chapter, we focus on the easierproblem, that of natural language understandings from textual input and information processing.

14.1.4. General Approaches to Natural Language Understanding

We deal with three different approaches for developing natural language programs:

(1) Use of keyword and pattern matching.(2) Combined syntactic (structural)(3) Semantic (scenario representations).

(1) Use of keyword and pattern matching.

The keyword and pattern matching approach is the simplest. It is based on the use of sentences templateswhich contain key words of phrases such as “___________ my mother ______,” “I am________________,” and, “I don’t like_________________,” that are matched against input sentences.Each input template has associated with it one or more output templates, one of which is used to producea response to the given input. Appropriate word substitutions are also made from the input to the outputto produce the correct person and tense in the response (I and me into you to give replies like “Why areyou __________”).

Advantage: This technique can accept ungrammatical, but meaningful sentences. Disadvantage: This technique does not produce any meaningful sentence means ambiguity is

very high in this case.

(2) Combined syntactic (structural)

The second approach is one of the most popular approaches currently being used. With this approach,knowledge structures are constructed during a syntactical and semantically analysis of the inputsentences. Parsers are used to analyze individual sentences and to build structure that can be used directlyor transformed into the required knowledge formats.

Advantage: It provides power and versatility. Disadvantage: is the large amount of computation required and the need for still further

processing to understand the contextual meanings of more than one sentence.

(3) Semantic (scenario representations).

This technique or approach makes use of frames or scripts. This approach depends more on a mapping ofthe input to prescribed primitives which are used to build larger knowledge structures. It depends on theuse of constraints improved by context and world knowledge to develop an understanding of thelanguage inputs. Pre stored descriptions and details for commonly occurring situations or events arerecalled for use in understanding a new situation. The stored events are then used to fill in mussingdetails about the current scenario.

Page 236 of 248

Page 242: Self Learning Material Artificial Intelligence

Advantage: Here, substantial amount of specific, as well as general world knowledge must bepresorted.

Check your progress/ Self-assessment questions

Q6. What do you understand by the term Morphological?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q7. What do you mean by term Semantic?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q8. Name three approaches to develop natural language programs.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

14.2. Syntactic analysis

Syntactic Analysis is the well-designed phase of NLP which deals with the syntax of natural language

programs. In Syntactic Analysis, a grammar is used to determine the structural validity of a sentence.

The grammar is used to produce an organized representation, or parse tree by using parsing algorithm.

A number of diverse grammars and parsing techniques have been developed, but we will consider only

the following 2 simple methods:

i. Context-Free Grammar

ii. Top-Down Parser

Page 237 of 248

Page 243: Self Learning Material Artificial Intelligence

1. Context-Free Grammar

In order to check the syntax structure of the input stream of tokens, there is need to specify the rules forwriting syntactically correct statement i.e. as per the grammar of the language. How do we specify thelanguage of the grammar of the language that contains rules for writing valid constructs of aprogramming language? Context free grammar is usually used to define the grammar of anyprogramming language.

Context free grammars also sometimes called BNF (Backus Naur Form) are used to represent thesyntactic specification of a programming language. It contains a set of rules called productions orproduction rules. , using which the code of programming language has to be checked. Using, context freegrammar, we can automatically construct an efficient parser or recognizer that determines whether asource program is syntactically correct or not. Context free grammar is the simplest and most widely usedstyle of grammar. Context-Free Grammars are kind of grammars which consists a single symbol on theleft-hand side of the rewrite rules.

The main advantage of CFG is that it is simple to define. NLP systems widely use Context FreeGrammars because they highly affect parsing techniques in order to understand the productions and otheraspects of CFG, let us consider a grammar that can check the syntax of an assignment statement in aprogramming language. Some of these statements are given below:

sum= 0sum = sum – initialsum = 5 * 4sum = sum + 5sum = sum +num1sum = sum + num1*num2

Page 238 of 248

Page 244: Self Learning Material Artificial Intelligence

<stml>id eq _ to _ op<exp> …(1)

<expr><expr>op<expr> …(2)

<expr>const …(3)

<expr>id …(4)

The symbol in each of productions can be read ‘can take the form’.

The production rule (1) signify that statement (stmt) can (id) followed by =, an equal to operator(eq _ to _ op) and then followed by an expression (expr).

The production rule (1) signify that an expression (expr) can take form an expression (expr)followed by an operator (op) and then followed by an expression (expr).This production definesan expression in terms of expression itself recursively.

The production rule (1) signify that an expression (expr) can take form a constant (const). The production rule (1) signify that an expression (expr) can take form an identifier (id).

2. Top-Down Parser

Top down parsing starts with the start symbol of the grammar and systematically applies rules orproductions in an attempt to generate a desire string of tokens. Formally speaking, the top down parseremulates in some way the derivation(leftmost)of the source code from the starting symbol of thegrammar. It tries to construct a parse tree for the input string of tokens from the start symbol whichhappens to be root node of the parse tree to the terminals which are the leaves of the parse tree.

Top-Down Parsing is the simple parsing technique. In top down parsing, the parser starts with the startsymbol S and tries to rewrite it into a string of terminal symbols in tune with the classes of the words inthe input sentence until it consists entirely of terminal symbols. The terminal symbols are then verifiedwith the input sentence to see if it matched. If not, the process is started over again with a differentcollection of rules. This is repeated until a specific rule is found which describes the structure of thesentence.

14.3. Semantic Analysis

The semantic analysis process is a complex one. Basically in semantic analysis, we yield the technique torepresent the fundamental meaning of the sentence. This fundamental face of the meaning of the sentenceis termed as the logical form.

Natural language is ambiguous by nature. A simple sentence can be interpreted in many different ways.In order for the computer to process the sentence, it needs to know the exact meaning of the sentence.Thus, the logical form is needed as an intermediate unambiguous representation of the meaning of thesentence.

Page 239 of 248

Page 245: Self Learning Material Artificial Intelligence

14.4. Morphological Process.

Morphological analysis is a problem structuring and problem solving technique. It was designed for

multi-dimensional, non-quantifiable problems where causal modeling and simulation do not function

well or at all. Morphological processes were developed by to represent non-reducible complexity.

Morphological Analyzer: A morphological analyzer is a program which analyzes the morphology of an

input word. The morphological analyzer includes a recognition engine, identifying suffixes and find

patterns within the input word. Morphological analyzers uselexical analyzers. For example: Google use

morphological analysis for all its products.

Check your progress/ Self-assessment questions

Q9. What do you mean by Syntactic Analysis?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q10.What is Context Free Grammar?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q11.Write any major use of Context Free Grammar.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q12. Define Semantic Analysis.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q.13. What is the importance of Morphological Process?

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

14.5. Pragmatic Progress.

Page 240 of 248

Page 246: Self Learning Material Artificial Intelligence

14.6. Communication: Communication among agents

Communication among powerful and intelligent software agents is mainly understood by means ofcommunication. Interaction may be differ from simpler forms to difficult forms, as they are based onspeech act theory. A normal form of communication is that limited to simple signals, specificinterpretations. Another form of interaction is by message passing concept between agents.

When people interact with each other, they pertend more than just exchanging messages with a restrictedsyntax and a given protocol, as in distributed systems. they can interact without any external language atall or symbols. Problems in the communication are:

Comfortably negotiate on static symbols but hard to agree on dynamic symbols

Require a renaming policy

Require a method to relate symbols presented by different agents

What to interact and what new things the other agents have found out.

14.7. Formal grammar

The formal grammars have wide applications in the field of computer science.

Noam Chomsky gave a mathematical model of a grammar in 1956. Although it was not useful for

describing natural languages such as English, it turned out to be useful for computer languages

Page 241 of 248

Page 247: Self Learning Material Artificial Intelligence

Definition of grammar:

A phrase – structured grammar (or simply a grammar) is ( Vn , ∑, P,S), where

(i) Vnis a finite non empty set whose elements are called variables.

(ii) ∑ is a finite nonempty set whose elements are called terminals.

(iii) VnɅ ∑= @

(iv) S is a special variable (i.e. an element of Vn ) called the start symbol , and

(v) P is a finite set whose elements are , where and are strings on Vn Ʌ ∑. has at

least one symbol from Vn . The elements of P are called productions or production rules or rewriting rules.

Example:

G= (Vn ,∑, P,S) is a grammar

Where

Vn= {<sentence>, <noun>, <verb>,<adverb>},

14.8. Parsing

The meaning of subparts of a sentence must be known before the meanings of a sentence can bedetermined. This process needs knowledge of the structure of the sentence, the meanings of individualwords and how the words modify each other.

The process of determining the syntactical structure of a sentence is known as parsing.

Parsing is the process of analyzing a sentence by taking it apart word-by-word and determining itsstructure form its constituent parts and subparts. The structure of a sentence can be represented with asyntactic tree or a list as described in the previous section. The parsing proves is basically the inverse ofthe sentence generation process since it involves finding a grammatical sentence structure form an inputstring. When given an input string, the lexical parts or terms (root words) must first be identified by type,and then be combined successively into larger units until a complete tree structure has been completed.

Syntax Analysis or parsing is done in two different ways:

1. Top-down parsing.2. Bottom-up parsing.

1. Top-Down Parsing

Top down parsing starts with the start symbol of the grammar and systematically applies rules orproductions in an attempt to generate a desire string of tokens. Formally speaking, the top down parseremulates in some way the derivation (leftmost) of the source code from the starting symbol of thegrammar. It tries to construct a parse tree for the input string of tokens from the start symbol whichhappens to be root node of the parse tree to the terminals which are the leaves of the parse tree.

Page 242 of 248

Page 248: Self Learning Material Artificial Intelligence

Top-Down Parsing is the simple parsing technique. In top down parsing, the parser starts with the startsymbol S and tries to rewrite it into a string of terminal symbols in tune with the classes of the words inthe input sentence until it consists entirely of terminal symbols. The terminal symbols are then verifiedwith the input sentence to see if it matched. If not, the process is started over again with a differentcollection of rules. This is repeated until a specific rule is found which describes the structure of thesentence.

S - NP VPNAME VPManveer VPManveer V NPManveer jumped NPManveer jumped ART NManveer jumped the NManveer jumped the horse

2. Bottom-up Parsing

In bottom-up parsing we begin with the input string of tokens and make each of these input tokens(terminal nodes) as the leaf nodes of the parse tree. Then using the appropriate productions of the givengrammar, we move upward level by creating intermediate non-terminals nodes till we finally reach testarting non-terminal symbol. In this way, bottom up parsing attempts to construct a parse tree for aninput string beginning at the leaves (bottom) and working towards the root (top) , which is the startsymbol of the grammar. As the name suggests, it attempts to construct the parse tree in a bottom upfashion. If the parse tree so constructed for the given input string of tokens using the rules of the grammarhas a root node as the start symbol then the input is syntactically valid, otherwise an error is detected andreported to the user.

Formally speaking, the bottom up parser emulates the process of reduction (i.e. reverse of derivation) ofthe input string of tokens back to the start symbol. A possible bottom-up parse of the same sentencemight proceed as follows.

Manveer jumped the horseNAME jumped the horseNAME V the horseNAME V ART horseNAME V ART NNP V ART NNP V NPNP VPS

Check your progress/ Self-assessment questions

Q14. What do you mean by the word “Pragmatic”?

Page 243 of 248

Page 249: Self Learning Material Artificial Intelligence

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q15. Who gave the concept of Formal Grammars and when?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q16.Define Grammar.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q17. Define the term parsing.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Q.18. Name two types of parsing.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

14.9. MAJOR TASKS OF NLP

Now, we will discuss some important functions of NLP.

1. Automatic summarization

NLP is used to produce text. The abstract and summary of a text published in any magazine or newspaper

can be better understand by use of NLP like an article in fashion magazine or a report from stock market.

2. Area Analysis

This application or task deals with the particular functioning or task area of text. It could be used in

audios, videos, textual and presentation form along with proper meaning.

3. Machine translation

NLP also facilitates the machine code generation process. It is also used to convert a program written in

one programming language into another programming language.

4. Word Analysis

Page 244 of 248

Page 250: Self Learning Material Artificial Intelligence

It is a process of classify words on the basis of their properties and then encapsulate them into non

overlapping sets. Different classes of the textual words are considered in this area.

For example, the word “bat” refers to a cricket accessory in one context while it refers to a bird also. The

English language is a simple morphological language where a single word can have number of meanings

which can be used in special situations on behalf of different contexts and uses.

5. Named entity recognition (NER)

This task of NLP centers on the particular type and meaning of a word i.e. in it we map the words with

their proper meanings and uses and place them according to their contexts in the whole text. The concept

of English grammar is used here i.e. the entities like noun, pronoun, adjectives and adverbs etc. make

their contribution in this ask widely.

For example: In German language all nouns, regardless of whether they refer to names are used in

capital letters while French and Spanish do not capitalize names that serve as adjectives.

6. Development of Human Readable Language

NLP is used to convert information from computer repositories to human readable language.

7. Understanding of Natural language

This technique or approach of AI is used to convert selected parts of text into more formal way such

as first-order logic structures. These formal structures are easier for computer programs to manipulate.

8. Optical character recognition (OCR)

NLP is used to determine the text corresponding to a printed or characters. OCRs are widely used in

copying text and scanning different forms of texts. It is basically used in printing industries.

10. Parsing

Parsing refers to determining the syntactic structure i.e. determine the syntax of the text. For this purpose,

we use parsers i.e. top-down parses and bottom-up parsers. A parse tree helps in finding the valid

structure of a sentence in lieu of punctuation marks etc.

11. Question answering

Page 245 of 248

Page 251: Self Learning Material Artificial Intelligence

NLP is also used to determine the answer of a question related to human context. For example: Some

particular kind of questions has a specific right answer. For example: "What is the capital of India?", but

sometimes open-ended questions are also considered such as "What is the meaning of religion?”

12. Establishing Relationships

NLP also works in establishing relationships between different parts of a sentence. For example: “Who is

married to whom?”

13. Sentence breaking (also known as sentence boundary disambiguation)

Given a chunk of text, find the sentence boundaries. Sentence boundaries are often marked by periods or

other punctuation marks, but these same characters can serve other purposes (e.g. marking abbreviations).

12.13. Summary

Natural Language processing deals with techniques through which computers and humans interact with

each other. Linguistics and human natural languages help in this task. It is very important to develop a

natural language processing system to establish interactions between computer and humans. But this task

is very difficult. This chapter also deals with linguistics, basic structures of grammar and various

approaches to language. Syntax analysis, semantic analysis and parsing techniques are also discussed in

this chapter. A comprehensive study on morphological processes is also done along with communication

with agents. The use and importance of formal grammars in AI is also explained.

14.14. Glossary

1. NLP:An important area of AI which deals with interaction of human and computer.

2. Sentence: A sentence is made up of words which express a complete sense. A sentence must have a

subject and a predicate to express a valid idea.

3. Prepositions:Prepositions fix relationship between a noun and other parts of a sentence.

4. Morphological:This is lexical knowledge which relates to word constructions from basic unites called

morphemes.

5. Phonological:The process which deals with sound of words. .

Page 246 of 248

Page 252: Self Learning Material Artificial Intelligence

6. Syntactic Analysis: Analyzing and determining the syntax structure of a sentence.

7. CFG:Context free grammar is usually used to define the grammar of any programming language.

8.Top down Parser:Top down parsing starts with the start symbol of the grammar and systematicallyapplies rules or productions in an attempt to generate a desire string of tokens.

9. Semantic Analysis: Semantic analysis process yield the fundamental meaning of the sentence.

10. Morphological analysis: Morphological analysis is a problem structuring and problem solvingtechnique.

11. Parsing: The technique to represent the fundamental meaning of the sentence.

12. Morphological analyzer: A morphological analyzer is a program which analyzes the morphology ofan input word.

14.15. Answers to check your progress / self-assessment questions

1. Natural language processing.2. Natural language processing (NLP) deals with interaction of human and computer through linguisticsand natural human languages.3. Perception and Communication.4. Sight, hearing, touch, smell, and taste.5. To make a communication between user and computer.6. It deals with structure of words from basic units.7. Semantic means meaning.8. Three approaches to develop natural language programs:

(1) The use of keyword and pattern matching.(2) Combined syntactic (structural)

(3) Semantic (scenario representations).9. Syntactic Analysis is the well-designed phase of NLP which deals with the syntax of natural language.10. CFGs are used to represent the syntactic structures of a programming language.11. Context free grammar is usually used to define the grammar of any programming language.12. The technique to represent the fundamental meaning of the sentence.13. Morphological processes were developed by to represent non-reducible complexity.14. Pragmatic means considering the meaning of a word in detailed manner along with its alternatives.15. Noam Chomsky in 1956.16. A phrase – structured grammar (or simply a grammar) is ( Vn , ∑, P,S), where

(i) Vnis a set of variables.(ii) ∑ is a set of terminals.(iii) Vn Ʌ ∑= @(iv) S is a special variable, called the start symbol.(v) P is a finite set of production rules.17. The process of analyzing a word part–by-part is known as parsing.

Page 247 of 248

Page 253: Self Learning Material Artificial Intelligence

18. Top-Down parsing and Bottom-up parsing.

14.16. Model Questions

1. What do you understand by Natural Language Processing? Explain.2. Discuss the concept of linguistics in detail.3. Discuss building block of Syntactic Structures.4. Explain different components of knowledge.5. Elaborate different techniques used in the development of natural language understanding programs.6. Explain Syntactic Analysis in detail.

7. Write a note on Semantic Analysis process.8. What do you mean by word “Morphological”? Explain morphological processes in detail.9. Write a short note on “Pragmatic Analysis”10. What do you meant by term parsing? Explain its types.11. Discuss various uses of NLP in detail.

Page 248 of 248