Solution Manual to Third Edition AI

62
1

Transcript of Solution Manual to Third Edition AI

Page 1: Solution Manual to Third Edition AI

1

Page 2: Solution Manual to Third Edition AI

�� ���������� ��

Elaine Rich is Director of the Artificial Intelligence Laboratory at the Microelectronics

and Computer Technology Corporation (MCC). Formerly on the faculty in computer sciences

at the University of Texas, she received her PhD from Carnegie Mellon University. Her

research interests include natural language processing. knowledge representation, and

machine translation.

Kevin Knight received his B.A. from Harvard University and is presently completing his

PhD in computer science at Carnegie Mellon University. A regular consultant at MCC, his

research interests include natural language processing, unification, and machine translation,

and search.

Shivashankar B Nair received his Master’s and Doctoral degrees in Engineering from

Amravati University, Amravati, where he served as a faculty member from 1986 to 1998.

He later joined the Indian Institute of Technology Guwahati, where he is currently an

Associate Professor in Computer Science and Engineering. His major areas of interest include

real-world Artificial Immune System Applications, Intelligent and Emotional Robotics,

Natural Language Processing, Genetic Algorithms and Mobile Agent Systems.

Dr Nair has been the chief investigator for projects funded both by the Indian government

and foreign agencies and is a member of several international and national journal and

conference committees. Presently, he is on a sabbatical as a Visiting Professor (Korean

Brain Pool) at the Human-Centred Advanced Research Education Centre, Hanbat National

University, Daejeon, South Korea, where he is investigating new ways of instilling emotions

into robots.

Page 3: Solution Manual to Third Edition AI

��������

Preface to the Third Edition xiiiPreface to the Second Edition xvii

������� �� �������������

1. What is Artificial Intelligence? 11.1 The AI Problems 21.2 The Underlying Assumption 41.3 What is an AI Technique? 51.4 The Level of the Model 161.5 Criteria for Success 181.6 Some General References 191.7 One Final Word and Beyond 20

Exercises 22

2. Problems, Problem Spaces, and Search 232.1 Defining the Problem as a State Space Search 232.2 Production Systems 282.3 Problem Characteristics 342.4 Production System Characteristics 412.5 Issues in the Design of Search Programs 432.6 Additional Problems 45

Summary 46Exercises 46

3. Heuristic Search Techniques 483.1 Generate-and-Test 483.2 Hill Climbing 503.3 Best-first Search 553.4 Problem Reduction 623.5 Constraint Satisfaction 663.6 Means-ends Analysis 70

Summary 72Exercises 73

�������� � �������������

4. Knowledge Representation Issues 754.1 Representations and Mappings 754.2 Approaches to Knowledge Representation 78

Page 4: Solution Manual to Third Edition AI

4.3 Issues in Knowledge Representation 824.4 The Frame Problem 92

Summary 93

5. Using Predicate Logic 945.1 Representing Simple Facts in Logic 955.2 Representing Instance and ISA Relationships 995.3 Computable Functions and Predicates 1015.4 Resolution 1045.5 Natural Deduction 120

Summary 121Exercises 122

6. Representing Knowledge Using Rules 1256.1 Procedural Versus Declarative Knowledge 1256.2 Logic Programming 1276.3 Forward Versus Backward Reasoning 1306.4 Matching 1346.5 Control Knowledge 138

Summary 141Exercises 141

7. Symbolic Reasoning Under Uncertainty 1437.1 Introduction to Nonmonotonic Reasoning 1437.2 Logics for Nonmonotonic Reasoning 1467.3 Implementation Issues 1537.4 Augmenting a Problem-solver 1547.5 Implementation: Depth-first Search 1567.6 Implementation: Breadth-first Search 162

Summary 165Exercises 166

8. Statistical Reasoning 1688.1 Probability and Bayes’ Theorem 1688.2 Certainty Factors and Rule-based Systems 1708.3 Bayesian Networks 1758.4 Dempster-shafer Theory 1778.5 Fuzzy Logic 180

