Professional Documents
Culture Documents
UNIT – V
Introduction Of AI: Definition of AI - AI Problems – Underlying
Assumption – AI technique – Level of the Model - Criteria for Success.
Problems, Problem Spaces, Search: Defining the Problem as State Space
Search - Production Systems - problem Characteristics – Production System
Characteristics
INTRODUCTION OF AI
What is Artificial intelligence (Al)?
• Artificial intelligence (Al) is the study of how to make computers do things which, at
present, people do better.
• Father of Artificial Intelligence, John McCarthy, defines AI as “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 is achieved through the study of, how human brain thinks and how humans learn, decide,
and work while trying to solve a problem, and use the outcomes of this study to develop
intelligent software and systems.
AI can identify patterns in large dataset (big-data) more efficiently than humans, enabling
businesses to gain more insight out of their data. This quick and accurate process helps
businesses to extract invaluable insights from their data.
AI uses a set of very powerful tools, and methodologies for solving business problems.
From a programming perspective, AI includes the study of symbolic programming, problem
solving, and search.
THE Al PROBLEMS
• Earlier stage of AI focused on formal tasks, such as game playing and theorem proving.
Samuel wrote a checkers-playing program which played games with opponents and
used its experience to improve its later performance.
• AI focused on the Chess game also.
• Logic Theorist is a computer program written in 1956 by Allen Newell, Herbert A.
Simon, and Cliff Shaw. It was the first program to perform automated reasoning. It is
"the first artificial intelligence program". It was able to prove several theorems even
from Whitehead and Russell's Principia Mathematica.
• Gelernter's theorem prover explored on geometry, game playing and theorem
proving.
• Al focused on commonsense reasoning - is a human-like ability. It includes reasoning
about physical objects and their relationships to each other.
• Newell. Shaw, and Simon built the General Problem Solver (GPS), a universal
problem solver machine. In contrast to the former Logic Theorist project, the GPS
works with means–ends analysis
• Perception – vision and speech, natural language understanding, and problems
solving in specialized domains such as medical diagnosis and chemical analysis and
are referred as
• Mundane tasks. Perceptual tasks involve analog signals rather than digital signals. The
problem of understanding spoken language is a perceptual problem and is hard to solve.
If the problem is restricted to written language, the problem is referred to as natural
language understanding,
• AI was also used for specialized tasks such as engineering design, scientific discovery,
medical diagnosis, and financial planning.
Figure 1.1 lists some of the tasks that are the targets of work in AL
First, perceptual, linguistic, and commonsense skills are learned. Later expert skills such as
engineering, medicine, or finance are acquired
• Expert Systems Al focused on the domains that require only specialized expertise
without commonsense knowledge, known as expert systems. An expert system is a
computer program that uses artificial intelligence (AI) technologies to simulate the
judgment and behaviour of a human or an organization that has expertise and
experience in a particular field.
• DENDRAL is a chemical-analysis expert system.
• MYCIN is an expert system for treating blood infections.
• CYC is a large experiment in symbolic AI.
The following four questions need to be answered:
1. What are our underlying assumptions about intelligence?
2. What kinds of techniques will be useful for solving Al problems?
3. At what level of detail, if at all, are we trying to model human intelligence?
4. How will we know when we have succeeded in building an intelligent program?
Let's look at two very different problems and a series of approaches for solving each of them.
1. Tic-Tac-Toe
2. Question Answering
i)Tic-Tac-Toe Problem Here, presented a series of three programs to play tic-tac-toe. The
programs in this series increase in:
The clarity of their knowledge
Their complexity
Their use of generalizations
The extensibility of their approach. Thus, they move toward being
representations of what we call AI techniques.
Comments
This program will require much more time because it must search a tree representing all
possible move sequences before making each move.
This program can be extended to handle games more complicated than tic-tac-toe.
It can also be augmented by a variety of specific kinds of knowledge about games and how to
play them.
Then either of the following question-answering dialogues might occur with the POLITICS
program.
Dialogue 1
Q: Why did Russia do this?
A: Because Russia thought that it could take political control of Czechoslovakia by
sending troops.
Q: What should the United States do?
A: The United States should intervene militarily.
Dialogue 2
Q: Why did Russia do this?
A: Because Russia wanted to increase its political influence over Czechoslovakia.
Q: What should the United States do?
A: The United States should denounce the Russian action in the United Nations.
In the POLITICS program, answers were constructed by considering both the input text and a
separate model of the beliefs and actions of various political entities, including Russia.
When the model is changed, the system’s answers also change. To produce a correct answer to
a question may be very hard.
Efforts to build programs that perform tasks the way people do can be divided into two classes.
1. Programs in the first class attempt to solve problems that do not really fit our definition
of an Al task. They are problems that a computer could easily solve, Example of this
class of program is the EPAM - Elementary Perceiver and Memorizer which
memorized associated pairs of nonsense syllables. Memorizing pairs of nonsense
syllables is easy for a computer.
2. The second class of programs that attempt to model human performance. Programs thar
are useful tools for psychologists who want to test theories of human performance.
There are several reasons one might want to model human performance at these sorts
of tasks:
LANGUAGE for AI
LISP was the most commonly used language for Al programming. Among the various LISPs,
Common Lisp is now accepted as a standard. Another language that is often used for AI
programming is PROLOG. Al systems are being written in general purpose programming
languages such as C. One reason for this is that AI programs are ceasing to be standalone
systems; instead, they are becoming components of larger systems, which may include
conventional programs and databases of various forms. Robots form the ultimate test-bed for
AL. While Al researchers have brought forth a reasonably large repository of techniques and
programs that are based on the symbol system, implementing them on robots have posed
several problems.
CHAPTER II
PROBLEMS, PROBLEM SPACES, AND SEARCH
Problem
To build an AI system to solve a particular problem, we need to do four things:
1. Define the problem precisely. This definition must include precise specifications of the
initial situation (s) and the final situations that are acceptable solutions to the problem.
2. Analyze the problem. A few very important features can have a huge impact on the
appropriateness of various possible techniques for solving the problem.
3. Isolate and represent the task knowledge that is necessary to solve the problem.
4. Choose the best problem-solving technique(s) and apply it (them) to the particular
problem.
Formal Description of the problem
DEFINING THE PROBLEM AS A STATE SPACE SEARCH
Problem solving is a method of deriving solution steps beginning from initial description of the
problem to the desired solution. In AI, the problems are frequently modelled as a state space
problem where the state space is a set of all possible states from start state to goal states.
In order to provide a formal description of a problem, we must do the following:
1. Define a state space that contains all the possible configurations of the relevant objects.
2. Specify one or more states within that space that describe the situation from which the
problem-solving process starts. These states are called the initial states.
3. Specify one or more states that would be acceptable as solutions to the problem. These
states are called goal states.
4. Specify a set of rules that describe the actions/operators available.
5. Doing this will require the following issues: the unstated assumptions, generalization
of the rules and how much of the work can be precomputed and represented in the rules
6. The problem can then be solved by using the rules, with a control strategy, to move
through the problem space until a path from an initial state to a goal state is found.
7. Thus, the process of search is fundamental to the problem-solving process.
Playing Chess:
We need to specify the starting position of the chess board, the rules that define the legal
moves, and the board positions that represent a win for one side or the other.
• The starting position can be described as an 8 x 8 array where each position
contains a symbol standing for the appropriate piece in the official chess opening
position.
• We can define as our goal any board position in which the opponent does not have
a legal move and his or her king is under attack.
• The legal moves provide the way of getting from the initial state to a goal state.
• They can be described easily as a set of rules consisting of two parts: a left side
that serves as a pattern to be matched against the current board position and a right
side that describes the change to be made to the board position to reflect the move.
• There are several ways in which these rules can be written.
• No person could ever supply a complete set of such rules.
• No program could easily handle all those rules.
So, the problem of playing chess is defined as a problem of moving around in a state space,
where each state corresponds to a legal position of the board. This state space representation
will be suitable for chess.
The search forms the core of many intelligent processes, it is useful to structure AI programs
in a way that facilities describing the search process. So, production systems provide the
structure for AI programs that makes searching process easy. Production systems provide a
structure to facilitate describing and performing the search process. A definition of a production
system is given below:
A production system consists of:
• A set of rules, each consisting of a left side (a pattern) that determines the applicability
of the rule and a right side that describes the operation to be performed if the rule is
applied.
• One or more knowledge/databases that contain whatever information is appropriate
for the particular task. Some parts of the database may be permanent, while other parts
of it may pertain only to the solution of the current problem. The information in these
databases may be structured in any appropriate way.
• A control strategy that specifies the order in which the rules will be compared to the
database and a way of resolving the conflicts that arise when several rules match at
once.
• A tule applier.
Some of them are:
• Basic production system languages, such as OPS5and ACT*
• More complex hybrid systems called expert system shells, which provide complete
environment for the construction of knowledge- based expert systems.
• General problem-solving architectures like SOAR, a system based on a specific set of
cognitively motivated hypotheses about the nature of problem-solving.
The process of solving the problem can be modelled as a production system.
Advantages of production system
In general, the process of solving a problem can usefully be modeled as a production system.
i.e, any computable procedure can be modelled as production system.
It models strong data-driven nature of intelligent action
New rules can easily be added to take care of new situations without disturbing the
rest of the system
Handling of changes in knowledge base is dynamic
Helps in making inference mechanism easy.
Monotonic Non-Monotonic
Partially Ex: theorem proving Ex: Blocks world, 8-
commutative puzzle
Non-
Ex: chemical Ex: Bridge/cards
partially
Synthesis problem
commutative
• A Monotonic Production System: is one in which the application of a rule never prevents
the later application of another rule that could also have been applied at the time the first rule
was selected.
• A Non-Monotonic Production System: is a production system is one in which the above
statement is not true.
• A partially commutative production system: is a production system with the property that
if the application of a particulars sequence of rules transforms state ‘X’ into state ‘Y’ then any
permutation of those rules that is allowable also transforms state ‘X’ into state ‘Y’. Partially
commutative monotonic production systems are useful for solving ignorable problems and
these can be easily implemented without the ability to backtrack to previous states when it is
discovered that an incorrect path has been followed.
• Non- Partially commutative production system: are useful for many problems in which
irreversible changes occur.
• Non-Monotonic Partially commutative systems: are useful for problems in which changes
occur but can be reversed in which order of operations is not critical.
• Commutative production system is one which is both monotonic and partially
commutative.
Control Strategies
Control strategy describes the order of application of the rules to the current state. A control
strategy is needed to decide which rule to apply next during the process of searching for a
solution to a problem when more than one rule matches the current state. There are many
control Strategies exist uniformed search strategies like DFS, BFS and informed / heuristic
Strategies like Hill climbing, Backtracking, Branch and Bound, Best first search etc.,.
For the water jug problem, most control strategies that cause motion and are systematic will
lead to an answer. The problem is sitnple. But this 1s not always the case. In order to solve
some problems during our lifetime, we must also demand a control structure that is efficient.
A Salesman has a list of cities, each of which he must visit exactly once. There are direct
roads between each pair of cities on the list. Find the route the Salesman should follow for
the shortest possible round trip that both starts and finishes at any one of the cities.
A simple, motion-causing and systematic control structure could, in principle, solve this
problem. It would simply explore all possible paths in the tree and return the one with the
shortest length. This approach will work in practice for very short lists of cities. But it breaks
down quickly as the number of cities grows. If there are N cities, then the number of
different paths among them is 1.2… (N-1), or (N-1)! . The time to examine a single path is
proportional to N. So the total time required to perform this search is proportional to N! .
Assuming there are only 10 cities, 10! is 3,628,800, which is a very large number. The
salesman could easily have 25 cities to visit. To solve this problem would take more time
than he would be willing to spend. This phenomenon is called combinatorial explosion. To
combat it, we need a new control strategy.
Heuristic Search
✓
A Heuristic function is a function that maps from problem state description to
measures of desirability, usually represented as numbers.
✓
Improves the efficiency of a search process and always finds a very goal solution for
hard problems.
✓
In general, it points in interesting directions.
✓
Like tour guides, helps to guide a search process. Ex: nearest Neighbor Heuristic
✓
Well designed Heuristic functions can play an important part in efficiently guiding a
search process toward a solution.
✓
Sometimes very simple Heuristic functions can provide a fairly good estimate of
whether a path is good or not. In other situations, more complex Heuristic functions should
be employed.
Note:
AI PROBLEM CHARACTERISTICS
In order to choose the most appropriate method for a particular problem, it is necessary to
analyze the problem along several key dimensions / Characteristics:
1 Is the problem Decomposable into a set of independent smaller and/or easier sub
problem? (D)
2 Can solution steps be Ignored or at least undone if they prove unwise? (I)
3 Is the problem’s universe Predictable? [predictability (P)]
4 Is a good solution to the problem obvious without comparison to all other possible
solutions? [Comparability ( C )]
5 Is the desired solution a state of the world OR a path to a state? (R)
6 Is a large amount of knowledge absolutely required to solve the problem, OR is
knowledge important only to constrain the search? [knowledge based consistency (C
)]
7 Can a computer that is simply given the problem return the solution, or will the solution
of the problem require interaction between the computer and a person? [ Interactions
(I) ]
Example:
• Ignorable (e.g.., theorem proving), in which solution steps can be ignored
These three definitions make reference to the steps of the solution to a problem and thus
may appear to characterize particular production system for solving a problem. This is
true for each of the problem used as examples above. When this is the case, it makes
sense to view the recoverability of a problem as equivalent to recoverability of a natural
formulation of it.
The planning process can only be done effectively for certain-outcome. A few examples
of such problems are:
Playing bridge: we can do fairly well since we have available accurate estimates of the
probabilities of each of the possible outcomes.
Controlling a robot arm: The outcome is uncertain for a variety of reasons. Someone
might move something into the path of the arm. The gears of the arm might stick. A slight
error could cause the arm to knock over a whole stack of things.
Helping a lawyer decide how to defend his client against a murder charge: Here we
probably cannot even list all the possible outcomes, much less assess their probabilities.
Examples:
In 8-puzzle problem certain outcome
In bridge problem uncertain outcome (cards)
In controlling a Robot arm uncertain outcome
In helping a lawyer decides how to depend his client against a murder charge. (cannot
list all possible outcomes)
8. Problem Classification
There are several broad classes into which the problems may fall.
Example: In Diagnostic tasks, i.e. both in medical and fault diagnosis, we need to
examine the input and decide which of a set of known classes, the input is an instance
of?
Every search process can be viewed as a traversal of a tree structure in which each node
represents a problem state and each arc represents a relationship between the states represented
by the nodes it connects. For example, Figure below shows part of a search tree for a water
jug problem. The search process must find a path or paths through the tree that connect an
initial state with one or more final states. The tree that must be searched could in principle,
be constructed in it’s entirely from the rules that define allowable moves in the problem space.
The direction in which to conduct the search (forward versus backward reasoning).
How to select applicable rules (matching). Production systems typically spend most of their
time looking for rules to apply, so it is critical to have efficient procedures for matching rules
against states.
How to represent each node of the search process. For problems like chess, a node can be
fully represented by a simple array. In more complex problem solving, however, it is
inefficient and/or impossible to represent all of the facts in the world and to determine all of
the side effects an action may have.
A Search Tree for the Water Jug Problem
For example, in the tree shown above, the node (4, 3), can be generated either by first filling
the 4-gallon jug and then the 3-gallon one. This example also illustrates another problem that
often arises when the search process operates as a tree walk. On the third level, the node (0,
0) appears. But this is the same as the top node of the tree, which has already been expanded.
Those two paths have not gotten us anywhere, so we would like to eliminate them and
continue only along the other branches. The waste of effort that arises when the same node is
generated more than once can be avoided at the price of additional bookkeeping. Instead of
traversing a search tree, we traverse a directed graph. This graph differs from a tree in that
several paths may come together at a node. The graph corresponding to the tree is shown in
figure below. Any tree search procedure that keeps track of all the nodes that have been
generated so far can be converted to a graph search procedure by modifying the action
performed each time a node is generated. Graph search procedures are useful for dealing
with partially commutative production systems.
ADDITIONAL AI PROBLEMS