Unit 1
Unit 1
OR
Definitions
1. John McCarthy, who coined the term Artificial Intelligence in 1956, defines it as "the science
and engineering of making intelligent machines", especially intelligent computer programs.
2. AI is the study of : How to make computers do things which, at the moment, people
do better.
3. AI is the study concerned with building machines that simulate human behavior.
Characteristics
1. System that learn new concept or tasks.
2. System that reason and draw useful conclusions,
3. System that can understand natural language.
4. System that perceive visual scene.
5. System that perform other types of points that require human type of intelligence.
Conventional Systems
AI Systems
Nimish Kumar
AI Languages
1. LISP (List Processing)
2. PROLOG (Programming in Logic)
3. C/ C++/ Java
Application Areas of AI
AI Techniques
Nimish Kumar
LISP program and selecting fittest in million of generations)
j) Epistemology (This is the kind of knowledge that is required for solving problems in the
real world means different kind of logics)
Fields of AI
1. Expert System
2. Natural Language Processing (NLP)
3. Speech and Voice Understanding
4. Robotics and sensory system
5. Computer Vision (Interpretate scenarios)
6. Neural Computing
7. Automatic Programming (Create special programs that act as intelligent)
8. Genetic Algorithm
9. Fuzzy Logic
1 cabca 2 2
2 acbca 2, 3 2
3 acbac 1, 3 1
4 acabc 2 2
5 aacbc 3 3
Problem Definition
1. Initial State: From where the program starts
2. Operator or Successor Function: A description of the possible actions available to
solve the problem.
<action, successor>
Here successor is the state that can be reached from current state by applying the action
(operator).
Nimish Kumar
3. State Space: All state space reachable from initial state by any sequence of actions.
4. Path: Sequence through state space.
5. Path cost function: Assigns numeric cost to each path. Path cost is measured by means
of step cost that is cost of taking an action A to go from state C to state Y and is denoted
as C ( C, A, Y)
6. Goal test: Determines whether a given state is a goal state or not.
Production System
Production systems are applied to problem solving programs that perform a wide range of
searches.
Composed of 5 parts:
1. A set of production Rule: Production rules are conditional if-then branches (condition
action pair)
WHEN (condition) IS SATISFIED Perform
2. Working Memory: It contains the description of the current state. Here the given pattern
is matched against the condition part of a production to select appropriate problem
solving action.
3. Global database: It is the systems short term memory. These are the collections of the
facts that are to be analyzed. Working memory is also the part of global database.
4. Control Strategy: The order in which the rules are to be compared to the database and
resolves conflicts that arises when several rules match at once.
5. Rule Applier: It applies the rule after the satisfaction of the condition in rule and update
the working memory.
Fig. A production system: Controls loops until working memory pattern no longer matches the
conditions of any production.
Process terminates when the contents of working memory do not match any rule condition. This
process is known as recognize act cycle. The pure production system model has no mechanism
for recovering from dead ends, the only solution is backtracking.
Nimish Kumar
Production System Type Monotonic Non Monotonic
Partially Commutative Theorem Proving (Ignorable Robot Navigation (Order of
Problems) Operation is not critical)
Non Partially Commutative Chemical Synthesis Bridge (Many Search State)
(Irreversible Changes Occurr)
State Space: A set of all possible states for a given problem is known as state space of the
problem.
Problems
Solution:
State Space (x, y) where x = 0, 1, 2, 3 and 4
and y = 0, 1, 2 and 3
Here x represents the no of gallon of water in 4 gallon Jug and
y represents the no of gallon of water in 3 gallon Jug
Production Rules
1. (x, y) (4, y) Fill the 4 gallon Jug
if x < 4
Nimish Kumar
4. (x, y) (x, y-d) pour some water out of 3 gallon Jug
if y > 0
7. (x, y) (4, y-(4-x)) Pour water from the 3 gallon Jug into the 4
if x+y >= 4 & y > 0 gallon Jug until the 4 gallon Jug is full
8. (x, y) (x – (3-y), 3) Pour water from the 4 gallon Jug into the 3
if x+y >= 3 & x > 0 gallon Jug until the 3 gallon Jug is full
9. (x, y) (x+y, 0) Pour all water from the 3 gallon Jug into the
if x+y < =4 & y > 0 4 gallon Jug
10. (x, y) (0, x+y) Pour all water from the 4 gallon Jug into the
if x+y <= 3 & x > 0 3 gallon Jug
Control Strategy
Husband Wife Problem or Missionary and Cannibal Problem or Tiger, Goat and Grass
Problem
Three couple wants to cross a river but the condition imposed is that either Husband and Wife
should travel together or two Husband or two Wife can travel together in a boat or a single
Husband and a single Wife can travel alone. There should be no mismatch among them. There is
a condition that the number of Wife’s should never be less than husbands as they don’t trust each
other.
Solution:
State Space
Let H1 Husband1
Nimish Kumar
H2 Husband2
H3 Husband3
W1 Wife1
W2 Wife2
W3 Wife3
Bank1 Bank2
Initial State: H1W1 H2W2 H3W3 --------
Final State: -------- H1W1 H2W2 H3W3
Production Rules
1. Transfer < Hi, Wi >
2. Transfer < Hi, Hj >
3. Transfer < Wi, Wj >
4. Transfer < Hi, - >
5. Transfer < Wi, - >
Where i, j <= 3
Control Strategy
W1H2 W2H3 W3 H1 5
W1W2W3 H1H2H3 2
H1H2H3 W1W2W3 2
H1 W1 H2W2 H3W3 2
Nimish Kumar
-------- H1W1 H2W2 H3W3 1
8 Puzzel Problem
2 8 3 1 2 3
1 6 4 8 4
7 5 7 6 5
Nimish Kumar
1. Expert System
What is Expert System?
• An expert system is an interactive computer-based decision tool that uses both facts and
heuristics to solve difficult decision making problems, based on knowledge acquired from an
expert.
• An expert system is a model and associated procedure that exhibits, within a specific domain, a
degree of expertise in problem solving that is comparable to that of a human expert.
• First expert system, called DENDRAL, was developed in the early 70’s at Stanford University.
Expert systems have a number of major system components and interface with individuals who
interact with the system in various roles. These are illustrated below.
Nimish Kumar
Components and Interfaces
Inference engine: The code at the core of the system which derives recommendations from the
knowledge base and problem- specific data in working storage;
User interface: The code that controls the dialog between the user and the system.
Domain expert: The individuals who currently are experts in solving the problems; here the
system is intended to solve.
Knowledge engineer: The individual who encodes the expert’s knowledge in a declarative
form that can be used by the expert system.
User: The individual who will be consulting with the system to get advice which would have
been provided by the expert.
Many expert systems are built with products called expert system shells. A shell is a piece of
software which contains the user interface, a format for declarative knowledge in the knowledge
base, and an inference engine. The knowledge and system engineers uses these shells in making
expert systems.
Knowledge engineer: uses the shell to build a system for a particular problem domain.
System engineer: builds the user interface, designs the declarative format of the knowledge base,
and implements the inference engine.
Expert system operates as an interactive system that responds to questions, asks for clarifications,
makes recommendations and generally aids the decision-making process.
Nimish Kumar
Operates as an interactive system
Responds to questions
Makes recommendations
Knowledge base must have means of exploiting the knowledge stored, else it is useless;
e.g., learning all the words in a language, without knowing how to combine those words to
form a meaningful sentence.
Remembers logical chain of reasoning; therefore user may ask for explanation of a
recommendation factors considered in recommendation
Domain-Specific
A particular system caters a narrow area of specialization; e.g., a medical expert system
cannot be used to find faults in an electrical circuit.
Can address imprecise and incomplete data through assignment of confidence values
Nimish Kumar
Applications
Best suited for those dealing with expert heuristics for solving problems
Not a suitable choice for those problems that can be solved using purely numerical
techniques.
Specialists in many areas are rare and the cost of consulting them is high; an expert
system of those areas can be useful and cost-effective alternative in the long run.
The knowledge is structured in rules which describe how each of the possibilities might be
selected. The rule breaks the problem into sub-problems.
Example:
KB contains Rule set:
Rule 1: If A AND C Then F
Rule 2: If A AND E Then G
Rule 3: If B Then E
Rule 4: If G Then D
Problem: prove
If A and B true Then D is true
Nimish Kumar
Expert systems must be able to deal with uncertainty.
One simple way is to associate a numeric value with each piece of information in the
system.
The numeric value represents the certainty with which the information is known.
There are different ways in which these numbers can be defined, and how they are
combined during the inference process.
The knowledge is structured in rules which describe how each of the possibilities might be
selected. The rule breaks the problem into sub-problems.
Example:
KB contains Rule set:
Rule 1: If A AND C Then F
Rule 2: If A AND E Then G
Rule 3: If B Then E
Rule 4: If G Then D
Problem: prove
If A and B true Then D is true
Data Representation
The way in which the problem specific data in the system is stored and accessed
Expert system is built around a knowledge base module.
Knowledge acquisition is transferring knowledge from human expert to computer.
Knowledge representation is faithful representation of what the expert knows.
No single knowledge representation system is optimal for all applications. The success of
expert system depends on choosing knowledge encoding scheme best for the kind of
knowledge the system is based on.
The IF-THEN rules, Semantic networks and Frames are the most commonly used
representation schemes.
User Interface
That portion of the code which creates an easy to use system. The acceptability of
an expert system depends largely on the quality of the user interface.
Scrolling dialog interface: It is easiest to implement and communicate with the
Nimish Kumar
user.
Pop-up menus, windows, mice are more advanced interfaces and powerful tools
for communicating with the user; they require graphics support.
Explanations
An important feature of expert systems is their ability to explain themselves. Given that
the system knows which rules were used during the inference process, the system can
provide those rules to the user as means for explaining the results. By looking at
explanations, the knowledge engineer can see how the system is behaving, and how the
rules and data are interacting. This is very valuable diagnostic tool during development.
2. Knowledge Acquisition
Knowledge acquisition includes the elicitation, collection, analysis, modeling and validation of
knowledge.
Nimish Kumar
Involve the construction and filling-in a 2-D matrix (grid, table), indicating such things, as
may be, for example, between concepts and properties (attributes and values) or between
problems and solutions or between tasks and resources, etc. The elements within the
matrix can contain: symbols (ticks, crosses, and question marks), colors, numbers, and
text.
v) Sorting techniques
Used for capturing the way people compare and order concepts; it may reveal knowledge
about classes, properties and priorities.
Expert system is built around a knowledge base module. Expert system contains a formal
representation of the information provided by the domain expert. This information may
be in the form of problem-solving rules, procedures, or data intrinsic to the domain. To
incorporate this information into the system, it is necessary to make use of one or more
knowledge representation methods. Some of these methods are:
Transferring knowledge from the human expert to a computer is often the most difficult
part of building an expert system.
The knowledge acquired from the human expert must be encoded in such a way that it
remains a faithful representation of what the expert knows, and it can be manipulated by a
computer.
Three common methods of knowledge representation evolved over the years are IF-THEN
rules ,Semantic networks and Frames.
Rules "if-then" are predominant form of encoding knowledge in expert systems. These
are of the form:
Nimish Kumar
if a1 , a2 , . . . . . , an
then b1 , b2 , . . . . . , bn where
each ai is a condition or situation, and
each bi is an action or a conclusion.
The objects are denoted as nodes of a graph. The relationships between two objects are
denoted as a link between the corresponding two nodes.
The most common form of semantic networks uses the links between nodes to represent
IS-A and HAS relationships between objects.
The Fig. below shows a car IS-A vehicle; a vehicle HAS wheels.
This kind of relationship establishes inheritance hierarchies in the network, with the
objects lower down in the network inheriting properties from the objects higher up.
Nimish Kumar
3.3 Frames
In this technique, knowledge is decomposed into highly modular pieces called frames,
which are generalized record structures.
Knowledge consists of concepts, situations, attributes of concepts, relationships between
concepts, and procedures to handle relationships as well as attribute values.
Value Vehicle
Value Vehicle
Value 1
Value
Value 4
Value
Value
Value 1
Value
Value
Nimish Kumar
Frame Car
Value Car
Value Honda
Value
Value
Value 1989
Value
Value
Attribute Slot
Value
Value
Value
4. Working Memory
Working memory refers to task-specific data for a problem. The contents of the working
memory, changes with each problem situation. Consequently, it is the most dynamic
component of an expert system, assuming that it is kept current.
Every problem in a domain has some unique data associated with it.
Data may consist of the set of conditions leading to the problem, its parameters and so on.
Data specific to the problem needs to be input by the user at the time of using, means
consulting the expert system. The Working memory is related to user interface.
Fig. shows how Working memory is closely related to user interface of the expert system.
Nimish Kumar
5. Inference Engine
The inference engine is a generic control mechanism for navigating through and manipulating
knowledge and deduce results in an organized manner. The inference engine's generic
control mechanism applies the axiomatic (self-evident) knowledge present in the knowledge
base to the task-specific data to arrive at some conclusion.
Inference engine the other key component of all expert systems.
Just a knowledge base alone is not of much use if there are no facilities for navigating
through and manipulating the knowledge to deduce something from knowledge base.
A knowledge base is usually very large, it is necessary to have inferencing mechanisms
that search through the database and deduce results in an organized manner.
The forward chaining, backward chaining and Tree searches are some of the techniques used for
drawing inferences from the knowledge base.
5.1 Forward Chaining Algorithm
Forward chaining is a technique for drawing inferences from Rule base. Forward-chaining
inference is often called data driven.
The algorithm proceeds from a given situation to a desired goal, adding new assertions
(facts) found.
A forward-chaining, system compares data in the working memory against the conditions
in the IF parts of the rules and determines which rule to fire.
Data Driven
First iteration:
ii) Rule 3 fires: conclusion E is true
*new knowledge found
iii) No other rule fires;
*end of first iteration.
Nimish Kumar
iv) Goal not found;
*new knowledge found at (ii);
*go for second iteration
Second iteration:
(v) Rule 2 fires: conclusion G is true
*new knowledge found
(vi) Rule 4 fires: conclusion D is true
*Goal found;
*Proved
First iteration:
(ii) Rule 4 fires :
*new sub goal to prove G is true
*go backward
(iii) Rule 2 "fires''; conclusion: A is true
*new sub goal to prove E is true
*go backward;
(iv) No other rule fires; end of first iteration.
*new sub goal found at (iii);
*go for second iteration
Second iteration:
(v) Rule 3 fires:
Nimish Kumar
*conclusion B is true (2nd input found)
*both inputs A and B ascertained
*Proved
Knowledge Base
A store of factual and heuristic knowledge. Expert system tool provides one or more
knowledge representation schemes for expressing knowledge about the application
domain. Some tools use both Frames (objects) and rules. In the IF-THEN PROLOG
Nimish Kumar
knowledge is represented as logical statements.
Reasoning Engine
Inference mechanisms for manipulating the symbolic information and knowledge in the
knowledge base form a line of reasoning in solving a problem. The inference mechanism
can range from simple modus ponens backward chaining of IF-THEN rules to Case-Based
reasoning.
Knowledge Acquisition subsystem
A subsystem to help experts in build knowledge bases. However, collecting knowledge,
needed to solve problems and build the knowledge base, is the biggest bottleneck in
building expert systems.
Explanation subsystem
A subsystem that explains the system's actions. The explanation can range from how the
final or intermediate solutions were arrived at justifying the need for additional data.
User Interface
A means of communication with the user. The user interface is generally not a part of the
expert system technology. It was not given m uch attention in the past. However, the user
interface can make a critical difference in the perceived utility of an Expert system.
7. Explanation
Most expert systems have explanation facilities that allow the user to ask questions - why and
how it reached some conclusion .
The questions are answered by referring to the system goals, the rules being used, and existing
problem solving. The rules typically reflect empirical, or "compiled" knowledge. They are
codes of an expert's rules of thumb, not the expert's deeper understanding.
Example :
Dialog with an expert system designed to give advice on car problems.
System Does the car start ?
User No.
Note: The rule gives the correct advice for a flooded car, and knows the questions to be
ask to determine if the car is flooded, but it does not contain the knowledge of what a
flooded car is and why waiting will help.
Types of Explanation
There are four types of explanations commonly used in expert systems.
Nimish Kumar
Rule trace reports on the progress of a consultation;
Explanation of how the system reached to the given conclusion;
Explanation of why the system did not give any conclusion.
Explanation of why the system is asking a question;
The Expert systems have found their way into most areas of knowledge work. The applications of
expert systems technology have widely proliferated to industrial and commercial problems, and
even helping to plan NASA the maintenance of a space shuttle for its next flight.
Diagnosis and Troubleshooting of Devices and Systems
Medical diagnosis was one of the first knowledge areas to which Expert system
technology was applied in 1976. However, the diagnosis of engineering systems quickly
surpassed medical diagnosis.
Planning and Scheduling
The Expert system's commercial potential in planning and scheduling has been recognized
as very large. Examples are airlines scheduling their flights, personnel, and gates; the
manufacturing process planning and job scheduling.
Configuration of Manufactured Objects from sub-assemblies
Configuration problems are synthesized from a given set of elements related by a set of
constraints. The Expert systems have been very useful to find solutions. For example,
modular home building and manufacturing involving complex engineering design.
Financial Decision Making
The financial services are the vigorous user of expert system techniques. Advisory
programs have been created to assist bankers in determining whether to make loans to
businesses and individuals. Insurance companies to assess the risk presented by the
customer and to determine a price for the insurance. ES are used in typical applications in
the financial markets / foreign exchange trading.
Knowledge Publishing
This is relatively new, but also potentially explosive area. Here the primary function of the
Expert system is to deliver knowledge that is relevant to the user's problem. The two most
widely known Expert systems are : one, an advisor on appropriate grammatical usage in
a text; and the other, is a tax advisor on tax strategy, tactics, and individual tax policy.
Process Monitoring and Control
Here Expert system does analysis of real-time data from physical devices, looking for
anomalies, predicting trends, controlling optimality and failure correction. Examples of
real-time systems that actively monitor processes are found in the steel making and oil
refining industries.
Design and Manufacturing
Here the Expert systems assist in the design of physical devices and processes, ranging
from high-level conceptual design of abstract entities all the way to factory floor
configuration of manufacturing processes.
Nimish Kumar