Summary 181Exercises 182

9. Weak Slot-and-Filler Structures 1849.1 Semantic Nets 1849.2 Frames 189

Exercises 201

���� ��������

Page 5: Solution Manual to Third Edition AI

10. Strong Slot-and-Filler Structures 20310.1 Conceptual Dependency 20310.2 Scripts 20810.3 CYC 212

Exercises 216

11. Knowledge Representation Summary 21811.1 Syntactic-semantic Spectrum of Representation 21811.2 Logic and Slot-and-filler Structures 22011.3 Other Representational Techniques 22111.4 Summary of the Role of Knowledge 223

Exercises 223

��������� �������� ����

12. Game Playing 22512.1 Overview 22512.2 The Minimax Search Procedure 22712.3 Adding Alpha-beta Cutoffs 23012.4 Additional Refinements 23412.6 References on Specific Games 238

Exercises 240

13. Planning 24113.1 Overview 24113.2 An Example Domain: The Blocks World 24413.3 Components of a Planning System 24413.4 Goal Stack Planning 24913.5 Nonlinear Planning Using Constraint Posting 25613.6 Hierarchical Planning 26213.7 Reactive Systems 26313.8 Other Planning Techniques 263

Exercises 264

14. Understanding 26614.1 What is Understanding? 26614.2 What Makes Understanding Hard? 26714.3 Understanding as Constraint Satisfaction 272

Summary 277Exercises 278

15. Natural Language Processing 27915.1 Introduction 28015.2 Syntactic Processing 28515.3 Semantic Analysis 294

�������� ��

Page 6: Solution Manual to Third Edition AI

15.4 Discourse and Pragmatic Processing 30715.6 Spell Checking 319

Summary 323Exercises 325

16. Parallel and Distributed AI 32716.1 Psychological Modeling 32716.2 Parallelism in Reasoning Systems 32816.3 Distributed Reasoning Systems 330

Summary 340Exercises 340

17. Learning 34117.1 What is Learning? 34117.2 Rote Learning 34217.3 Learning by Taking Advice 34317.4 Learning in Problem-solving 34517.5 Learning from Examples: Induction 34917.6 Explanation-based Learning 35817.7 Discovery 36117.8 Analogy 36517.9 Formal Learning Theory 36617.10 Neural Net Learning and Genetic Learning 367

Summary 368Exercises 369

18. Connectionist Models 37018.1 Introduction: Hopfield Networks 37118.2 Learning in Neural Networks 37318.3 Applications of Neural Networks 39018.4 Recurrent Networks 39318.5 Distributed Representations 39418.6 Connectionist AI and Symbolic AI 397

Exercises 399

19. Common Sense 40219.1 Qualitative Physics 40319.2 Common Sense Ontologies 40519.3 Memory Organization 41119.4 Case-based Reasoning 413

Exercises 415

20. Expert Systems 41620.1 Representing and Using Domain Knowledge 41620.2 Expert System Shells 418

� ��������

Page 7: Solution Manual to Third Edition AI

20.3 Explanation 41920.4 Knowledge Acquisition 421

Summary 423Exercises 424

21. Perception and Action 42521.1 Real-time Search 42721.2 Perception 42821.3 Action 43221.4 Robot Architectures 435

Summary 437Exercises 437

22. Fuzzy Logic Systems 43922.1 Introduction 43922.2 Crisp Sets 43922.3 Fuzzy Sets 44022.4 Some Fuzzy Terminology 44022.5 Fuzzy Logic Control 44122.6 Sugeno Style of Fuzzy Inference Processing 44722.7 Fuzzy Hedges 44822.8 A Cut Threshold 44822.9 Neuro Fuzzy Systems 44922.10 Points to Note 449

Exercises 450

23. Genetic Algorithms: Copying Nature’s Approaches 45123.1 A Peek into the Biological World 45123.2 Genetic Algorithms (GAS) 45223.3 Significance of the Genetic Operators 46423.4 Termination Parameters 46523.5 Niching and Speciation 46523.6 Evolving Neural Networks 46623.7 Theoretical Grounding 46823.8 Ant Algorithms 47023.9 Points to Ponder 471

