Artificial Intelligence in the 21st Century Third Edition AAII__33EE__FFMM__22pppp..iinndddd 11 1155--0066--22002222 1100::1111::0099 LICENSE, DISCLAIMER OF LIABILITY, AND LIMITED WARRANTY By purchasing or using this book (the “Work”), you agree that this license grants per- mission to use the contents contained herein, but does not give you the right of ownership to any of the textual content in the book or ownership to any of the information or products contained in it. This license does not permit uploading of the Work onto the Internet or on a Artificial Intelligence network (of any kind) without the written consent of the Publisher. Duplication or dissemi- nation of any text, code, simulations, images, etc. contained herein is limited to and subject to licensing terms for the respective products, and permission must be obtained from the in the 21ST Century Publisher or the owner of the content, etc., in order to reproduce or network any portion of the textual material (in any media) that is contained in the Work. Mercury Learning and Information (“MLI” or “the Publisher”) and anyone in- Third Edition volved in the creation, writing, or production of the companion disc, accompanying algo- rithms, code, or computer programs (“the software”), and any accompanying Web site or software of the Work, cannot and do not warrant the performance or results that might be obtained by using the contents of the Work. The author, developers, and the Publisher have used their best efforts to insure the accuracy and functionality of the textual material and/or programs contained in this package; we, however, make no warranty of any kind, express or implied, regarding the performance of these contents or programs. The Work is sold “as is” without warranty (except for defective materials used in manufacturing the book or due to faulty workmanship). The author, developers, and the publisher of any accompanying content, and anyone involved in the composition, production, and manufacturing of this work will not be liable for damages of any kind arising out of the use of (or the inability to use) the algorithms, source code, computer programs, or textual material contained in this publication. This includes, but is not limited to, loss of revenue or profit, or other incidental, physical, or consequential damages arising out of the use of this Work. The sole remedy in the event of a claim of any kind is expressly limited to replacement of the book, and only at the discretion of the Publisher. The use of “implied warranty” and certain “exclusions” vary from state to state, and might not apply to the purchaser of this product. Companion files may be downloaded from the publisher by writing to [email protected]. Mercury Learning and Information Dulles, Virginia Boston, Massachusetts New Delhi AAII__33EE__FFMM__22pppp..iinndddd 22 1155--0066--22002222 1100::1111::0099 Artificial Intelligence in the 21ST Century Third Edition Stephen Lucci, Ph.D. The City College of New York, CUNY Sarhan M. Musa, Ph.D. Prairie View A&M University Danny Kopec, Ph.D. Brooklyn College, CUNY Mercury Learning and Information Dulles, Virginia Boston, Massachusetts New Delhi AAII__33EE__FFMM__22pppp..iinndddd 33 1155--0066--22002222 1100::1111::1100 Copyright ©2022 by Mercury Learning and Information LLC. All rights reserved. This publication, portions of it, or any accompanying software may not be reproduced in any way, stored in a retrieval system of any type, or transmitted by any means, media, electronic display or mechanical display, including, but not limited to, photocopy, recording, Internet postings, or scanning, without prior permission in writing from the publisher. Publisher: David Pallai Mercury Learning and Information 22841 Quicksilver Drive Dulles, VA 20166 [email protected] www.merclearning.com (800) 232-0223 S. Lucci, S. Musa, and D. Kopec. Artificial Intelligence in the 21ST Century, Third Edition. ISBN: 978-1-68392-223-0 The publisher recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products. All brand names and product names mentioned in this book are trademarks or service marks of their respective companies. Any omission or misuse (of any kind) of service marks or trademarks, etc. is not an attempt to infringe on the property of others. Library of Congress Control Number: 2022932251 222324321 This book is printed on acid-free paper in the United States of America. Our titles are available for adoption, license, or bulk purchase by institutions, corporations, etc. For additional information, please contact the Customer Service Dept. at (800) 232-0223 (toll free). All of our titles are available in digital format at academiccourseware.com and other digital vendors. Companion disc files for this title are available by contacting [email protected]. The sole obligation of Mercury Learning and Information to the purchaser is to replace the disc, based on defective materials or faulty workmanship, but not based on the operation or functionality of the product. AAII__33EE__FFMM__22pppp..iinndddd 44 1155--0066--22002222 1100::1111::1100 To the memory of my parents, Louis and Connie Lucci, Both of whom always encouraged my education. Stephen Lucci To the memory of my parents, Mahmoud Musa and Fatmeh Hussein, Both of whom always on my mind and forever in my heart. Sarhan Musa AAII__33EE__FFMM__22pppp..iinndddd 55 1155--0066--22002222 1100::1111::1100 AAII__33EE__FFMM__22pppp..iinndddd 66 1155--0066--22002222 1100::1111::1100 Contents Preface xix Acknowledgments ( Three Editions) xxi Credits for the 3rd Edition xxv Part 1: Introduction 1 Chapter 1 Overview of Artificial Intelligence 3 1.0 Introduction 4 1.0.1 What is Artificial Intelligence? 4 1.0.2 What is Thinking? What is Intelligence? 5 1.1 The Turing Test 7 1.1.1 Definition of the Turing Test 7 1.1.2 Controversies and Criticisms of the Turing Test 9 1.2 Strong AI versus Weak AI 12 1.3 Heuristics 12 1.3.1 The Diagonal of a Rectangular Solid: Solving a Simpler, but Related Problem 12 1.3.2 The Water Jug Problem: Working Backward 13 1.4 Identifying Problems Suitable for AI 14 1.5 Applications and Methods 16 1.5.1 Search Algorithms and Puzzles 17 1.5.2 Two-Person Games 19 1.5.3 Automated Reasoning 19 1.5.4 Production Rules and Expert Systems 20 1.5.5 Cellular Automata 21 1.5.6 Neural Computation 22 1.5.7 Genetic Algorithms 23 1.5.8 Knowledge Representation 23 1.5.9 Uncertainty Reasoning 25 AAII__33EE__FFMM__22pppp..iinndddd 77 1155--0066--22002222 1100::1111::1100 viii ■ Contents 1.6 Early History of AI 25 1.6.1 Logicians and Logic Machines 27 1.7 Recent History of AI to the Present 29 1.7.1 Games 29 1.7.2 Expert Systems 30 1.7.3 Neural Computing 31 1.7.4 Evolutionary Computation 31 1.7.5 Natural Language Processing 32 1.7.6 Bioinformatics 34 1.8 AI in the New Millennium 34 1.9 Chapter Summary 36 PART II: FUNDAMENTALS 43 Chapter 2 Uninformed Search 45 2.0 Introduction: Search in Intelligent Systems 46 2.1 State-Space Graphs 47 2.1.1 The False Coin Problem 47 2.2 Generate-and-Test Paradigm 48 2.2.1 Backtracking 50 2.2.2 The Greedy Algorithm 53 2.2.3 The Traveling Salesperson Problem 55 2.3 Blind Search Algorithms 56 2.3.1 Depth First Search 57 2.3.2 Breadth First Search 58 2.4 Implementing and Comparing Blind Search Algorithms 60 2.4.1 Implementing a Depth First Search Solution 61 2.4.2 Implementing a Breadth First Search Solution 63 2.4.3 Measuring Problem-Solving Performance 63 2.4.4 Comparing dfs and bfs 64 2.5 Chapter Summary 67 Chapter 3 Informed Search 75 3.0 Introduction 75 3.1 Heuristics 77 3.2 Informed Search Algorithms (Part I) – Finding Any Solution 83 3.2.1 Hill Climbing 83 3.2.2 Steepest-Ascent Hill Climbing 84 3.3 The Best-First Search 86 3.4 The Beam Search 89 3.5 Additional Metrics for Search Algorithms 90 3.6 Informed Search (Part 2) – Finding An Optimal Solution 91 3.6.1 Branch and Bound 92 3.6.2 Branch and Bound with Underestimates 95 AAII__33EE__FFMM__22pppp..iinndddd 88 1155--0066--22002222 1100::1111::1100 Contents ■ ix 3.6.3 Branch and Bound with Dynamic Programming 98 3.6.4 The A* Search 99 3.7 Informed Search (part 3) – Advanced Search Algorithms 100 3.7.1 Constraint Satisfaction Search 100 3.7.2 AND/OR Trees 101 3.7.3 The Bidirectional Search 102 3.8 Chapter Summary 105 Chapter 4 Search Using Games 111 4.0 Introduction 112 4.1 Game Trees and Minimax Evaluation 112 4.1.1 Heuristic Evaluation 114 4.1.2 Minimax Evaluation of Game Trees 115 4.2 Minimax with Alpha-Beta Pruning 118 4.3 Variations and Improvements to Minimax 123 4.3.1 Negamax Algorithm 123 4.3.2 Progressive Deepening 125 4.3.3 Heuristic Continuation and the Horizon Effect 125 4.4 Games of Chance and the Expectiminimax Algorithm 125 4.5 Game Theory 127 4.5.1 The Iterated Prisoner’s Dilemma 129 4.6 Chapter Summary 129 Chapter 5 Logic in Artificial Intelligence 137 5.0 Introduction 138 5.1 Logic and Representation 139 5.2 Propositional Logic 140 5.2.1 Propositional Logic – Basics 140 5.2.2 Arguments in the Propositional Logic 144 5.2.3 Proving Arguments in the Propositional Logic Valid – A Second Approach 145 5.3 Predicate Logic – Introduction 147 5.3.1 Unification in the Predicate Logic 148 5.3.2 Resolution in the Predicate Logic 150 5.3.3 Converting a Predicate Expression to Clause Form 152 5.4 Several Other Logics 155 5.4.1 Second Order Logic 156 5.4.2 Non-Monotonic Logic 156 5.4.3 Fuzzy Logic 157 5.4.4 Modal Logic 157 5.5 Chapter Summary 158 Chapter 6 Knowledge Representation 167 6.0 Introduction 168 6.1 Graphical Sketches and The Human Window 171 AAII__33EE__FFMM__22pppp..iinndddd 99 1155--0066--22002222 1100::1111::1100