0% found this document useful (0 votes)
5 views

AI Module 4IT (2)

The document is a course module for Artificial Intelligence (ITec4121) at Debre Tabor University, targeting 4th year IT students. It covers definitions, objectives, approaches, and applications of AI, along with intelligent agents, problem-solving, knowledge representation, and machine learning. The course aims to provide students with a comprehensive understanding of AI methodologies and practical skills through lectures, labs, and assignments.

Uploaded by

Dessie Tibebu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

AI Module 4IT (2)

The document is a course module for Artificial Intelligence (ITec4121) at Debre Tabor University, targeting 4th year IT students. It covers definitions, objectives, approaches, and applications of AI, along with intelligent agents, problem-solving, knowledge representation, and machine learning. The course aims to provide students with a comprehensive understanding of AI methodologies and practical skills through lectures, labs, and assignments.

Uploaded by

Dessie Tibebu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

Artificial Intelligence ITec4121

DEBRE TABOR UNIVERSITY


GAFAT INSTITUTE OF TECHNOLOGY
DEPARTMENT OF INFORMATION TECHNOLOGY

COURSE MODULE FOR ARTIFICIAL INTELLIGENCE


(ITec4121)
Information Technology students
Compiled
By
Dr. Abebaw Alem & Dr. Habtu Hailu

DBRE TABOR UNIVERSITY, ETHIOPIA


P.O.BOX: 272
April 2024
DEBRE TABOR UNIVERSITY
Department of Computer Science
Course Title: - Fundamentals of programming II
Artificial Intelligence ITec4121

DEBRE TABOR UNIVERSITY


GAFAT INSTITUTE OF TECHNOLOGY
DEPARTMENT OF INFORMATION TECHNOLOGY

Course-Module Name: Artificial Intelligence


Course Code: ITec 4121
Target group: 4th year IT students
ECTSs: 5 hrs (2hrs Lecture, 3hrs lab, 6hrs Home Study per week)
Pre Requisites: None

Compiled
By
Dr. Abebaw Alem & Dr. Habtu Hailu

DTU
P.O.BOX: 272
April 2024
Introduction to Artificial Intelligence (COSc4142) Module

Table of Contents
Course Description and Domains of Education ............................................................... ii
Chapter One: Introduction to Artificial Intelligence .................................................... 1
1.1 Definitions of AI: WHAT IS AI? ................................................................................ 1
1.2 OBJECTIVES OF AI .................................................................................................. 3
1.3 Approaches to AI and Hypothesis of AI .................................................................... 4
1.4 The Foundations of AI: Bits of History and the State of the Art ............................. 6
1.5 Application Areas of AI ............................................................................................. 12
Chapter 2: Intelligent Agents ......................................................................................... 14
2.1 Agents and Environments ......................................................................................... 14
2.2 Acting of Intelligent Agents (Rationality) ....................................................................... 17
2.3 Structure of Intelligent Agents.................................................................................. 18
2.4 Agent Types ................................................................................................................ 18
2.4.1 Simple reflex agent ................................................................................................................20
2.4.2 Model-based reflex agent ......................................................................................................21
2.4.3 Utility-based agent .................................................................................................................23
2.4.4 Learning agent .......................................................................................................................24
Chapter 3: Solving Problems ......................................................................................... 27
3.1 Solving Problems by Searching ................................................................................ 27
3.1.1 Problem Solving Agents ........................................................................................................27
3.1.2 Problem Formulation .............................................................................................................27
3.1.3 Search Strategies and their Criteria .......................................................................................28
3.1.3.1 Uninformed (Blind) Search Strategies .........................................................................28
3.1.3.2 Informed (Heuristics) Search .......................................................................................33
3.1.3.3 Constraint Satisfaction Search .....................................................................................40
3.1.3.4 Games as Search Problems ..........................................................................................41
Chapter 4: Knowledge and Reasoning.......................................................................... 45
4.1 Logical Agents ............................................................................................................ 45
4.1.1 Propositional Logic ................................................................................................................45
4.1.2 Predicate (First-Order) Logic ................................................................................................46
4.2 Knowledge Representation........................................................................................ 46
4.3 Knowledge-based Systems ......................................................................................... 47
4.4 Uncertain Knowledge and Reasoning ...................................................................... 48
Chapter 5: Machine Learning ....................................................................................... 50
5.1 Learning and Learning from Examples/Observation............................................. 50
5.3 Learning Probabilistic Models .................................................................................. 52
5.4 Learning in Neural Networks ................................................................................... 52
Chapter 6: Communicating, Perceiving, and Acting ................................................... 54
6.1 Natural Language Processing ................................................................................... 54
6.2 Natural Language for Communication .................................................................... 54
6.3 Perception ................................................................................................................... 55
6.4 Robotics ....................................................................................................................... 56
Summary of Teaching-Learning and Assessments Methods: ........................................ 58
Worksheet ......................................................................................................................... 58
Assignments...................................................................................................................... 59

i
Artificial Intelligence ITec4121

Course Description and Domains of Education


The purpose of this course is to give students an understanding of Artificial Intelligence
methodologies, techniques, tools and results. Students will use at least one symbolic
programming AI-language [Lisp, Prolog, OPS5]. Students will learn the theoretical and
conceptual components of this discipline and firm up their understanding by using AI and
Expert System tools in laboratory sessions, projects and home assignments.
Learning outcomes
At the end of this course, the students will be able to:
 Define terms of intelligent, AI, reasoning, knowledge representation of AI and
learning techniques of AI (K, L4);
 Evaluate the strengths and weaknesses of these techniques and their applicability
to different tasks (A, L1);
 explain the role of AI in gaining insight into intelligence and perception (A,L2)
 show classical examples of artificial intelligence
 identify characteristics of programs that can be considered "intelligent" (S,L1)
 use heuristics in search problems and games (S,L3)
 describe a variety of ways to represent and retrieve knowledge and information
(A,L3)
 use the fundamentals of artificial intelligence programming techniques in a modern
programming language (S,L3)
 conclude ideas and issues associated with social technical, and ethical uses of
machines that involve artificial intelligence (K,L6)

Note: - The objectives, contents, methods, and assessment of the course are aligned with the hierarchy of learning and domains of
education as follows.
 Domain of education
 Knowledge (k)
 Attitude (A)
 Skill (S)
 Hierarchy of learning – simple to complex
1. Cognitive Domain (Knowledge-K):
Level 1 (knowledge): define, describe, label, list ….
Level 2 (comprehension): convert, defend distinguish, estimate, explain …
Level 3 (application): change, compute, demonstrate …
Level 4 (analysis): break down, relate, infer ….
Level 5 (synthesis): compose, create …
Level 6 (evaluate): appraise, conclude …
2. Affective Domain (Attitude-A):
Level 1 (receiving): Asks, describes …
Level 2 (responding): Answer, assist, complies …
Level 3 (valuing): completes, describes, differentiates …
Level 4 (organization): Adheres, alters, arranges, identifies …
Level 5 (characterization): Acts, discriminates, displays ….
3. Psychomotor Domain (Skill-S):
Level 1 (perception): choose, describes, detects
Level 2 (set): begins, displays, explains
Level 3 (guided Response): Assembles, builds, calibrated
Level 4 (mechanism): (same with Guides response)
Level 5 (complex overt response): (same with Guides response)
Level 6 (Adaption): Adapts, alters, changes, rearranges
Level 7 (origination): Arranges, combines, composes

ii
Introduction to Artificial Intelligence (COSc4142) Module

Chapter One: Introduction to Artificial Intelligence

1.1 Definitions of AI: WHAT IS AI?


“What is intelligence?” One could certainly define intelligence by the properties it
exhibits: an ability to deal with new situations; the ability to solve problems, to answer
questions, to devise plans, and so on.
Intelligence is the computational part of the ability to achieve goals in the world. We can’t
give a solid definition of intelligence that doesn't depend on relating it to human
intelligence. The problem is that we cannot yet characterize in general what kind of
computational procedures we want to call intelligent.
Intelligence is “the capacity to learn and solve problems” (Websters dictionary). In
particular, it is the ability to solve novel problems, to act rationally and to act like humans.
Intelligence is the computational part of the ability to achieve goals in the world. Varying
kinds and degrees of intelligence occur in people, many animals and some machines.
According to the father of Artificial Intelligence John McCarthy, it is “The science and
engineering of making intelligent machines, especially intelligent computer programs”.
Artificial Intelligence is a way of making a computer, a computer-controlled robot, or
a software think intelligently, in the similar manner the intelligent humans think.
AI builds and understands intelligent entities or agents. It has 2 main approaches:
“engineering” versus “cognitive modeling”.
A simple definition might be as follows:
Artificial intelligence is the study of systems that act in a way that to any observer would
appear to be intelligent. Or
Artificial Intelligence involves using methods based on the intelligent behaviour of humans
and other animals to solve complex problems. Or
Artificial Intelligence may be defined as the branch of computer science/IT that is
concerned with the automation of intelligent behaviour. Or
It is the science and engineering of making intelligent machines, especially intelligent
computer programs. It is related to the similar task of using computers to understand human
intelligence, but AI does not have to confine itself to methods that are biologically
observable. Or
Artificial Intelligence (AI), the study and engineering of intelligent machines capable of
performing the same kinds of functions that characterize human thought.
AI is one of the newest disciplines. The field of artificial intelligence (AI), attempts to
understand intelligent entities. Thus, the reasons to study AI are:
 to learn more about ourselves,
 the intelligent entities are interesting and useful in their own right.
 AI has produced many significant and impressive products even at this early stage in
its development.
 Although no one can predict the future in detail, it is clear that computers with human-
level intelligence (or better) would have a huge impact on our everyday lives and on
the future course of civilization.
 Artificial Intelligence is the Science and Engineering that is concerned with the theory
and practice of developing systems that exhibit the characteristics we associate with
intelligence in human behavior: perception, natural language processing, reasoning,
planning and problem solving, learning and adaptation, etc.
 And other reasons.

1
Artificial Intelligence ITec4121

The intelligence is intangible. It is the capability of observing, learning, remembering


and reasoning.
A. Observation: perceiving the environments and watching and imitating others.
Perception is the process of acquiring, interpreting, selecting, and organizing sensory
information. For example, child tries to learn by mimicking her parent.
B. Learning: It is the activity of gaining knowledge or skill by studying, practicing, being
taught, or experiencing something. Learning enhances the awareness of the subjects of
the study.
C. Remembering: it is the process of recalling the prior knowledge or the past
experiences about the environment.

D. Reasoning: It is the set of processes that enables us to provide basis for judgment,
making decisions, and prediction. There are broadly two types:
Inductive Reasoning: It conducts specific observations to makes broad general
statements.
Deductive Reasoning: It starts with a general statement and examines the possibilities to
reach a specific, logical conclusion.

AI attempts to develop intelligent agents.


Characteristics of Intelligent system
• Use vast amount of knowledge
• Learn from experience and adopt to changing environment
• Interact with human using natural language and speech
• Respond in real time
• Tolerate error and ambiguity in communication
The concern of AI is to enable computers behave like human and emulate the
reasoning power of humans