Exercises 472

24. Artificial Immune Systems 47324.1 Introduction 47324.2 The Phenomenon of Immunity 47324.3 Immunity and Infection 47424.4 The Innate Immune System—The First Line of Defence 47424.5 The Adaptive Immune System—The Second Line of Defence 47524.6 Recognition 47724.7 Clonal Selection 478

�������� ��

Page 8: Solution Manual to Third Edition AI

24.7 Learning 47924.8 Immune Network Theory 47924.9 Mapping Immune Systems to Practical Applications 48024.10 Other Applications 48724.11 Points to Ponder 487

Exercises 487Glossary of Biological Terms Used 488

25. Prolog—The Natural Language of Artificial Intelligence 49025.1 Introduction 49025.2 Converting English to Prolog Facts and Rules 49025.3 Goals 49125.4 Prolog Terminology 49325.5 Variables 49325.6 Control Structures 49425.7 Arithmetic Operators 49425.8 Matching in Prolog 49625.9 Backtracking 49725.10 Cuts 49925.11 Recursion 50025.12 Lists 50225.13 Dynamic Databases 50625.14 Input/Output and Streams 50925.15 Some Aspects Specific to LPA Prolog 510

Summary 522Exercises 522

26. Conclusion 52326.1 Components of an AI Program 52326.2 Ai Skeptics—An Open Argument 523

Exercises 524

References 527

Author Index 544

Subject Index 557

��� ��������

Page 9: Solution Manual to Third Edition AI
Page 10: Solution Manual to Third Edition AI
Page 11: Solution Manual to Third Edition AI
Page 12: Solution Manual to Third Edition AI
Page 13: Solution Manual to Third Edition AI
Page 14: Solution Manual to Third Edition AI
Page 15: Solution Manual to Third Edition AI
Page 16: Solution Manual to Third Edition AI
Page 17: Solution Manual to Third Edition AI
Page 18: Solution Manual to Third Edition AI
Page 19: Solution Manual to Third Edition AI
Page 20: Solution Manual to Third Edition AI
Page 21: Solution Manual to Third Edition AI
Page 22: Solution Manual to Third Edition AI
Page 23: Solution Manual to Third Edition AI
Page 24: Solution Manual to Third Edition AI
Page 25: Solution Manual to Third Edition AI
Page 26: Solution Manual to Third Edition AI
Page 27: Solution Manual to Third Edition AI
Page 28: Solution Manual to Third Edition AI
Page 29: Solution Manual to Third Edition AI
Page 30: Solution Manual to Third Edition AI
Page 31: Solution Manual to Third Edition AI
Page 32: Solution Manual to Third Edition AI
Page 33: Solution Manual to Third Edition AI
Page 34: Solution Manual to Third Edition AI
Page 35: Solution Manual to Third Edition AI
Page 36: Solution Manual to Third Edition AI
Page 37: Solution Manual to Third Edition AI
Page 38: Solution Manual to Third Edition AI
Page 39: Solution Manual to Third Edition AI
Page 40: Solution Manual to Third Edition AI
Page 41: Solution Manual to Third Edition AI
Page 42: Solution Manual to Third Edition AI
Page 43: Solution Manual to Third Edition AI
Page 44: Solution Manual to Third Edition AI
Page 45: Solution Manual to Third Edition AI
Page 46: Solution Manual to Third Edition AI
Page 47: Solution Manual to Third Edition AI
Page 48: Solution Manual to Third Edition AI
Page 49: Solution Manual to Third Edition AI
Page 50: Solution Manual to Third Edition AI
Page 51: Solution Manual to Third Edition AI
Page 52: Solution Manual to Third Edition AI
Page 53: Solution Manual to Third Edition AI
Page 54: Solution Manual to Third Edition AI
Page 55: Solution Manual to Third Edition AI
Page 56: Solution Manual to Third Edition AI
Page 57: Solution Manual to Third Edition AI

Chapter 22 Hints to Exercises: 1. Now that a fuzzy cooler is in place, design a simple fuzzy washing machine that can decide the speed of its motor based on the dirt level, type and the weight of the cloth. The Instructor should motivate the student to think on similar lines as the cooler described. 2. Visit the library of your institution, this time, for a different purpose. Inspect what kind of books are placed in each rack. Write a fuzzy logic program that can suggest the rack into which a new arrival (book) can go. One simple method is suggested below. The first task is to process the title of a book and extract significant key words from it. Membership of these keywords to a an area/field (Computer Science, Chemistry, Electronics,…) could now be computed based on their occurrence in respective corpora related to these areas. Fuzzy rules like: If book is Close Computer Science and Average to Electronics then it belongs to Computer Science could be used. Defuzzification can be performed by the maximum truth value. 3. Based on the fuzzy cooler, model the exposure time of a typical camera. Assume the camera has sensors to detect ambient light, controls for flash and picture type (landscape, close, etc.) settings. Also assume that exposure times are based on values reported by these sensors. Here too, the Instructor should motivate the student to think on similar lines as the cooler described. Parameters and profiles of course are different and need to be discussed accordingly.

Page 58: Solution Manual to Third Edition AI

Chapter 23

Hints to Exercises: 1. Generating a time table for an academic curriculum is a complex problem if we consider the priorities (preferred time of class, course, etc.) of faculty members and available resources (class rooms, free time, etc.). Several attempts have been made to apply Genetic algorithms for the generation of an optimal or near optimal time table. Try formulating this problem to suit the genetic algorithm. Decide on the representation of the chromosome, the crossover points and how both crossover and mutation should be realized in the search for the optimal goal. Time table generation is known to be a complex problem. Though a GA may not be able to arrive at the most optimal table, it can definitely be used to generate near optimal solutions that could be manually tweaked, thus saving a lot of nerve racking work! The Instructor could highlight to the students, the nature in which the time table in his/her academic institution is prepared. The different ways in which the chromosome can be structured may be discussed. One simple way is to form an m x n matrix that resembles the contents of a typical time table. A few constraints, for instance, are cited below: Professor X wishes to take a class on AI on either Mondays, Tuesdays and Fridays and would prefer to lecture at 10:00AM except on Fridays when he wishes to do so at 4:00PM. A table of such constraints could be formed for faculty members. (Maybe senior Professors could be given preference!) Likewise room availability constraints could cite the number and their size (maximum capacity). Lunch and tea breaks too have to be accounted for as also the number of courses and lectures and labs. per week. Crossover could be either random or controlled. For instance a crossover may cause allocation of one Professor to two lectures at the same time. This could be detected immediately and the crossover effect nullified. Mutation could be realized by randomly moving a lecture to another free area. Some thought should be given to the mutation rate and the manner of mutation. A fitness function to evaluate each time table generated could take into consideration parameters like: How well does it satisfy all the Professors’ preferences?

Page 59: Solution Manual to Third Edition AI

Is there a proper distribution of courses? (It should not be that all the lectures of a course are held on Monday and Tuesday or students opting for some set of courses do not have to attend classes at all on some days). The above parameters could be quantified and a fitness function formed. 2. In the animal world, the ant, grasshopper, the centipede and the millipede move using different gaits and stances. These probably evolved after several generations. Can we make a multi-legged robot learn to find the best and most stable gait? Use a Genetic Algorithm to simulate and aid this robot to learn how to achieve optimal locomotion. In the real world this problem requires a fitness function that could be calculated by actually trying out each solution. A 6-legged insect-like robot for instance could look something like this –