Besides the definitions of AI, working issues in AI can be categorized within three research
and development types: Symbolic, Connectionist, and Evolutionary. Each has its own
characteristic strengths and weaknesses.
Symbolic AI (Symbol based approach to learning)
Symbolic AI is based on logic (Logic (Greek logos, “word,” “speech,” “reason”), the
science dealing with the principles of valid reasoning and argument. The study of logic is
the effort to determine the conditions under which one is justified in passing from given

2
Artificial Intelligence ITec4121

statements, called premises, to a conclusion that is claimed to follow from them. It uses
sequences of rules to tell the computer what to do next. Expert systems consist of many so-
called IF-THEN rules: IF this is the case, THEN do those. Since both sides of the rule can
be defined in complex ways, rule-based programs can be very powerful.
Connectionist AI (Neurally or biologically inspired approaches to learning)
Connectionist systems also referred to as neural system or Parallel Distributed Processing.
Connectionism is inspired by the human brain. It is closely related to computational
neuroscience, which models actual brain cells and neural circuits. Connectionist AI
uses artificial neural networks made of many units working in parallel. These simple units
are much less complex than real neurons. Each can do only one thing, such as report a tiny
vertical line at a particular place in an image. What matters is not what any individual unit
is doing, but the overall activity pattern of the whole network.
Neural Network, in computer science, is highly interconnected network of
information-processing elements that mimics the connectivity and functioning of the
human brain. One of the most significant strengths of neural networks is their ability to
learn from a limited set of examples. Neural networks have been applied to many problems
since they were first introduced, including pattern recognition, handwritten character
recognition, speech recognition, financial and economic modeling, and next-generation
computing models.
Consequently, connectionist systems are more flexible than symbolic AI programs. Even
if the input data is faulty, the network may give the right answer. They are therefore good
at pattern recognition, where the input patterns within a certain class need not be identical.
But connectionism is weak at doing logic, following action sequences, or representing
hierarchies of goals. What symbolic AI does well, connectionism does badly, and vice
versa. Hybrid systems combine the two, switching between them as appropriate.
Evolutionary AI (Inspired by genetic and evolutionary analogs)
 Also termed as emergent learning.
 Evolutionary AI draws on biology.
 Its programs make random changes in their own rules, and select the best daughter
programs to breed the next generation.
 A practical application of evolutionary AI would be a computer model of the long-
term growth of a business in which the evolution of the business is set within a
simulated marketplace.
 Often used in modelling artificial life.

1.2 OBJECTIVES OF AI
To supplement natural intelligence for e.g we are building intelligence in an object so that
it can do what we want it to do, as for example-- robots, thus reducing human labor and
reducing human mistakes. In general, the specific goals of AI are:
 To Create Expert Systems: The systems which exhibit intelligent behavior, learn,
demonstrate, explain, and advice its users.
 To Implement Human Intelligence in Machines (to make machines smarter and
to understand intelligence): Creating systems that understand, think, learn, and
behave like humans.
 To Make Intelligence Machines more useful in a real world practically
(entrepreneurial purpose)

3
Artificial Intelligence ITec4121

For Humans Intelligence is no more than TAKING a right


decision at right time
And
For Machines Artificial Intelligence is no more than
CHOOSING a right decision at right time
I think Artificial intelligence is the Second intelligence ever to
exist

1.3 Approaches to AI and Hypothesis of AI


Historically, there are four approaches to AI. As one might expect, a tension exists between
approaches centred on humans and approaches centred on rationality. A human-centred
approach must be an empirical science, involving hypothesis and experimental
confirmation. A rationalist approach involves a combination of mathematics and
engineering.
Approaches to AI do mean making computer:
 Think like a human (Thinking humanly)
 Act like a human (Acting humanly)
 Think rationally (Thinking rationally)
 Act rationally (Acting rationally)
A. Thinking humanly: The cognitive modelling approach
If we are going to say that a given program thinks like a human, we must have some way
of determining how humans think: the actual workings of human minds. There are two
ways to do this: through introspection trying to catch our own thoughts as they go by-and
through psychological experiments. Once we have a sufficiently precise theory of the mind,
it becomes possible to express the theory as a computer program. If the program's
input/output and timing behaviors match corresponding human behaviors, that is evidence
that some of the program's mechanisms could also be operating in humans.
The interdisciplinary field of cognitive science brings together computer models from AI
and experimental techniques from psychology to try to construct precise and testable
theories of the workings of the human mind.
B. Thinking rationally: The "laws of thought" approach

The Greek philosopher Aristotle was one of the first to attempt to codify "right thinking,"
that is, irrefutable reasoning processes. His syllogisms provided patterns for argument
structures that always yielded correct conclusions when given correct premises-for
example, "Socrates is a man; all men are mortal; therefore, Socrates is mortal." These laws
of thought were supposed to govern the operation of the mind; their study initiated the field
called logic.
Logicians in the 19th century developed a precise notation for statements about all kinds
of things in the world and about the relations among them. The so-called logicist tradition
within artificial intelligence hopes to build on such programs to create intelligent systems.
There are two main obstacles to this approach.
 Not easy to take informal knowledge and state it in the formal terms required by
logical notation, particularly when the knowledge is less than 100% certain.

4
Artificial Intelligence ITec4121

 There is a big difference between being able to solve a problem "in principle" and
doing so in practice.

C. Acting humanly: The Turing Test approach

The Turing Test, proposed by Alan Turing (1950), was designed to provide a satisfactory
operational definition of intelligence. Rather than proposing a long and perhaps
controversial list of qualifications required for intelligence, he suggested a test based on
indistinguishability from undeniably intelligent entities-human beings. The computer
passes the test if a human interrogator, after posing some written questions, cannot tell
whether the written responses come from a person or not. Programming a computer to
pass the test provides plenty to work on. The computer would need to possess the following
capabilities:
 Natural language processing to enable it to communicate successfully in English.
 knowledge representation to store what it knows or liears;
 automated reasoning to use the stored information to answer questions and to
draw new conclusions;
 Machine learning to adapt to new circumstances and to detect and extrapolate
patterns.
 computer vision to perceive objects, and
 Robotics to manipulate objects and move about.

The Turing test was designed by Turing as a way to judge the success or
otherwise of an attempt to produce a thinking computer. The interrogator is
given access to two individuals, one of whom is a human (B) and the other of
whom is a computer (A). The interrogator (C) can ask the two individuals
questions, but cannot directly interact with them. Probably the questions are
entered into a computer via a keyboard, and the responses appear on the
computer screen. The human is intended to attempt to help the interrogator,
but if the computer is really intelligent enough, it should be able to fool the
interrogator into being uncertain about which the computer is and which the
human is. The human can give answers such as “I’m the human—the other
one is the computer,” but of course, so can the computer. The real way in
which the human proves his or her humanity is by giving complex answers
that a computer could not be expected to comprehend. Of course, the inventors
of the truly intelligent computer program would have given their program the
ability to anticipate all such complexities.

Figure 1.1: Turing test technique

D. Acting rationally: The rational agent approach

5
Artificial Intelligence ITec4121

An agent (the Latin word to mean ager to do) is just something that acts something. But
computer agents are expected to have other attributes that distinguish them from mere
"programs" such as operating under autonomous control, perceiving their environment,
persisting over a prolonged time period, adapting to change, and being capable of taking
on another's goals.
A rational agent is one that acts so as to achieve the best outcome or, when there is
uncertainty, the best expected outcome.

In the "laws of thought" approach to AI, the emphasis was on correct inferences. Making
correct inferences is sometimes part of being a rational agent, because one way to act
rationally is to reason logically to the conclusion that a given action will achieve one's goals
and then to act on that conclusion.
All the skills needed for the Turing Test are there to allow rational actions. Thus, we need
the ability to represent knowledge and reason with it because this enables us to reach good
decisions in a wide variety of situations in the real world.
For these reasons, the study of AI as rational-agent design has advantages such as:
 it is more general than the "laws of thought" approach, because correct inference is just
one of several possible mechanisms for achieving rationality.
 it is more amenable to scientific development than are approaches based on human
behaviour or human thought because the standard of rationality is clearly defined and
completely general.
The hypothesis of AI could be vied by different scholars in to two views: the Strong AI
and Weak AI based on the intelligent behavior of humans.
o The followers of Strong AI believe that by giving a computer program sufficient
processing power, and by providing it with enough intelligence, one can create a
computer that can literally think and is conscious in the same way that a human is
conscious. Strong AI is also referred to as "artificial general intelligence" or as the
ability to perform "general intelligent action". Many philosophers and Artificial
Intelligence researchers consider this view to be false, and even ludicrous. The
possibility of creating a robot with emotions and real consciousness is one that is often
explored in the realms of science fiction but is rarely considered to be a goal of
Artificial Intelligence.
o Weak AI (Applied AI or Narrow AI), in contrast, is simply the view that intelligent
behavior can be modeled and used by computers to solve complex problems. That is
the use of software to study or accomplish specific problem solving or reasoning tasks
that do not encompass (or in some cases are completely outside of) the full range of
human cognitive abilities. This point of view argues that just because a computer
behaves intelligently does not prove that it is actually intelligent in the way that a
human is.

1.4 The Foundations of AI: Bits of History and the State of the Art
In this section, we provide a brief history of the disciplines that contributed ideas,
viewpoints, and techniques to AI. Like any history, this one is forced to concentrate on a
small number of people, events, and ideas and to ignore others that also were important.

Philosophy (428 B. C.-present)


Can formal rules be used to draw valid conclusions?
How does the mental mind arise from a physical brain?
Where does knowledge come from?
How does knowledge lead to action?

6
Artificial Intelligence ITec4121

Different Philosophers have great roles under this foundation such as:
 Aristotle (384-322 B.C.) was the first to formulate a precise set of laws governing the
rational part of the mind. He developed an informal system of syllogisms for proper
reasoning, to generate conclusions mechanically, given initial premises.
 Much later, Ramon Lull (d. 13 15) had the idea that useful reasoning could actually
be carried out by a mechanical artifact.
 Thomas Hobbes (1588-1679) proposed that reasoning was like numerical
computation, that "we add and subtract in our silent thoughts."
 Leonardo da Vinci (1452-1519) designed but did not build a mechanical calculator;
recent reconstructions have shown the design to be functional. The first known
calculating machine was constructed around 1623 by the German scientist Wilhelm
Schickard (1592-1635), although the Pascaline, built in 1642 by Blaise Pascal (1623-
1662), is more famous.
 Gottfried Wilhelm Leibniz (1646-1716) built a mechanical device intended to carry
out operations on concepts rather than numbers, but its scope was rather limited.
 RenC Descartes (1596-1650) gave the first clear discussion of the distinction between
mind (as a physical system) and matter and of the problems that arise.

Mathematics (c. 800-present)


What are the formal rules to draw valid conclusi~ons?
What can be computed?
How do we reason with uncertain information?

Philosophers staked out most of the important ideas of AI, but the leap to a formal science
required a level of mathematical formalization in three fundamental areas: logic,
computation, and probability.
 The mathematical development really began with the work of George Boole (1 8 15-1
864), who worked out the details of propositional, or Boolean, logic (Boole, 1847).
 In 1879, Gottlob Frege (1848-1925) extended Boole's logic to include objects and
relations, creating the first-order logic that is used today as the most basic knowledge
representation system.
 Alfred Tarski (1902-1983) introduced a theory of reference that shows how to relate
the objects in a logic to objects in the real world.
 In 1930, Kurt Godel (1906-1978) showed that there exists an effective procedure to
prove any true statement in the first-order logic of Frege and Russell, but that first-
order logic could not capture the principle of mathematical induction needed to
characterize the natural numbers. This motivated Alan Turing (1912-1954) to try to
characterize exactly which functions are capable of being computed.
 The distinction between polynomial and exponential growth in complexity was first
emphasized in the mid-1960s (Cobham, 1964; Edmonds, 1965). It is important because
exponential growth means that even moderately large instances cannot be solved in any
reasonable time.
 Besides logic and computation, the third great contribution of mathematics to AI is the
theory of probability. The Italian Gerolamo Cardano (1501-1576) first framed the idea
of probability, describing it in terms of the possible outcomes of gambling events.
Probability quickly became an invaluable part of all the quantitative sciences, helping
to deal with uncertain measurements and incomplete theories.
 Pierre Fermat (1 60 1-1 665), Blaise Pascal (1623-1662), James Bernoulli (1654-1705),
F'ierre Laplace (1749-1827), and others advanced the theory and introduced new
statistical methods.

7
Artificial Intelligence ITec4121

 Thomas Bayes (1702-1 761) proposed a rule for updating probabilities in the light of
new evidence. Bayes' rule and the resulting field called Bayesian analysis form the
basis of most modern approaches to uncertain reasoning in AI systems.

Economics (1776-present)
How should we make decisions so as to maximize payoff?
How should we do this when others may not go along?
How should we do this when the payoff may be f,x in the future?

The science of economics got its start in 1776, when Scottish philosopher Adam Smith
(1723-1790) published An Inquiry into the Nature and Causes of the Wealth of Nations.
In 1956 American social scientist and Nobel laureate Herbert Simon (1 91 6-2001), the
pioneering A1 researcher, won the Nobel prize in economics in 1978 for his early work
showing that models based on satisfying-making decisions that are "good enough".
In 1956 American social scientist and Nobel laureate Herbert Simon(Herbert A. Simon
(1916-2001), American political scientist, also known for his work in economics,
psychology, and computer science and American physicist and computer scientist Allan
Newell at Carnegie Mellon University in Pennsylvania devised a program called Logic
Theorist that simulated human thinking on computers.

Neuroscience (1861-present)
How do brains process information?
Neuroscience is the study of the nervous system, particularly the brain. The exact way in
which the brain enables thought is one of the great mysteries of science. It has been
appreciated for thousands of years that the brain is somehow involved in thought, because
of the evidence that strong blows to the head can lead to mental incapacitation. Aristotle
wrote, "Of all the animals, man has the largest brain in proportion to his size."
The measurement of intact brain activity began in 1929 with the invention by Hans Berger
of the electroencephalograph (EEG). From the following table, it is stated a crude
comparison of the raw computational resources available to computers (circa 2003) and
brains. The computer's numbers have all increased by at least a factor of 10 since 1995,
and are expected to do so again this decade. The brain’s numbers have not changed in the
last 10,000 years.

Computational resources Digital Computer Human Brain


Computational units 1 CPU, l08 gates 1012 neurons
Storage units 1012 bits RAM 1012 neurons
1012 bits disk 1014 synapses
Cycle time lo-9 sec 10-3 sec
Bandwidth 1010 bits/sec 1014 bits/sec
Memory updates/sec 109 1014

Table1: A crude comparison of the raw computational resources available to computers


and brains.

Brains and digital computers perform quite different tasks and have different properties.
Table 1 shows that there are 1000 times more neurons in the typical human brain than there
are gates in the CPU of a typical high-end computer. Even though a computer is a million
times faster in raw switching speed, the brain ends up being 100,000 times faster at what it
does.

8
Artificial Intelligence ITec4121

Psychology (1879-present)
How do humans and animals think and act?

The first AI conference occurred at Dartmouth College in New Hampshire in 1956. This
conference inspired researchers to undertake projects that emulated human behavior in the
areas of reasoning, language comprehension, and communications.
In the United States, the development of computer modelling led to the creation of the field
of cognitive science. The field can be said to have started at a workshop in September 1956
at MIT at which A1 itself was "born." At the workshop, George Miller presented The
Magic Number Seven, Noam Chomsky presented Three Models of Language, and Allen
Newell and Herbert Simon presented The Logic Theory Machine. These three influential
papers showed how coniputer models could be used to address the psychology of memory,
language, and logical thin lung, respectively. It is now a common view among
psychologists that "a cognitive theory should be like a computer program" (Anderson,
1980), that is, it should describe a detailed information-processing mechanism whereby
some cognitive function might be implemented.

Computer engineering (1940-present)

How can we build an efficient computer?

For artificial intelligence to succeed, we need two things: intelligence and an artifact. The
computer has been the artifact of choice. This shows the development of computer
innovations. AI owes a debt to the software side of computer science, which has supplied
the operating systems, programming languages, and tools needed to write modern
programs (and papers about them). But this is one area where the debt has been repaid:
work in AI has pioneered many ideas that have made their way back to mainstream
computer science, including time sharing, interactive interpreters, personal computers with
windows and mice, rapid development environments, the linked list data type, automatic
storage management, and key concepts of symbolic, functional, dynamic, and object-
oriented programming.

Control theory and Cybernetics (1948-present)


How can artifacts operate under their own control?

The central figure in the creation of what is now called control theory was Norbert Wiener
(1894-1964). Wiener was a brilliant mathematician, who worked with Bertrand Russell,
among others, before developing an interest in biological and mechanical control systems
and their connection to cognition.
Modern control theory, especially the branch known as stochastic optimal control, has as
its goal the design of systems that maximize an objective function over time.

Linguistics (1957-present)
How does language relate to thought?

Modem linguistics and AI, then, were "born" at about the same time, and grew up together,
intersecting in a hybrid field called computational linguistics or natural language
processing. Understanding language requires an understanding of the subject matter and
context, not just an understanding of the structure of sentences. Much of the early work in

9
Artificial Intelligence ITec4121

knowledge representation (the study of how to put knowledge into a form that a computer
can reason with) was tied to language and informed by research in Linguistics, which was
connected in turn to decades of work on the philosophical analysis of language.

The gestation of artificial intelligence (1943-1955)


The first work that is now generally recognized as A1 was done by Warren McCulloch and
Walter Pitts (1943). They drew on three sources: knowledge of the basic physiology and
function of neurons in the brain; a formal analysis of propositional logic due to Russell and
Whitehead; and Turing's theory of computation. They proposed a model of artificial
neurons in which each neuron is characterized as being "on" or "off," with a switch to "on"
occurring in response to stimulation by a sufficient number of neighboring neurons. The
state of a neuron was conceived of as "factually equivalent to a proposition which proposed
its adequate stimulus." They showed, for example, that any computable function could be
computed by some network of connected neurons, and that all the logical connectives (and,
or, not, etc.) could be implemented by simple net structures. McCulloch and Pitts also
suggested that suitably defined networks could learn. Donald Hebb (1949) demonstrated a
simple updating rule for modifying the connection strengths between neurons. His rule,
now called Hebbian learning, remains an influential model to this day.

The birth of artificial intelligence (1956)

In 1956, the term Artificial Intelligence was first used by John McCarthy at a conference
in Dartmouth College, in Hansover, New Hampshire.
AI from the start embraced the idea of duplicating human faculties like creativity, self-
improvement, and language use. None of the other fields were addressing these issues. AI
is also the only one of fields that is clearly a branch of computer science (although
operations research does share an emphasis on computer simulations), and AI is the only
field to attempt to build machines that will function autonomously in complex, changing
environments.

Now AI has got early enthusiasm, great expectations (1952-1969) and a dose of reality
(1966-1973) by different scholars.

Knowledge-based systems: The key to power? (1969-1979)

This state of AI is a picture of problem solving that had a general-purpose search


mechanism trying to string together elementary reasoning steps to find complete solutions.
Such approaches have been called weak methods, because, although general, they do not
scale up to large or difficult problem instances. The alternative to weak methods is to use
more powerful, domain-specific knowledge that allows larger reasoning steps and can
more easily handle typically occurring cases in narrow areas of expertise. One might say
that to solve a hard problem, you have to almost know the answer already.
AI becomes an industry (1980-present)
In 198 1, the Japanese announced the "Fifth Generation" project, a 10-year plan to build
intelligent computers running Prolog.

AI becomes the return of neural networks (1986-present)


A1 becomes a science (1987-present)
The field of speech recognition illustrates the pattern. In recent years, approaches based on
hidden Markov models (HMMs) have come to dominate the area. Two aspects of HMMs

10
Artificial Intelligence ITec4121

are relevant. First, they are based on a rigorous mathematical theory. This has allowed
speech researchers to build on several decades of mathematical results developed in other
fields. Second, they are generated by a process of training on a large corpus of real speech
data. This ensures that the performance is robust, and in rigorous blind tests the HMMs
have been improving their scores steadily.
Neural networks also fit this trend. Much of the work on neural nets in the 1980s was done
in an attempt to scope out what could be done and to learn how neural nets differ from
"traditional" techniques. Using improved methodology and theoretical frameworks, the
field arrived at an understanding in which neural nets can now be compared with
corresponding techniques from statistics, pattern recognition, and machine learning, and
the most promising technique can be applied to each application. As a result of these
developments, so-called data mining technology has spawned a vigorous new industry.
Judea Pearl's (1988) Probabilistic Reasoning in Intelligent Systems led to a new acceptance
of probability and decision theory in AI, following a resurgence of interest epitomized by
Peter Cheeseman's (1985) article "In Defense of Probability." The Bayesian network
formalism was invented to allow efficient representation of, and rigorous reasoning with,
uncertain knowledge. This approach largely overcomes many problems of the probabilistic
reasoning systems of the 1960s and 1970s; it now dominates A1 research on uncertain
reasoning and expert systems. The approach allows for learning from experience, and it
combines the best of classical AI and neural nets.
Similar gentle revolutions have occurred in robotics, computer vision, and knowledge
representation.

The emergence of intelligent agents (1995-present)

What can A1 do today? A concise answer is difficult, because there are so many activities
in so many subfields. Here are a few applications:
Autonomous planning and scheduling: A hundred million miles from Earth, NASA's
Remote Agent program became the first on-board autonomous planning program into
control the scheduling of operations for a spacecraft (Jonsson et al., 2000).
Game playing: IBM's Deep Blue became the first computer program to defeat the world
champion in a chess match when it bested Garry Kasparov by a score of 3.5 to 2.5 in an
exhibition match (Goodman and Keene, 1997).
Autonomous control: The ALVINN computer vision system was trained to steer a car to
keep it following a lane.
Diagnosis: Medical diagnosis programs based on probabilistic analysis have been able to
perform at the level of an expert physician in several areas of medicine.
Logistics Planning: During the Persian Gulf crisis of 1991, U.S. forces deployed a
Dynamic Analysis and Replanning Tool, DART (Cross and Walker, 1994), to do
automated logistics planning and scheduling for transportation. This involved up to 50,000
vehicles, cargo, and people at a time, and had to account for starting points, destinations,
routes, and conflict resolution among all parameters.
Robotics: Many surgeons now use robot assistants in microsurgery.
Language understanding and problem solving: PROVERB (Littman et al., 1999) is a
computer program that solves crossword puzzles better than most humans, using
constraints on possible word fillers, a large database of past puzzles, and a variety of
information sources including dictionaries and online databases such as a list of movies
and the actors that appear in them.
In 1958, McCarthy invented the LISP programming language, which is still widely used
today in Artificial Intelligence research.

11
Artificial Intelligence ITec4121

1.5 Application Areas of AI


AI currently encompasses a huge variety of subfields, from general-purpose areas such as
perception and logical reasoning, to specific tasks such as playing chess, proving
mathematical theorems, writing poetry, and diagnosing diseases. Often, scientists in other
fields move gradually into artificial intelligence, where they find the tools and vocabulary
to systematize and automate the intellectual tasks on which they have been working all
their lives. Similarly, workers in AI can choose to apply their methods to any area of human
intellectual endeavor. In this sense, it is truly a universal field.
In general, AI combines the following subfields.
1. Expert System(ES): ES is a system that uses human knowledge capture in a computer
to solve problems that ordinarily require human expertise.
2. Natural Language Processing(NLP): NLP technology gives computer users the ability
to communicate with a computer in their nature language. This technology allows for
a convectional interface, in contrast to using a programming language.
3. Speech(Voice) understanding: The recognition and understanding of spoken language
by a computer.
4. Robotics and sensory: Sensory systems, such as vision systems tactical systems, and
single processing systems, when combined with AI, define a broad category of systems
called robotics.
5. Computer vision and scene recognition: Visual recognition has been defined as the
addition of some form of computer intelligence and decision-making to digitized visual
information received from machine sensor such as a camera. The basic objective is to
interpret scenarios rather than generate pictures.
6. Intelligent Computer aided instructions: It refers to machines that can tutor humans. To
a certain extent, such a machine can be viewed as expert systems. However, the major
objective of an expert system is to render advice, whereas the purpose of the ICAI is to
teach (known as intelligent tutoring system ITS).
7. Neural Computing: A set of mathematical models that simulate the way a human brain
function.
8. Game Playing: Perfect area for investigating new strategies and heuristics, and one in
which it measures the results.
9. Languages Translation: It uses computer programs to translate words and sentences
from one language to another without much interruption from humans.
10. Fuzzy logic: It is a technique for processing linguistic terms. It extends the notion of
logic beyond a single true/false to allow for partial truths. Eg. the credit record may be
assessed as both good and bad, but each to a different degree.
11. Genetic Algorithms: Intelligent methods that use computer to simulate the processing
of natural evolution to find patterns from a set of data.
12. Intelligent Agents: Small programs that reside on computers to conduct certain tasks
automatically.(Virus detection programs)

12
Course module

Review Questions

1. What is Intelligence?
2. What is Artificial Intelligence?
3. Is Artificial Intelligence a branch of computer science or an alternative to computer
science?
4. Explain the difference between strong and weak methods in Artificial Intelligence.
Explain how this dichotomy differs from the difference between strong and weak
AI.
5. Why are PROLOG, LISP and PYTHON so well suited to Artificial Intelligence
research? Do you think languages such as C++ and Java could also be used for such
research?
6. When did Artificial Intelligence first begin to be studied? Your answer should be
more detailed than a simple date.
7. Explain the difference between strong AI and weak AI.
8. If a computer passed the Turing Test, what would that prove? What conditions
would you want to be sure had been observed in setting up the test?

13
Course module

Chapter 2: Intelligent Agents

2.1 Agents and Environments

An agent is anything that can be viewed as perceiving its environment through sensors
and acting upon that environment through effectors/actuators to maximize progress
towards its goals.
A rational agent is one that does the right thing. Obviously, this is better than doing the
wrong thing, but what does it mean? As a first approximation, we will say that the right
action is the one that will cause the agent to be most successful. That leads to intelligent
agent with the problem of deciding how and when to evaluate the agent’s success.
A performance measure embodies the criterion for success of an agent's behaviour. We
use the term performance measure for the how—the criteria that determine how
successful an agent are. Obviously, there is not one fixed measure suitable for all agents.
The when of evaluating performance is also important to evaluate the fast/speed of an
agent.

The agent takes sensory input from its environment, and produces as output actions that
affect it.

Figure 2.1: Structure of Intelligent Agents


There are a number of agents such as:
 Human agent: - A human agent has eyes, ears, and other organs for sensors, and
hands, legs, mouth, and other body parts for effectors/ actuators.
 Robotic agent: - A robotic agent substitutes cameras and infrared range finders for
the sensors and various motors for the effectors/actuators.
 A software agent has encoded bit strings as its percepts and actions.
- receives Keystrokes, file contents, network packages as sensors/ sensory
inputs and acts on the environment by displaying on the screen, writing
files, and sending network packets as actuators.
Eg. A thermostat detecting room temperature
 Web search agent
 Chess player

14
Course module

 Omniscient agent: knows the actual outcome of its actions and can act
accordingly; but omniscience is impossible in reality.
What are sensors and actuators for each of these?
In the rationality of the simple vacuum-cleaner agent, the performance measure, the
environment, the agent's actuators and sensors (PEAS) are grouped under task
environment. In designing an agent, the first step must always be to specify the task
environment as fully as possible.
For instance, the PEAS description for different agents’ task environment is stated in figure
2.2.

Figure 2.2 Examples of agent types and their PEAS descriptions the task
environments.

15
Course module

Properties of task environments


The range of task environments that might arise in AI is obviously vast. We can, however,
identify a fairly small number of dimensions along which task environments can be
categorized.
Fully observable vs. partially observable
If an agent's sensors give it access to the complete state of the environment at each point
in time, then we say that the task environment is fully observable. A task environment is
effectively fully observable if the sensors detect all aspects that are relevant to the choice
of action; relevance, in turn, depends on the performance measure. Fully observable
environments are convenient because the agent need not maintain any internal state to keep
track of the world. An environment might be partially observable because of noisy and
inaccurate sensors or because parts of the state are simply missing from the sensor data-for
example, a vacuum agent with only a local dirt sensor cannot tell whether there is dirt in
other squares, and an automated taxi cannot see what other drivers are thinking.
Deterministic vs. stochastic
If the next state of the environment is completely determined by the current state and
the action executed by the agent, then we say the environment is deterministic; otherwise,
it is stochastic.
Episodic vs. sequential
In an episodic task environment, the agent's experience is divided into atomic episodes.
Each episode consists of the agent perceiving and then performing a single action.
Crucially, the next episode does not depend on the actions taken in previous episodes. In
episodic environments, the choice of action in each episode depends only on the episode
itself. Many classification tasks are episodic. In sequential environments, on the other hand,
the current decision could affect all future decisions. Chess and taxi driving are sequential:
in both cases, short-term actions can have long-term consequences. Episodic environments
are much simpler than sequential environments because the agent does not need to think
ahead. (See figure 2.3).
Static vs, dynamic
If the environment can change while an agent is deliberate, then we say the environment is
dynamic for that agent; otherwise, it is static. Static environments are easy to deal with
because the agent need not keep looking at the world while it is deciding on an action, nor
need it worry about the passage of time. Dynamic environments, on the other hand, are
continuously asking the agent what it wants to do; if it hasn't decided yet, that counts as
deciding to do nothing. If the environment itself does not change with the passage of time
but the agent's performance score does, then we say the environment is semidynamic.
Discrete vs. continuous
The discrete/continuous distinction can be applied to the state of the environment, to the
way time is handled, and to the percepts and actions of the agent. (See figure 2.3).
Single agent vs. multiagent
An agent may be single or multi. The distinction between single-agent and multiagent
environments may seem simple enough. (See figure 2.3).

16
Course module

Figure 2.3 Examples of task environments and their characteristics.

2.2 Acting of Intelligent Agents (Rationality)

An agent should strive to "do the right thing"; based on what it can perceive and the actions
it can perform. So the agent does the right thing successfully is known as Rational Agent.
Rationality is nothing but status of being reasonable, sensible, and having good sense of
judgment. It is concerned with expected actions and results depending upon what the agent
has perceived. Performing actions with the aim of obtaining useful information is an
important part of rationality.
A rational agent is the one, which is capable of doing expected actions to maximize its
performance measure, on the basis of:
• Its percept sequence
• Its built-in knowledge base
Rationality of an agent at any given time depends on the following:
1. The performance measures, which determine the degree of success.
2. Agent’s Percept Sequence till now.
3. The agent’s prior knowledge about the environment.
4. The actions that the agent can carry out/perform.
A rational agent always performs right action, where the right action means the action that
causes the agent to be most successful in the given percept sequence. The problem the
agent solves is characterized by Performance Measure, Environment, Actuators, and
Sensors (PEAS).
We use the performance measure as an objective criterion for success of an agent's
behavior. Obviously, there is not one fixed measure suitable for all agents. We could ask
the agent for a subjective opinion of how happy it is with its own performance, but some
agents would be unable to answer, and others would delude themselves. (Human agents in
particular are notorious for "sour grapes"—saying they did not really want something after
they are unsuccessful at getting it.) Therefore, we will insist on an objective performance
measure imposed by some authority. In other words, we as outside observers establish a
standard of what it means to be successful in an environment and use it to measure the
performance of agents.

17
Course module

E.g., performance measure of a vacuum-cleaner agent could be amount of dirt cleaned up,
amount of time taken, amount of electricity consumed, amount of noise generated, etc.
As a general rule, it is better to design performance measures according to what one
actually wants in the environment. Rather than according to how one thinks the agent
should behave (amount of dirt cleaned vs a clean floor). A more suitable measure would
reward the agent for having a clean floor.

2.3 Structure of Intelligent Agents

So far we have talked about agents by describing their behavior. Now, we will have to bite
the bullet and talk about how the insides work. The job of AI is to design the agent
program: a function that implements the agent mapping from percepts to actions. We
assume this program will run on some sort of computing device, which we will call the
architecture. Obviously, the program we choose has to be one that the architecture will
accept and run.
The architecture might be a plain computer, or it might include special-purpose hardware
for certain tasks, such as processing camera images or filtering audio input. It might also
include software that provides a degree of insulation between the raw computer and the
agent program, so that we can program at a higher level. In general, the architecture makes
the percepts from the sensors available to the program, runs the program, and feeds the
program's action choices to the effectors as they are generated. The relationship among
agents, architectures, and programs can be summed up as follows:

Agent’s structure can be viewed as:


• Agent = Architecture + Agent Program
• Architecture = the machinery that an agent executes on.
• Agent Program = an implementation of an agent function.

2.4 Agent Types

 Medical diagnosis system


Percepts: - Symptoms, findings, patient's answers
Actions: - Questions, tests, treatments
Goals: - Healthy patient, minimize costs
Environment: - Patient, hospital
 Satellite image analysis system
Percepts: - Pixels of varying intensity, color
Actions: - Print a categorization of scene
Goals: - Correct categorization
Environment: - Images from orbiting satellite
 Part-picking robot
Percepts: - Pixels of varying intensity
Actions: - Pick up parts and sort into bins
Goals: - Place parts in correct bins

18
Course module

Environment: - Conveyor belt with parts


 Refinery controller
Percepts: - Temperature, pressure readings
Actions: - Open, close valves; adjust temperature
Goals: - Maximize purity, yield, and safety
Environment: - Refinery
 Interactive English tutor
Percepts: - Typed words
Actions: - Print exercises, suggestions, corrections
Goals: - Maximize student's score on test
Environment: - Set of students

Figure 2.4 Types of agent systems with their environments

The most famous artificial environment is the Turing Test environment, in which the whole
point is that real and artificial agents are on equal footing, but the environment is
challenging enough that it is very difficult for a software agent to do as well as a human.
Russell & Norvig (2003) group agents into five classes based on their degree of perceived
intelligence and capability in order of increasing generality:
1. Simple reflex agents
2. Model-based reflex agents
3. Goal-based agents
4. Utility-based agents
5. Learning agents

19
Course module

2.4.1 Simple reflex agent

Simple reflex agents act only on the basis of the current percept, ignoring the rest of the
percept history. The agent function is based on the condition-action rule: if condition then
action.
This agent function only succeeds when the environment is fully observable. Some reflex
agents can also contain information on their current state which allows them to disregard
conditions whose actuators are already triggered.
Infinite loops are often unavoidable for simple reflex agents operating in partially
observable environments. Note: If the agent can randomize its actions, it may be possible
to escape from infinite loops.

Figure 2.5 Schematic diagram of a simple reflex agent.

function SIMPLE-REFLEX-AGENT(percept)
returns action
persistent /static: rules, a set of condition-action
rules
state  INTERPRET-INPUT (percept)
rule  RULE-MATCH (state,rules)
action  RULE-ACTION [rule]
return action
Figure 2.6 A simple reflex agent. It acts according to a rule whose condition matches the
current state, as defined by the percept.

20
Course module

2.4.2 Model-based reflex agent

A model-based agent can handle a partially observable environment. Its current state is
stored inside the agent maintaining some kind of structure which describes the part of the
world which cannot be seen. This knowledge about "how the world works" is called a
model of the world, hence the name "model-based agent".
A model-based reflex agent should maintain some sort of internal model that depends on
the percept history and thereby reflects at least some of the unobserved aspects of the
current state. It then chooses an action in the same way as the simple reflex agent.
 Action may depend on history or unperceived aspects of the world.
 Need to maintain internal world model.
Example:
 Agent: robot vacuum cleaner
 Environment: dirty room, furniture.
 Model: map of room, which areas already cleaned.
 Sensor/model tradeoff.

Figure 2.7 Schematic diagram of a model-based reflex agent.

21
Course module

function REFLEX-AGENT-WITH-STATE
(percept) returns action
static: state, a description of the current world
state
rules, a set of condition-action rules
state  UPDATE-STATE (state, percept)
rule  RULE-MATCH (state, rules)
action  RULE-ACTION [rule]
state  UPDATE-STATE (state, action)
return action
Figure 2.8 A model-based reflex agent. It keeps track of the current state of the world using
an internal model. It then chooses an action in the same way as the reflex agent.
2.1.1 Goal-based agent
Goal-based agents further expand on the capabilities of the model-based agents, by using
"goal" information. Goal information describes situations that are desirable. This allows
the agent a way to choose among multiple possibilities, selecting the one which reaches a
goal state. Search and planning are the subfields of artificial intelligence devoted to finding
action sequences that achieve the agent's goals.
In some instances the goal-based agent appears to be less efficient; it is more flexible
because the knowledge that supports its decisions is represented explicitly and can be
modified.

Agents so far have fixed implicit goals. We want agents with variable goals.

Example:
 Agent: robot maid
 Environment: house & people.
 Goals: clean clothes, tidy room, table laid, etc

22
Course module

Figure 2.9 Structure of model-based, goal-based agent.

function GOAL_BASED_AGENT (percept)


returns action
state  UPDATE-STATE (state, percept)
action  SELECT-ACTION [state, goal]
state  UPDATE-STATE (state, action)
return action
Figure 2.10 A model-based, goal-based agent. This model keeps track of the world state
as well as a set of goals it is trying to achieve, and chooses an action that will (eventually)
lead to the achievement of its goals.

2.4.3 Utility-based agent


Goal-based agents only distinguish between goal states and non-goal states. It is
possible to define a measure of how desirable a particular state is. This measure can be
obtained through the use of a utility function which maps a state to a measure of the
utility of the state. A more general performance measure should allow a comparison of
different world states according to exactly how happy they would make the agent. The
term utility can be used to describe how "happy" the agent is.
A rational utility-based agent chooses the action that maximizes the expected utility of
the action outcomes- that is, the agent expects to derive, on average, given the
probabilities and utilities of each outcome. A utility-based agent has to model and keep
track of its environment, tasks that have involved a great deal of research on perception,
representation, reasoning, and learning.

 Agents so far have had a single goal.


 Agents may have to juggle conflicting goals.

23
Course module

 Need to optimize utility over a range of goals.


 Utility: measure of goodness (a real number).
 Combine with probability of success to get expected utility.
Example:
–Agent: automatic car.
–Environment: roads, vehicles, signs, etc.
–Goals: stay safe, reach destination, be quick, obey law, save fuel, etc.

Figure 2.11 Structure of a model-based, utility-based agent.

function UTILITY_BASED_AGENT (percept)


returns action
state  UPDATE-STATE (state, percept)
action  SELECT-OPTIMAL_ACTION [state,
goal]
state  UPDATE-STATE (state, action)
return action
Figure 2.12 A model-based, utility-based agent. It uses a model of the world, along with a
utility function that measures its preferences among states of the world. Then it chooses
the action that leads to the best expected utility, where expected utility is computed by
averaging over all possible outcome states, weighted by the probability of the outcome.

2.4.4 Learning agent

Learning has an advantage that it allows the agents to initially operate in unknown
environments and to become more competent than its initial knowledge alone might allow.
The most important distinction is between the "learning element", which is responsible for
making improvements, and the "performance element", which is responsible for selecting
external actions.

24
Course module

The learning element uses feedback from the "critic" on how the agent is doing and
determines how the performance element should be modified to do better in the future. The
performance element is what we have previously considered to be the entire agent: it takes
in percepts and decides on actions.
The last component of the learning agent is the "problem generator". It is responsible for
suggesting actions that will lead to new and informative experiences.
How do agents improve their performance in the light of experience?
–Generate problems which will test performance.
–Perform activities according to rules, goals, model, utilities, etc.
–Monitor performance and identify non-optimal activity.
–Identify and implement improvements.

Figure 2.13 Structure of a Learning-based agent.

 Learning element – responsible for making improvements


 Performance element – responsible for selecting external actions (it is what we had
defined as the entire agent before)
 Learning element uses feedback from the critic on how the agent is doing and
determines how the performance element should be modified to do better in the
future
 Problem generator is responsible for suggesting actions that will lead to a new and
informative experiences

25
Course module

Review Questions
1. Define an agent.
2. What is a rational agent? And what is intelligent agent?
3. What is bounded rationality?
4. What is an autonomous agent?
5. Describe the salient features of an agent.
6. Find out the following about the football player agent.
1. What are the percepts for this agent?
2. Characterize the operating environment.
3. What are the actions the agent can take?
4. How can one evaluate the performance of the agent?
5. What sort of agent architecture do you think is most suitable for this agent?
7. Answer the same questions as above for an Internet shopping agent.

26
Course module

Chapter 3: Solving Problems

3.1 Solving Problems by Searching

The problem that AI tackles has a combinatorial explosion of solutions. (For e.g in case of
chess the number of possible positions has been estimated about 35*35*…(100 times). To
cope up with combinatorial explosion of solutions, AI programs use heuristics to prune to
search tree. AI programs should deal with real life problems to a large extent as if a human
expert has the capacity to handle uncertain, incomplete and irrelevant information.

3.1.1 Problem Solving Agents


Intelligent agents are supposed to act in such a way that the environment goes through a
sequence of states that maximizes the performance measure. In its full generality, this
specification is difficult to translate into a successful agent design. Goal formulation,
based on the current situation, is the first step in problem solving. As well as formulating
a goal, the agent may wish to decide on some other factors that affect the desirability of
different ways of achieving the goal.

3.1.2 Problem Formulation


A problem is really a collection of information that the agent will use to decide what to
do. There are four essentially different types of problems—single state problems, multiple-
state problems, contingency problems, and exploration problems.
We will begin by specifying the information needed to define a single-state problem.
We have seen that the basic elements of a problem definition are the states and actions. To
capture these formally, we need the following:

 The initial state that the agent knows itself to be in.


 The set of possible actions available to the agent. The term operator is used to
denote the description of an action in terms of which state will be reached by
carrying out the action in a particular state. (An alternate formulation uses a
successor function S. Given a particular state x, S(x) returns the set of states
reachable from x by any single action.)
Together, these define the state space of the problem: the set of all states reachable from
the initial state by any sequence of actions. A path in the state space is simply any sequence
of actions leading from one state to another. The next element of a problem is the following:
 The goal test, which the agent can apply to a single state description to determine
if it is a goal state. Sometimes there is an explicit set of possible goal states and the
test simply checks to see if we have reached one of them. Sometimes the goal is
specified by an abstract property rather than an explicitly enumerated set of states.
For example, in chess, the goal is to reach a state called "checkmate," where the
opponent's king can be captured on the next move no matter what the opponent
does.
Finally, it may be the case that one solution is preferable to another, even though they both

27
Course module

reach the goal. For example, we might prefer paths with fewer or less costly actions.
 A path cost function is a function that assigns a cost to a path. In all cases we will
consider, the cost of a path is the sum of the costs of the individual actions along
the path. The path cost function is often denoted by g.
Together, the initial state, operator set, goal test, and path cost function define a problem.

3.1.3 Search Strategies and their Criteria

The majority of work in the area of search has gone into finding the right search strategy
for a problem. Search strategies could be categorized as uninformed (blind) search,
informed (heuristics) search, Constraint Satisfaction Search (CSS), and Game playing
search
These strategies could be evaluated in terms of four criteria:
 Completeness: is the strategy guaranteed to find a solution when there is one?
 Time complexity: how long does it take to find a solution?
 Space complexity: how much memory does it need to perform the search?
 Optimality: does the strategy find the highest-quality solution when there are
several different solutions?

3.1.3.1 Uninformed (Blind) Search Strategies

Uninformed search means that they have no information about the number of steps or the
path cost from the current state to the goal—all they can do is distinguish a goal state from
a non-goal state. Uninformed search is also sometimes called blind search.
5. Breadth-first search(BFS)
The breadth-first search algorithm starts by examining all nodes one level down from the
root node. As its name suggests, this approach involves traversing a tree by breadth (level-
by-level) rather than by depth. If a goal state is reached here, success is reported else, search
continues by expanding paths from all the nodes in the current level down to the next level.
Reports success when a goal node is found, and reports failure if all nodes have been
examined and no goal node has been found.

28
Course module

 Breadth-first search is a far better method to use in situations where the tree may
have very deep paths, and particularly where the goal node is in a shallower part of
the tree.
 Time Complexity of a BFS depends on the branching factor of the tree, and depth
of the goal node in the tree. BFS search needs to store information about all paths
that reach the current depth and so not efficient in space.

6. Depth-first search
DFS is a commonly used algorithm for
search. Depth-first search is so called because it
follows each path to its greatest depth before moving
on to the next path.
Assuming that we start from the left side and
work toward the right, depth-first search involves
working all the way down the left-most path in the
tree until a leaf node is reached. If this is a goal state,
the search is complete, and success is reported. If the
leaf node does not represent a goal state, search
backtracks up to the next highest node that has an
unexplored path. Once this node has been examined,
search backtracks to the next unexpanded node. This
process continues until either all the nodes have been examined, in which case the search
has failed, or until a goal state has been reached, in which case the search has succeeded.
 Depth-first search uses a method called chronological backtracking to move back
up the search tree once a dead end has been found. Chronological backtracking is
so called because it undoes choices in reverse order of the time the decisions were
originally made. It is also somewhat easier for humans to understand because it
much more closely relates to the natural way in which humans search for things.
 Depth-first search is often used by computers for search problems such as locating
files on a disk, or by search engines for spidering the internet.

29
Course module

 Depth-first search is very efficient in space because it only needs to store


information about the path it is currently examining, but it is not efficient in time
because it can end up examining very deep branches of the tree. For e.g. if a branch
of the search tree is extremely large, or even infinite, then the search algorithm will
spend an inordinate amount of time examining that branch, which might never lead
to a goal state.
 Depth-first search is an example of tentative search.

Comparison of BFS and DFS

Advantages of DFS over BFS


 Depth-first search is usually simpler to implement than breadth-first search.
 DFS usually requires less memory usage because it only needs to store
information about the path it is currently exploring, whereas breadth-first
search needs to store information about all paths that reach the current
depth. This is one of the main reasons that depth-first search is used so
widely to solve everyday computer problems.
Advantages of BFS over DFS
 BFS always examines all the nodes at level ‘n’ before proceeding to level
‘n+1’ and so finds the shortest path to a goal node.
 Breadth-first search is an optimal search method, but depth-first search is
not. Depth-first search returns the first solution it happens to find, which
may be the worst solution that exists.
7. Iterative deepening search
Depth-First Iterative Deepening or DFID (also called Iterative Deepening Search
or IDS), is a search algorithm that remedies many of the drawbacks of both the depth-first
and breadth-first search. It is an exhaustive search technique that combines depth-first with
breadth-first search.
DFID is a state space search strategy in which a depth-limited search is run repeatedly,
increasing the depth limit with each iteration until it reaches d, the depth of the shallowest
goal state. On each iteration, DFID visits the nodes in the search tree in the same order as
depth-first search, but the cumulative order in which nodes are first visited, is effectively
breadth-first.
DFID performs a depth first search of the space with a depth of bound 1. (The depth
bound forces a failure on search path, once it gets below a certain level. This causes a
breadth like sweep of the search space at that level.).If it fails to find a goal it performs

30
Course module

another depth-first search with a depth of bound 2. This continues, increasing the depth
bound by one at each iteration. At each iteration the algorithm performs a complete depth-
first search of the current depth bound. No information about the state space is retained
between iterations.
 Because the algorithm searches the space in a level-by-level fashion, it is
guaranteed to find a shortest path to a goal.
 This is an algorithm that appears to be somewhat wasteful in terms of the number
of steps that are required to find a solution.
 However, it has the advantage of combining the efficiency of memory use of depth-
first search. It also shares the advantage of breadth-first search that it will always
find the path that involves the fewest steps through the tree (although, not
necessarily the best path).
 Like breadth-first search, DFID is optimal and complete. It is an extremely good
search method to use where the search space may be very large and where the depth
of the goal node is not known.
Procedure
Successive depth-first searches are conducted – each with depth bounds increasing
by 1

Depth First Iterative Deepening combines the advantage of BFS (i.e., completeness) with
the advantages of DFS (i.e., limited space and finds longer paths more quickly)
This algorithm is generally preferred for large state spaces where the solution depth is
unknown.
There is a related technique called iterative broadening is useful when there are many goal
nodes. This algorithm works by first constructing a search tree by expanding only one child
per node. In the 2nd iteration, two children are expanded, and in the Ith iteration I children
are expanded.
8. Bidirectional search
Suppose that the search problem is such that the arcs are bidirectional. That is, if there is
an operator that maps from state A to state B, there is another operator that maps from state
B to state A. Many search problems have reversible arcs. 8-puzzle, 15-puzzle, path
planning etc are examples of search problems. However there are other state space search
formulations which do not have this property. The water jug problem is a problem that does
not have this property. But if the arcs are reversible, you can see that instead of starting
from the start state and searching for the goal, one may start from a goal state and try

31
Course module

reaching the start state. If there is a single state that satisfies the goal property, the search
problems are identical.
How do we search backwards from goal? One should be able to generate predecessor states.
Predecessors of node n are all the nodes that have n as successor. This is the motivation to
consider bidirectional search.

Algorithm: Bidirectional search involves alternate searching from the start state toward
the goal and from the goal state toward the start. The algorithm stops when the frontiers
intersect.
Bidirectional search can sometimes lead to finding a solution more quickly. The reason can
be seen from inspecting the following figure.

32
Course module

3.1.3.2 Informed (Heuristics) Search

Depth-first and breadth-first search were described as brute-force search methods. This is
because they do not employ any special knowledge of the search trees they are examining
but simply examine every node in order until they reach the goal. In some cases, this is the
best that can be done because there is no additional information available that can be used
to direct the search any better.
Often, however, such information does exist and can be used. Take the example of looking
for a suitable Christmas gift. Very few people would simply walk into each shop as they
came across it, looking in each department in turn until they choose a present. Most people
would go straight to the shop that they considered to be most likely to have a suitable gift.
If no gift was found in that shop, they would then proceed to the shop they considered to
be the next most likely to have a suitable gift; which means they are having some
information about the availability of suitable gifts. This kind of information is called a
heuristic, and humans use them all the time to solve all kinds of problems.
Computers can also use heuristics, and in many problems heuristics can reduce an
otherwise impossible problem to a relatively simple one.
AI problem solvers employ heuristics in two basic situations:
1. A problem may not have an exact solution because of inherent ambiguities in the
problem statement or available data. Medical diagnosis is an example of this. A
given set of symptoms may have several possible causes; doctors use heuristics to
choose the most likely diagnosis and formulate a plan of treatment.
2. A problem may have an exact solution, but
the computational cost of finding it may be Heuristics are formalized as
prohibitive. In problems like chess, state
space growth is combinatorially explosive, rules for choosing those
with the number of possible states branches in a state space that
increasing exponentially or factorially with
the depth of the search. are more likely to lead to an
 DFS or BFS may fail to find a solution acceptable problem solution.
within any practical length of time. By
eliminating unpromising states and their
descendants from consideration, a heuristic algorithm can defeat this combinatorial
explosion and find an acceptable form.
 A heuristic is only an informed guess of the next step to be taken in a problem
solving. It’s often based on experience or intuition. Because heuristics use limited
information, they are seldom able to predict the exact behavior of the state space
farther along in the search.
 A heuristic can lead a search algorithm to a suboptimal solution or fail to find any
solution at all. This is an inherent limitation of heuristics.
 Heuristics and design of algorithms to implement heuristic search have long been
a core concern in AI. It’s impossible to examine every inference that can be made
in mathematics domain or every possible move on a chess board. Heuristic search
is often the only practical answer.

Heuristic algorithm consists of 2 parts:

33
Course module

1. The Heuristic Measure.


2. Algorithm that causes it to search the State Space.

Heuristic evaluation function


A heuristic evaluation function is a function that when applied to a node gives a value
that represents a good estimate of the distance of the node from the goal. For two nodes
‘m’ and ‘n’, and a heuristic function ‘f’ , if f(m) < f(n), then it should be the case that ‘m’
is more likely to be on an optimal path to the goal node than ‘n’.
In other words, the lower the heuristic value of a node, the more likely it is that it is on an
optimal path to a goal and the more sensible it is for a search method to examine that node.
The heuristic used in search is one that provides an estimate of the distance from any
given node to a goal node. This estimate may or may not be accurate, but it should at least
provide better results than pure guesswork.
Informed and Uninformed methods
A search method is informed if it uses additional information about nodes that have not
yet been explored to decide which nodes to examine next. If a method is not informed, it
is uninformed, or blind. In other words, search methods that use heuristics are informed,
and those that do not are blind.
Best-first search is an example of informed search, whereas breadth-first and depth-first
search are uninformed or blind.
Heuristic search algorithms
Hill Climbing
The simplest way to implement heuristic search is through a procedure called hill
climbing. Sometimes also called the gradient descent (or ascent).In examining a search
tree, hill climbing will move to the first successor node that is “better” than the current
node. The basic idea is to always head towards a state which is better than the current
one.
Hill climbing strategies expand the current state in the search, evaluate its children. The
best child is selected for further expansion; neither its parents nor its siblings are retained.
Search halts when it reaches a state that is better than any of its children or a goal is found.
Because it keeps no history the algorithm cannot recover from its failure of its strategy.
Algorithm to hill climbs:
1. Form a one-element consisting of the root node.
2. Until the queue is empty or the goal has been reached, determine if the first element
in the queue is the goal node.
2a. If the first element is the goal node, do nothing.
2b. If the first element is not the goal node, pop the first element from the stack,
sort the first element’s children, if any, by estimated remaining distance, and then
push first elements children, if any, to the stack.
3. If the goal node has been found, announce success; otherwise announce failure.
 Search keeps going as long as the path is improving.
 Need a locally evaluable "goodness" function, known as the evaluation function
 It never backtracks.
 Neither its parents nor its siblings are retained.
 Fast, but not guaranteed to find a solution;
34
Course module

 Solution found not necessarily globally optimal- the strategy can get stuck in a locally
optimal solution. This is because hill climbing uses only local knowledge for
controlling search.
 Similar to best first, but successors added differently.
o Best First: Pick node with minimum heuristic estimate to expand next.
o Hill Climbing: Pick node from the successors of last expanded node with
minimum h (i.e., once decided to expand a node, only consider its
successors and never try an alternative path).
 Problems:
o Foothill problem - may stop at a local maxima
A major problem of hill climbing strategies is If you try to climb a mountain in fog with an
their tendency to become stuck at local
altimeter but no map, you might use the hill
maxima. If they reach a state that has a better climbing Generate and Test approach: Check
state than any of its children, the algorithm
the height 1 foot away from your current
halts. If this is not a goal, but just a local location in each direction: north, south, east,
maximum, the algorithm fails to find a and west.
solution. As soon as you find a position where the height
Search methods without backtracking or is higher than your current position, move to
some other recovery mechanism are unable to that location and restart the algorithm. If all
distinguish between local and global maxima. directions lead lower than your current
There are methods for getting around the position, then you stop and assume you have
problem, such as randomly perturbing the reached the summit. This might not necessarily
evaluation function. But in general there is no always be true.
way of guaranteeing optimal performance
with hill climbing techniques. In spite of its limitations hill climbing can be used effectively
if the evaluation function is sufficiently informative to avoid local maxima and infinite
paths.
Hill climbing is an example of an informed search method because it uses information
about the search space to search in a reasonably efficient manner.
In general, heuristic search requires a more flexible algorithm. This is provided by best-
first search, where with a priority queue, recovery from local maxima is possible.
Best-first search
 Best-first search algorithms use a heuristic evaluation function to estimate which
node is ``best'' to expand. (The lower the heuristic value, the better the node.)
 This heuristic function f(node) may depend on the description of node, the
description of the goal, the information gathered by the search up to that point, and
most important, on any extra knowledge about the problem domain.
 The ``best'' node to expand is the one that is estimated to be best at the time, but
may turn out to be a poor choice.
 Efficient selection of the current best candidate for extension is typically
implemented using a priority queue. The unexpanded nodes are placed on a priority
queue ordered by the evaluation function. With best-first search the entire queue is
sorted after new paths have been added to it, rather than adding a set of sorted paths.
 Continue working from the best node on the active list as long as its successors are
still improving.

35
Course module

 Will find a solution since all successors of a node are added (no pruning). However,
does not guarantee an optimal answer unless the heuristic function is set up just
right.
 Best first search is a little like hill climbing, in that it uses an evaluation function
and always chooses the next node to be that with the best score. However, it is
exhaustive, in that it should eventually try all possible paths. It uses a list as in
breadth/depth first search, but instead of taking the first node off the list (and
generating its successors) it will take the best node off, ie the node with the best
score. The successors of the best node will be evaluated (ie have a score assigned
to them) and added to the list.
 Best-first algorithms are often used for path finding in combinatorial search.
 Examples of best-first search algorithms include the A* search algorithm.

Algorithm to conduct a best-first search:


1. Form a one-element list consisting of the root node.
2. Until the list is empty or the goal has been reached, determine if the first element
in the list is the goal node.
2a. If the first element is the goal node, do nothing.
2b. If the first element is not the goal node, remove the first element from the list,
add the first element’s children, if any, to the front of the list, and sort the entire list
by estimated remaining distance.
3. If the goal node has been found, announce success; otherwise announce failure.

 A good evaluation function may drastically cut down the amount of search to be
done to find a solution.
 We may not find the best solution or at least, the first solution found may not be the
best, but if a solution exists we will eventually find it, and there is a good chance
of finding it quickly.
 If the evaluation function is not good then, it’s just as using simpler search
techniques such as depth first or breadth first. And if evaluation function is very
expensive (ie, it takes a long time to work out a score) the benefits of cutting down
on the amount of search may be outweighed by the costs of assigning a score.
Beam search
 Beam search is a form of breadth-first search that employs a heuristic, as seen with
hill climbing and best-first search. An optimization of best-first search that
reduces its memory requirement.
 Beam search is like breadth first search because beam search progresses level by
level. Unlike breadth-first search, however, beam search only moves downward
from the best nodes at each level. The other nodes are ignored forever.
 At each level of the tree, it generates all successors of the states at the current level,
sorts them in order of increasing heuristic values. However, it only stores a
predetermined number of states at each level (called the beam width). But may
miss solution if heuristic is poorly chosen.
 The smaller the beam width, the more states are pruned. Therefore, with an
infinite beam width, no states are pruned and beam search is identical to breadth-
first search.

36
Course module

 The beam width bounds the memory required to perform the search, at the expense
of risking completeness (possibility that it will not terminate) and optimality
(possibility that it will not find the best solution). The reason for this risk is that the
goal state could potentially be pruned.
 A beam search is most often used to maintain tractability in large systems with
insufficient amount of memory to store the entire search tree. For example, machine
translation systems. The first use of a beam search was in the Harpy Speech
Recognition System, CMU 1976.
 Consequently the number of nodes explored remains manageable, even if there is a
great deal of branching and the search is deep. If beam search of width ‘w’ is used
in a tree with branching factor ‘b’, there will be only ‘wb’ nodes under
consideration at any depth, not the explosive number there would be if breadth-
first search were used.
 Only the best few paths are followed downward at each level. This method is very
efficient in memory usage and would be particularly useful for exploring a search
space that had a very high branching factor (such as in game trees for games, such
as Go or Chess).
 It has the disadvantage of not exhaustively searching the entire tree and so may
fail to ever find a goal node.
Choosing a good heuristic
Some heuristics are better than others, and the better (more informed) the heuristic
is, the fewer nodes it needs to examine in the search tree to find a solution. Hence, like
choosing the right representation, choosing the right heuristic can make a significant
difference in our ability to solve a problem.
 In choosing heuristics, we usually consider a heuristic that reduces the number of
nodes that need to be examined in the search tree as a good heuristic.
 It is also important to consider the efficiency of running the heuristic itself. In other
words, if it takes an hour to compute a heuristic value for a given state, the fact that
doing so saves a few minutes of total search time is irrelevant.
Admissibility, monotonicity and informedness
Behaviour of heuristics is evaluated along a number of dimensions. For instance, we may
not only desire a solution but also may require the algorithm to find the shortest path to the
goal. This could be important when an application might have an excessive cost for extra
solution steps, such as planning a path for an autonomous robot through a dangerous
environment.
Heuristics that find the shortest path to a goal whenever it exists are said to be admissible.
In other applications a minimal solution path might not be as important as overall problem-
solving efficiency. In what sense is one heuristic better than another- this is the
informedness of a heuristic. When a state is discovered by using a heuristic search, is there
any guarantee that the same state won’t be found later in the search at a cheaper cost(with
a shorter path from the start state.)? This is the property of monotonicity.
Admissibility measures
 A search algorithm is admissible if it is guaranteed to find a minimal path to a
solution whenever such a path exists.
o Breadth-first search is an admissible strategy. Because it looks at every state at
level ‘n’ of the graph before considering any state at level ‘n+1’, any goal nodes

37
Course module

are found along the shortest possible path. Unfortunately breadth-first search is
often too inefficient for practical use.
 An admissible heuristic is a heuristic that never overestimates the true distance of
a node from the goal.
Monotonicity
 A search method is described as monotone if it always reaches a given node by the
shortest possible path.
 A search method that reaches a given node at different depths in the search tree is
not monotone.
 A monotone search method must be admissible, provided there is only one goal
state.
 A monotonic heuristic is a heuristic that has this property.
Informedness
 A heuristic ‘h’ is said to be more informed than another heuristic, ‘j’, if h (node)
>=j (node) for all nodes in the search space. (In fact, in order for ‘h’ to be more
informed than ‘j’, there must be some node where h (node) >j (node). Otherwise
they are as informed as each other.)
 The more informed a search method is, the more efficiently it will search.

Identifying optimal paths


The optimal path is the one that has the lowest cost or involves traveling the shortest
distance from start to goal node. The techniques described previously may find the
optimal path by accident, but none of them are guaranteed to find it.
British museum procedure
The simplest method for identifying the optimal path is called the British Museum
procedure. This process involves examining every single path through the search tree and
returning via the best path that was found. Because every path is examined, the optimal
path must be found. This process is implemented as an extension of one of the exhaustive
search techniques, such as depth-first or breadth-first search, but rather than stopping
when a solution is found, the solution is stored and the process continues until all paths
have been explored. If an alternative solution is found, its path is compared with the stored
path, and if it has a lower cost, it replaces the stored path.
The following are the more sophisticated techniques for identifying optimal paths
 A*
 A
 Uniform Cost Search (Branch and Bound)
Assuming that none of the branches of the tree is infinitely deep, and that no level has an
infinite branching factor, then it does not matter which approach is used (depth first or
breadth first, for example) when running the British Museum procedure: because the goal
is to visit every node, the order the nodes are visited probably does not matter.
A* ALGORITHM
A* algorithms are similar to best-first search, but uses more complex heuristic to select a
path through the tree. The best-first algorithm always extends paths that involve moving to
the node that appears to be closest to the goal, but it does not take into account the cost of
the path to that node so far.

38
Course module

 The A* algorithm operates in the same manner as best-first search but uses the
following function to evaluate nodes: f(node) = g(node) + h(node) where
h(node)<=C(node)
node state encountered in the search.
g (node)  cost of the path so far leading up to the node.
h (node)  distance of the node from a goal state;
C (node) actual distance of the node from the goal.
f is called a path-based evaluation function.
 When operating A*, f(node) is evaluated for successor nodes and paths are
extended using the nodes that have the lowest values of f.
 All A* algorithms are admissible.
If h(node) is always an underestimate of the distance of a node to a goal node, then
the A* algorithm is optimal: it is guaranteed to find the shortest path to a goal state. A*
described as being optimally efficient, in finding the path to the goal node, it will
expand the fewest possible paths. Again, this property depends on h(node) always
being an underestimate.
 If a non admissible heuristic for h(node) is used, then the algorithm is called
algorithm A. If algorithm A is used with an evaluation function in which h(node)
is less than or equal to the cost of the minimal path from n to the goal, the resulting
search algorithm is called algorithm A*.
Special cases of A*
Algorithm A
Consider the evaluation function f(n)=g(n)+h(n); where n is any state encountered in the
search. g(n) is the cost of n from the start state. h(n) is the heuristic estimate of the cost of
going from n to a goal. If this is used with the best first search algorithm and h(n) is a non
admissible heuristic the result is called algorithm A.
Uniform cost search
Uniform cost search (or Branch and Bound) is a variation on best-first search that uses
the evaluation function g(node), which for a given node evaluates to the cost of the path
leading to that node from the initial state. In other words, this is an A* algorithm but
where h(node) is set to zero.
 At each stage, the path that has the lowest cost so far is extended. In this way, the
path that is generated is likely to be the path with the lowest overall cost, but this is
not guaranteed.
 To find the best path, the algorithm needs to continue running after a solution is
found, and if a preferable solution is found, it should be accepted in place of the
earlier solution.

39
Course module

Consider the following problem:


To find the shortest route from S to G; that is S is the initial state and
G is the goal state. We can see that SBG is the shortest route but if we
let breadth first search loose on the problem it will find the path SAG;
assuming that A is the first node to be expanded at level 1.
But this is how uniform cost search tackles the problem.

We start with the initial state and expand it. This leads to the tree below:

The path cost of A is the cheapest, so it is expanded next as shown

We now have a goal state but the algorithm does not recognize it yet as there is still a node
with a cheaper path cost. In fact, what the algorithm does is order
the queue by the path cost so the node with cost 11 will be behind
node B in the queue. Node B (being the cheapest) is now expanded,
giving

A goal state (G10) will now be at the front of the queue. Therefore
the search will end and the path SBG will be returned.

In summary, uniform cost search will find the cheapest solution provided that the cost
of the path never decreases as we proceed along the path.

3.1.3.3 Constraint Satisfaction Search

• It can be solved by iterative improvement method


– First assign values to all values of the variables
– Then apply modifications operators to move the configuration towards the
goal
• Modification operators simply assign a different value to a variable
– In choosing a new value for a variable, the most obvious heuristic is to select
the value that results in the minimum number of conflicts with other
variables - the min-conflicts heuristic or max-conflicts heuristic
• Algorithms that solves CSPs problems in this fashion are called heuristic repair
methods

Example: the 8-queens problem

40
Course module

3.1.3.4 Games as Search Problems

One of the most interesting and well publicized areas of Artificial Intelligence research has
been in the playing of games. With the success of Deep Blue in 1997, a landmark was
reached: a computer program that could defeat the best chess player in the world.
Game-playing systems tend to rely heavily on the search techniques in combination with a
number of heuristics and often a detailed database of knowledge about the game. This
chapter explains the relationship between search and games. It explains the concepts of
Minimax and alpha–beta pruning.

Tic-Tac-Toe Problem

• Given an n x n matrix, the object of the game is to make three of your symbol in a
row, column or diagonal
– This is a win state for the game.
– Think a 3 x 3 square board with 9 open places where:
– One player is designated as player X and makes the first play by marking
an X into any of the n x n open squares of the board.
– The second player, "O", then follows suit by marking an O into any of the
other open squares that remain.
– This continues back-and-forth until one player wins the game or players fill
all squares on the board without establishing a winner. This is a draw.

41
Course module

How to play a game?


• The main objective in playing is to win the game; which requires to select the best
move carefully:
– The system first generates all possible legal moves, and applies them to the
current board.
– Evaluate each of the positions/states and
– Determine the best one to move.
– In a game like tic-tac-toe this process is repeated for each possible move
until the game is won, lost, or drawn.
– Wait for your opponent to move and repeat
• For real problems, the search tree is too big to make
it possible to reach the terminal states
– Example:
• Chess: 10120 nodes
• 8 Puzzle: 105 nodes
• How many nodes to consider in a Tic-Tac-Toe game with 3 x 3
board?
Game Tree Search
Many two-player games can be efficiently represented using trees, called game trees. A

42
Course module

game tree is an instance of a tree in which the root node represents the state before any
moves have been made, the nodes in the tree represent possible states of the game (or
positions), and arcs in the tree represent moves.
 It is usual to represent the two players’ moves on alternate levels of the game tree, so
that all edges leading from the root node to the first level represent possible moves
for the first player, and edges from the first level to the second represent moves for
the second player, and so on.
 Leaf nodes in the tree represent final states, where the game has been won, lost, or
drawn. In simple games, a goal node might represent a state in which the computer
has won, but for more complex games such as chess, the concept of a goal state is
rarely of use.
 One approach to playing a game might be for the computer to use a tree search
algorithm such as depth-first or breadth-first search, looking for a goal state (i.e., a
final state of the game where the computer has won).
Unfortunately, this approach does not work because there is another intelligence
involved in the game. We will consider this to be a rational, informed opponent who plays
to win. Whether this opponent is human or another computer does not matter—or should
not matter.

• Problem spaces for typical games are represented as trees


• Game tree represents possible moves by both players given an initial configuration.
– Each node represents a (board) configuration. Ex. Each node marked by a
letter (A, B etc.)
– Root node represents initial configuration
– Children of a node n indicate possible configurations after the player makes
a move from node n
• Ex. B, C, D are children of A. They are possible configurations after
player makes a move from configuration A.
– In case of alternating moves between the players, alternating levels in a tree
have alternating moves.
• Each level of the tree has nodes that are all MAX or all MIN; nodes
at level i are of the opposite kind from those at level i+1.
• Game between players X and Y. Let us analyze from X's perspective by looking ahead
of two moves.
– H is a winning state for X (marked by plus infinity). If H reached, X wins.
No further moves.
– E, M are losing states for X (marked by minus infinity). If E or M reached,
X loses. No further moves.

43
Course module

Review Questions
1. Explain the idea behind Generate and Test. Why is this method described as being
exhaustive ?
2. Explain the differences and similarities between depth-first search and breadth-first
search.
3. Explain what is meant by the following terms in relation to search methods:
a) completeness
b) optimality.
4. What does it mean to say that a search method is monotonic?
5. Explain why Depth-First Search Iterative Deepening is reasonably efficient. Why
might it be preferable to use DFID rather than depth-first search?
6. Provide a definition of the word “heuristic.” In what ways can heuristics be useful
in search?
7. Explain the components of the path evaluation function f(node) used by A*.

44
Course module

Chapter 4: Knowledge and Reasoning

4.1 Logical Agents

Humans, it seems, know things and do reasoning. Knowledge and reasoning are also
important for artificial agents because they enable successful behaviors that would be very
hard to achieve otherwise.
Knowledge and reasoning also play a crucial role in dealing with partially observable
environments.
Logic has the pedagogical advantage of being a simple example of a representation for
knowledge-based agents, but logic has some severe limitations. Clearly, a large portion of
the reasoning carried out by humans and other agents in partially observable environments
depends on handling knowledge that is uncertain. Logic cannot represent this uncertainty
well.
Knowledge-based agents
The central component of a knowledge-based agent is its knowledge base, or KB.
Informally, a knowledge base is a set of sentences. The capabilities of representation,
reasoning, and learning are pillar to the development of the theory and technology of logic.
Logic defines the fundamental concepts of logical representation, reasoning, and
semantics of the language / the "meaning" of sentences. In logic, the definition is more
precise. The semantics of the language defines the truth of each sentence with respect to
each possible world.

4.1.1 Propositional Logic

Propositional logic is a declarative language because its semantics is based on a truth


relation between sentences and possible worlds. Propositional logic is a very simple
language consisting of proposition symbols and logical connectives. It can handle
propositions that are known true, known false, or completely unknown. Propositional logic
has a third property that is desirable in representation languages, namely compositionality.
In a compositional language, the meaning of a sentence is a function of the meaning of its
parts.
Inference in Propositional logic is the process of deriving new sentences from old ones.
Sound inference algorithms derive only sentences that are entailed; complete algorithms
derive all sentences that are entailed.
Inference with Horn clauses can be done through the forward chaining and backward
chaining algorithms. Both of these algorithms are very natural, in that the inference steps
are obvious and easy to follow for humans.
The forward-chaining algorithm, as its name suggests, works forwards from the query to
conclusion. It is easy to see that forward chaining is sound: every inference is essentially
an application of Modus Ponens. Forward chaining is also complete: every entailed
atomic sentence will be derived.
The backward-chaining algorithm, as its name suggests, works backwards from the query.
Backward chaining is a form of goal-directed reasoning. It is useful for answering specific
questions such as "What shall I do now?" and "Where are my keys?"

45
Course module

NB: please refer Logic in Computer Science course that you have taken.

4.1.2 Predicate (First-Order) Logic

First-order logic is sufficiently expressive to represent a good deal of our commonsense


knowledge. It is a much more expressive language than the propositional logic.
NB: please refer Logic in Computer Science course that you have taken.

4.1 Inference in First-Order Logic


The Inference rule in FOL is used for quantifiers, Modus Ponens and unifications/
substitutions.
Like Inference in Horn clauses, Inference with first-order definite clauses can be done
through the forward chaining and backward chaining algorithms.
A forward-chaining algorithm for propositional definite clauses start with the atomic
sentences in the knowledge base and apply Modus Ponens in the forward direction, adding
new atomic sentences, until no further inferences can be made. A forward-chaining
algorithm for first-order definite clauses/literals can include variables, in which case those
variables are assumed to be universally quantified.
Backward chaining algorithms work backward from the goal, chaining through rules to
find known facts that support the proof.

4.2 Knowledge Representation

In order for a computer to solve a problem that relates to the real world, it first needs some
way to represent the real world internally. That is representation of knowledge. Knowledge
is used to achieve intelligent behavior. And the fundamental goal of knowledge
representation is to represent knowledge in a manner to facilitate inference (i.e. drawing
conclusions from knowledge).
Knowledge representation is an area in artificial intelligence that is concerned with how
to formally "think", that is, how to use a symbol system to represent "a domain of
discourse" along with functions that may or may not be within the domain of discourse,
that allow inference (formalized reasoning) about the objects within the domain of
discourse to occur.
Knowledge Representation (KR) expresses knowledge explicitly in a computer-tractable
way such that the agent can reason out.
• Some of the methods used for knowledge representation include Logic, Semantic
Nets, Frames and Production rules.
 Logic is general and can be used to represent any knowledge. But it lacked
facilities like: Packaging of data and procedures into KB; and also Built-in
inheritance A Logic is a formal language in which knowledge can be
represented such that conclusions can easily be drawn. It is a declarative
language to assert sentences & deduce from sentences.
 Semantic Nets, Frames and Production rules are less general, but more
natural & easier to work with. They used to define relations between objects
and support inference by inheritance.
46
Course module

Example: Fido is a dog, dogs have 4 legs, so Fido has 4 legs.

4.3 Knowledge-based Systems

What is Knowledge? Knowledge includes facts about the real world entities and the
relationship between them.
– It is an understanding gained through experience
– familiarity with the way to perform a task
– an accumulation of facts, procedural rules, or heuristics
– It may keep on changing (dynamic).

What is Knowledge base? Knowledge base is used to store facts and rules.

What is a Knowledge-based system?


 It deals with treating knowledge and ideas on a computer to emphasis the
importance of knowledge in a real world.
 It uses inference to solve problems on a computer.
 It describes programs that reason over extensive knowledge bases.
 Has the ability to learn ideas so that they can obtain information from outside to
use it appropriately.
 The value of the system lies in its ability to make the workings of the human mind
understandable and executable on a computer.

Figure 4.1: Knowledge Based System Architecture

KBS vs. AI
• Knowledge based system is part of Artificial Intelligence
• AI also requires extensive knowledge of the subject at hand.

47
Course module

– AI program should have knowledge base


– Knowledge representation is one of the most important and most active
areas in AI.
– AI program should be learning in nature and update its knowledge
accordingly.

4.4 Uncertain Knowledge and Reasoning

If the agent cannot find a categorical answer, the agent must therefore act under
uncertainty. Uncertainty can also arise because of incompleteness and incorrectness in the
agent's understanding of the properties of the environment.
Probability provides a way of summarizing the uncertainty. All probability statements
must therefore indicate the evidence with respect to which the probability is being assessed.
As the agent receives new percepts, its probability assessments are updated to reflect the
new evidence. Before the evidence is obtained, we talk about prior or unconditional
probability; after the evidence is obtained, we talk about posterior or conditional
probability.
We will use the notation P(A) for the unconditional or prior probability that the
proposition A is true. The proposition that is the subject of a probability statement can be
represented by a proposition symbol, as in the P(A) example. Propositions can also include
equalities involving so-called random variables. For example, if we are concerned about
the random variable weather, we might have
P( Weather = Sunny) = 0.7
P(Weather = Rain) = 0.2
P(Weather= Cloudy) = 0.08
P(Weather = Snow) = 0.02
Each random variable X has a domain of possible values (x\,...,xn) that it can take on.
Usually, we will use the letters A, B, and so on for Boolean random variables, and the
letters X, Y, and so on for multivalued variables.
We can view proposition symbols as random variables as well, if we assume that they have
a domain [true,false]. Thus, the expression P(A) can be viewed as shorthand for P(A =
true). Similarly, P(¬A) is shorthand for P(A =false).
Once the agent has obtained some evidence concerning the previously unknown
propositions making up the domain, prior probabilities are no longer applicable. Instead,
we use conditional or posterior probabilities, with the notation P(A\B). This is read as
"the probability of A given that all we know is B." It is important to remember that P(A\B)
can only be used when all we know is B. Conditional probabilities can be
defined in terms of unconditional probabilities. The equation

holds whenever P(B) > 0. This equation can also be written as


P(A A B) = P(A\B}P(B), which is called the product rule. We can also have it the other
way around:
P(A /\B) = P(B\A)P(A)

The following axioms are in fact sufficient:


48
Course module

1. All probabilities are between 0 and 1. 0 < P(A) < 1


2. Necessarily true (i.e., valid) propositions have probability 1, and necessarily false (i.e.,
unsatisfiable) propositions have probability 0. P(True) = 1 P(False) = 0
3. The probability of a disjunction is given by P(A V 5) = P(A) + P(B) - P(A A B)

49
Course module

Chapter 5: Machine Learning

5.1 Learning and Learning from Examples/Observation

Machine Learning or simply learning is the subfield of AI concerned with programs that
learn from experience.
What is learning? Learning is:
• One of the keys to human intelligence
• Memorizing something; examples: Telephone number, Reading textbook,
Understanding Language (memorizing grammar & practicing), Recognize
face, signature & fraudulent credit card transactions
• Knowing facts through observation and exploration; examples: Develop
scientific theory, Undertaking research
• Improving motor and/or cognitive skills through practice; examples: Riding
a bike, Exercising and practicing the idea

• The idea behind learning is that percepts should not only be used for acting now,
but also for improving the agent’s ability to act in the future.
– Learning is essential for unknown environments, i.e. when the agent lacks
knowledge. It enables to organize new knowledge into general, effective
representations
– Learning modifies the agent's decision making mechanisms to improve
performance

Learning takes place as a result of the interaction between the agent and the world, and
from observation by the agent of its own decision-making processes. Learning means
behaving better as a result of experience. Learning can range from trivial memorization of
experience to the creation of entire scientific theories.

A learning agent can be divided into four conceptual components, as shown in Figure 6.1.
1. The learning element: is responsible for making improvements. It takes some
knowledge about the learning element and some feedback on how the agent is doing,
and determines how the performance element should be modified to (hopefully) do
better in the future. The learning element is also responsible for improving the
efficiency of the performance element.
2. The performance element: is responsible for selecting external actions. It takes in
percepts and decides on actions.
3. The critic: is designed to tell the learning element how well the agent is doing. The
critic employs a fixed standard of performance. This is necessary because the percepts
themselves provide no indication of the agent's success. The critic observes the world
and passes information along to the learning element.
4. The problem generator: is responsible for suggesting actions that will lead to new
and informative experiences.

50
Course module

Types (forms) of Learning

 Supervised learning: occurs where a set of input/output pairs are explicitly


presented to the agent by a teacher
– The teacher provides a category label for each pattern in a training set, then the
learning algorithm finds a rule that does a good job of predicting the output
associated with a new input.
 Unsupervised learning: Learning when there is no information about what the
correct outputs are.
– In unsupervised learning or clustering there is no explicit teacher, the system
forms clusters or natural groupings of the input patterns.
 Reinforcement learning: an agent interacting with the world makes observations,
takes actions, & is rewarded or punished; it should learn to choose actions in order
to obtain a lot of reward.
– The agent is given an evaluation of its action, but not told the correct action.
Reward strengthens likelihood of its action. Typically, the environment is
assumed to be stochastic.

Figure 5.1 A general model of learning agents.

5.2 Knowledge in Learning

51
Course module

Prior knowledge is vital for learning. In most cases, the prior knowledge is represented as
general first-order logical theories; thus for the first time we bring together the work on
knowledge representation and learning.
In a logical setting, an example is an object that is described by a logical sentence; the attributes
become unary predicates. To understand the role of prior knowledge, we need to talk about the
logical relationships among hypotheses, example descriptions, and classifications.

Figure 5.2: A cumulative learning process uses, and adds to, its stock of background knowledge
over time.

5.3 Learning Probabilistic Models


See Bayesian Models.

5.4 Learning in Neural Networks

Learning in complex network representations is currently one of the hottest topics in


science. It promises to have broad applications in computer science, neurobiology,
psychology, and physics.
What is Neural Networks?
A neural network is a computational model that shares some of the properties of brains:
it consists of many simple units working in parallel with no central control. The
connections between units have numeric weights that can be modified by the learning
element.
The simple arithmetic computing elements correspond to neurons—the cells that perform
information processing in the brain—and the network as a whole corresponds to a
collection of interconnected neurons. For this reason, the networks are called neural
networks. Other names that have been used for the field include connectionism, parallel
distributed processing, neural computation, adaptive networks, and collective
computation. It should be emphasized that these are artificial neural networks; there is no
attempt to build computing elements out of animal tissue.
Besides their useful computational properties, neural networks may offer the best chance
of understanding many psychological phenomena that arise from the specific structure and
operation of the brain. Brains provide much of the motivation for the study of neural
networks.

52
Course module

A neural network is composed of a number of nodes, or units, connected by links. Each


link has a numeric weight associated with it. Weights are the primary means of long-term
storage in neural networks, and learning usually takes place by updating the weights. Some
of the units are connected to the external environment, and can be designated as input or
output units. The weights are modified so as to try to bring the network's input/output
behavior more into line with that of the environment providing the inputs.
It is represented as a layered set of interconnected processors. These processor nodes have
a relationship with the neurons of the brain.
• Each node has a weighted connection to several other nodes in adjacent layers.
Individual nodes take the input received from connected nodes and use the weights
together to compute output values.
• The inputs are fed simultaneously into the input layer.
• The weighted outputs of these units are fed into hidden layer.
• The weighted outputs of the last hidden layer are inputs to units making up the output
layer.

Figure 6.1 Neural network model

Neural networks are used to look for patterns in data, learn these patterns, and then classify
new patterns & make forecasts
A network with the input and output layer only is called single-layered neural network.
Whereas, a multilayer neural network is a generalized one with one or more hidden layer.
A network containing two hidden layers is called a three-layer neural network, and so on.

53
Course module

Chapter 6: Communicating, Perceiving, and Acting

Communication is such a widespread phenomenon that it is hard to pin down an exact


definition. In general, communication is the intentional exchange of information brought
about by the production and perception of signs drawn from a shared system of
conventional signs.
One of the actions that is available to an agent is to produce language. This is called a
speech act. "Speech" is used in the same sense as in "free speech," not "talking," so typing,
skywriting, and using sign language all count as speech acts. English has no neutral word
for an agent that produces language, either by speaking or writing or anything else.

6.1 Natural Language Processing

Natural language processing (NLP) is a field of computer science, artificial intelligence


(also called machine learning), and linguistics concerned with the interactions between
computers and human (natural) languages.
Natural language processing techniques make it practical to develop programs that make
queries to a database, extract information from texts, retrieve relevant documents from a
collection, translate from one language to another, or recognize spoken words. In all these
areas, there exist programs that are useful, but there are no programs that do a thorough job
in an open-ended domain.
The process of a computer extracting meaningful information from natural language input
and/or producing natural language output.
Natural language understanding is sometimes referred to as an AI-complete problem
because it seems to require extensive knowledge about the outside world and the ability to
manipulate it.

6.2 Natural Language for Communication

Human Language Technologies are information technologies that are specialized for
dealing with the most complex information medium in our world: human language.
Human language covers a broad range of activities with the eventual goal of enabling
people to communicate with machines using natural communication skills.
Human language also consists of computational linguistics (CL) and speech technology as
its core.
CL is an interdisciplinary field dealing with the statistical and/or rule-based modeling of
natural language from a computational perspective.
– Needs interdisciplinary teams, including linguists, language experts, and computer
scientists.
– Involves linguists, computer scientists, experts in artificial intelligence,
mathematicians, logicians, philosophers, cognitive scientists, cognitive
psychologists, psycholinguists, anthropologists and neuroscientists, etc.

54
Course module

Speech Technology relates to the technologies designed to duplicate and respond to the
human voice.
– Have many uses, including to aid the voice-disabled, the hearing-disabled, the blind,
and to communicate with computers without a keyboard, to market goods or services
by telephone and to enhance game software
– Consists of speech recognition, speech synthesis, speaker recognition, speaker
verification

Levels of Language Processing

● Phonetics and Phonology: The study of linguistic sounds


● Morphology: The study of the meaningful components of words
● Syntax: The study of the structural relationships b/n words
● Semantics: The study meaning
● Pragmatics: The study of how language is used to accomplish goals
● Discourse: The study of linguistic units larger than a single utterance

6.3 Perception

Perception provides agents with information about the world they inhabit. Perception is
initiated by sensors. A sensor is anything that can change the computational state of the
agent in response to a change in the state of the world. It could be as simple as a one-bit
sensor that detects whether a switch is on or off, or as complex as the retina of the human
eye, which contains more than a hundred million photosensitive elements.
There are a variety of sensory modalities that are available to artificial agents. Those they
share with humans include vision, hearing, and touch.

55
Course module

6.4 Robotics

The Robot Institute of America defines a robot as a programmable, multifunction


manipulator designed to move material, parts, tools, or specific devices through variable
programmed motions for the performance of a variety of tasks.
Robot is simply defined as an active artificial agent whose environment is the physical
world. The active part rules out rocks, the artificial part rules out animals, and the physical
part rules out pure software agents or softbots, whose environment consists of computer
file systems, databases and networks.
Robot’s body a made up of effectors and sensors parts with rigid links. Robots are
distinguished from each other by the effectors and sensors with which they are equipped.
For example, a mobile robot requires some kind of legs or wheels, and a teleoperated robot
needs a camera. We will assume that a robot has some sort of rigid body, with rigid links
that can move about. Links meet each other at joints, which allow motion.
Robots need not be so anthropomorphic; a wheel is a perfectly good link. Attached to the
final links of the robot are end effectors, which the robot uses to interact with the world.
End effectors may be suction cups, squeeze grippers, screwdrivers, welding guns, or paint
sprayers, to name a few. Some robots have special connectors on the last link that allow
them to quickly remove one end effector and attach another.
Effectors: Tools for action
An effector is any device that affects the environment, under the control of the robot. To
have an impact on the physical world, an effector must be equipped with an actuator that
converts software commands into physical motion. The actuators themselves are typically
electric motors or hydraulic or pneumatic cylinders. For simplicity, each actuator
determines a single motion or degree of freedom.
Effectors are used in two main ways: to change the position of the robot within its
environment (locomotion), and to move other objects in the environment (manipulation).
A third use, to change the shape or other physical properties of objects, is more in the realm
of mechanical engineering than robotics.
Sensors: Tools for perception
In the previous chapters we have covered the general principles of perception, using vision
as the main example, this section, we describe the other kinds of sensors that provide
percepts for a robot.
The well-equipped robot has one or more sensors, perhaps including cameras, infrared
sensors, radar, sonar, and accelerometers.
Robots can have sensors of various types, including vision, force sensing, tactile (touch)
sensing, sonar, and a sense of where their own body parts are.
Proprioception: The word proprioceptive is derived from the same source as
proprietary, and thus means "perception of privately owned (i.e., internal) stimuli." Like
humans, robots have a proprioceptive sense that tells them where their joints are.
Encoders fitted to the joints provide very accurate data about joint angle or extension. If
the output of the encoder is fed back to the control mechanism during motion, the robot
can have much greater positioning accuracy than humans. For a manipulator, this typically
translates to around a few mils (thousandths of an inch) of accuracy in its end-effector
position. In contrast, humans can manage only a centimeter or two. Mobots can measure
their change in position using odometry, based on sensors that measure wheel rotation.

56
Course module

Force sensing: Even though robots can sense and control the positions of their joints much
more accurately than humans, there are still many tasks that cannot be carried out using
only position sensing.
Force can be regulated to some extent by controlling electric motor current, but accurate
control requires a force sensor. These sensors are usually placed between the manipulator
and end effector and can sense forces and torques in six directions. Using force control, a
robot can move along a surface while maintaining contact with a fixed pressure. Such
motions are called compliant motions, and are extremely important in many robotic
applications.
Tactile sensing: Tactile sensing (or touch sensing) is the robotic version of the human
sense of touch. A robot's tactile sensor uses an elastic material and a sensing scheme that
measures the distortion of the material under contact. The sensor may give data at an array
of points on the elastic surface, producing the analogue of a camera image, but of
deformation rather than light intensity. Tactile sensors can also sense vibration, which
helps to detect the impending escape of the coffee cup from the holder's grasp. Human
beings use this scheme with a very fast servo loop to detect slip and control the grasping
force to near the minimum needed to prevent slip.
Sonar: is SOund NAvigation and Ranging. Sonar provides useful information about
objects very close to the robot and is often used for fast emergency collision avoidance. It
is sometimes used to map the robot's environment over a larger area.
Sonar works by measuring the time of flight for a sound pulse generated by the sensor to
reach an object and be reflected back. The pulse or "chirp" is typically about 50 kHz. This
is more than twice the upper limit for humans of 20 kHz. Sound at that frequency has a
wavelength of about 7 mm. The speed of sound is about 330 m/second, so the round-trip
time delay for an object 1 m away is about 6 x 10-3 seconds.
Domain areas of robot:
Manufacturing is seen as the traditional domain of the robot.
Material handling is another traditional domain for robots. Material handling is the
storage, transport, and delivery of material, which can range in size from silicon chips to
diesel trucks.
Buildings (especially hospitals, and as security guards): Mobile robots (mobots) are also
becoming widely useful as couriers in buildings. These robots respond to requests from a
computer terminal and carry documents or supplies to a destination somewhere else in the
building. The robot negotiates hallways and elevators, and avoids collision with other
obstacles such as humans and furniture in a high availability (it can work 24 hours a day),
high reliability (supplies are not lost or misplaced).
Hazardous environments: Mobile robots are an important technology for reducing risk
to human life in hazardous environments. Robots can reduce risk to humans in unstable
buildings after earthquakes, near fire or toxic fumes, and in radioactive environments. They
can also be used for routine tasks in dangerous situations including toxic waste cleanup,
deep sea recovery, exploration, mining, and manipulation of biologically hazardous
materials. A human operator is often available to guide the robot, but it also needs
autonomy to recognize and respond to hazards to its own and others' well-being.
Telepresence(reality) and virtual reality (imaginary): As computers spread from
scientific/business applications to a consumer technology, telepresence and virtual reality
continue to captivate the public imagination. The idea of staying in one's home and being

57
Course module

able to sense exotic environments, either real (telepresence) or imaginary (virtual reality)
is indeed compelling, and is a driving force behind some major moves in the computer and
entertainment industries.
Augmentation of human abilities: A precursor to telepresence involves putting a human
inside a large, strong robot.

Summary of Teaching-Learning and Assessments Methods:


To deliver the course, the learning–teaching methodology will be the active learning
(student-centered) method with the active involvement or appropriate guidance of the
instructor as a facilitator during the students’ activities. There will be Interactive Lecture,
Demonstration, Tutorials, Reading assignments, Group Discussions, and Lab Work
delivery methods.
The course will be also assessed using Formative and Summative assessments such as
Quizzes, Reading assignments, Assignments, Projects, Tests, Lab Exam, and Final Exam.
Assessments with their weight distribution:

Formative Assessments
Quiz ......................................................................................................... 5%
Individual assignment ............................................................................... 5%
Group assignment ..................................................................................... 10%
Test ......................................................................................................... 15%
Lab Test and Project................................................................................ 15%

Subtotal .....................................................................................................50%
Summative Assessment

Final examination .........................................................................................50%


Grand total ....................................................................................................100%

Worksheet

1. What is artificial intelligence? And what is intelligence?


2. What about IQ? Do computer programs have IQs?
3. What about other comparisons between human and computer intelligence?
4. Does AI aim to put the human mind into the computer?
5. What is the Turing test?
6. Does AI aim at human-level intelligence?
7. How far is AI from reaching human-level intelligence? When will it happen?
8. Are computers the right kind of machine to be made intelligent?
9. Are computers fast enough to be intelligent?
10. What is the main difference between an intelligent program and an intelligent
agent?

58
Course module

Assignments
A. Concept and principle understanding Assignments
Individual Assignment (5%): Last Submission date: April 30, 2024
1. Describe the problem solving methods in AI. (2%).
2. Describe the term Constraint Satisfaction Search and give two valid examples. (1%)
3. State the term robot and its type in detail. (2%).

Group Assignment (10%): Last Submission date: May 25, 2024


1. State the differences in Hill Climbing and A* search strategies with giving two
examples for each algorithm. (2%).
2. Find out the following about the football player agent. (2.5%).
1. What are the percepts for this agent?
2. Characterize the operating environment.
3. What are the actions the agent can take?
4. How can one evaluate the performance of the agent?
5. What sort of agent architecture do you think is most suitable for this agent?
3. Describe Uncertain Knowledge in detail and when do we use it? (1.5%).
4. Describe the term machine learning in neural network. Under this description, you
are also required to state machine learning and neural network terms separately.
(4%).

B. Lab Demo Assignments


Group Mini Project Assignment (15%): Last Submission and Presentation date: June
10/2024
(5%Documentation, 5% presentation, 5% implementation (coding))

The content covers but not limited:


Preliminary pages: cover page table of contents, list of figures, list of Tables, ...)
1. Introduction
1.1. Problem Identification and description
1.2. Objectives
1.2.1. General Objective:
1.2.2. Specific Objectives:
2. Methodology
2.1. Knowledge acquisition method
2.2. Programming language used for developing the system
2.3 Knowledge structuring
3. Description of the System: analysis
3.1. Knowledge modeling
3.2. Knowledge representation
4. Summary of Implementation and Experimental Results
5. Conclusions and Recommendations

References used

59

You might also like