Students could be asked to look at Stiquito (http://www.stiquito.com/) the insect like robot and its versions. The more the number of legs, the more is the number of possible gaits. This number also increases with the degrees of freedom of the legs. The above insect-like robot has six legs. Each can move forward when activated or remain in the position shown. The possible number of activation signals can go up to 26 = 64. By applying different sequences of activation signals several gaits can be generated. The idea is to find the best gait using GAs.

Some of the possible gaits for a hexapod insect are shown below.

Evaluation could be performed by a fitness function that could take into consideration the actual distance traversed by the robot after several repeated cycles of a particular gait. In short if we consider the leg activation sequence as 10010 (1 means activated; 0 means stationary) then this sequence forms a gait. While such a sequence (solution) could be

Page 60: Solution Manual to Third Edition AI

generated using GAs, the robot’s legs could be activated say around a 100 times with this sequence repeatedly and the distance traversed by it could form the fitness of this gait. 3. How would you go about embedding the above genetic algorithm into a real multi-legged robot (imagine a millipede or a centipede-like robot) so that it will evolve and learn to find the best gait in the real world? The crucial part as mentioned earlier is the evaluation of the distance traveled (fitness of the gait). In the real world there is no better way than the hard way – make the robot walk physically using every gait several times. The solutions obtained from the simulation phase could be used as the initial starting population. Measuring the distance of course requires some ingenuity!

Page 61: Solution Manual to Third Edition AI

Chapter 24

1. A smart house needs an efficient burglar detection and alarm system. Can you model these using AIS concepts?

You could imagine numerous strategically located burglar detectors each comprising of cameras and proximity sensors that can trigger alarms. Cameras could sense movement.

Immune system Approx. Metaphors Lymphocyte (B-cell,T-cell) Antibody variable region Memory cell Pathogen Circulation MHC Cytokines Signals Pathogen detection Pathogen elimination

Burglar Alarm Alarm tone/intensity A vulnerable area (in the fence) detected earlier by one of the detectors (camera). Burglar Detectors could be networked and signal others of a possibly intrusion causing increase their sensitivity levels. Representation parameters/Image and proximity processing Sensitivity level Activation threshold, human owner Detection event Response from alarm and human intervention

The student could be asked to provide his/her own viewpoints about the model being tailored to suit AIS concepts within. 2. Many events can be looked upon as a defence mechanism. For instance the simple fact that you can balance on two legs is a mechanism to defend (or prevent) your centre of gravity from moving away from a stable point. Self preservation can be viewed, likewise, as the capability to defend your body. At every stage your actions (be it moving, talking, thinking, …) are all measures taken to make you feel stable (comfortable). With this in mind try modelling the following into an AIS based system:

(i) Riding a cycle (ii) Spam detection and elimination

The Instructor is urged to motivate the students to think of each of the above problems as one that has an Antigen and a Pathogen. Rest of the metaphors could then be discussed.

(i) This is hypothetical unless we actually model an AIS based robot to actually ride the cycle. There have been attempts to balance a pole using a numerous sensors, each acting on the system to stabilize it. Riding a cycle could also be looked upon as one such system wherein sensors could find the tilt, the movement of the centre of gravity and take corrective action using AIS concepts. Destabilization/shift in the centre of gravity could be viewed as an antigen. Its detection could trigger antibodies in the form of motor (muscle) activations that

Page 62: Solution Manual to Third Edition AI

counteract this change in an attempt to balance the cycle. Initially generated antibodies may not be all that successful but a clonal selection mechanism will allow those successful to become memory cells and result in stable and safe riding over a period of time.

(ii) Spam has become a perennial problem. While many attempts have

been made to circumvent it, the fact that spammers change their modes of spamming is highly frustrating.. An initial repertoire of words (naïve B/T-cells) could be extracted from an existing 100% spam database (similar to the bone marrow model). These could be used as starting material to counter spam. These words could undergo somatic mutation/hypermutation to catch the ever changing camouflaged words within the incoming email and trigger a detection. For instance the word – Viagra may have been spelt as Vi$agra. Mutation can help generate such non-words from real words. Students could be encouraged to use WordNet (http://wordnet.princeton.edu/) to find words related to spam words (such as synonyms) so as to make the word population diverse.