All in One PDF
All in One PDF
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Problems, Problem Spaces and
Search
By
Prof. Mukesh Barapatre
•Historical attempts
•The modern quest for robots and intelligent agents
•Us vs. Them
http://www.theturkbook.com
In 1921, the Czech author Karel Capek produced the play R.U.R.
(Rossum's Universal Robots).
"CHEAP LABOR. ROSSUM'S ROBOTS."
"ROBOTS FOR THE TROPICS. 150 DOLLARS EACH."
"EVERYONE SHOULD BUY HIS OWN ROBOT."
"DO YOU WANT TO CHEAPEN YOUR OUTPUT?
SomeORDER ROSSUM'S
references state that ROBOTS"
term "robot" was derived from the Czech word
robota, meaning "work", while others propose that robota actually means "forced
workers" or "slaves." This latter view would certainly fit the point that Capek was
trying to make, because his robots eventually rebelled against their creators, ran
amok, and tried to wipe out the human race. However, as is usually the case
with words, the truth of the matter is a little more convoluted. In the days when
Czechoslovakia was a feudal society, "robota" referred to the two or three days
of the week that peasants were obliged to leave their own fields to work without
remuneration on the lands of noblemen. For a long time after the feudal system
had passed away, robota continued to be used to describe work that one wasn't
exactly
Department doing voluntarily
of Information Technology or By
forMukesh
fun, while today's younger Czechs and Slovaks
Barapatre 14
tend to use robota to refer to work that’s boring or uninteresting.
http://www.maxmon.com/1921ad.htm
The Roots of Modern Technology
chocolate
nuts
mint
50 60 70 80 90 00 10
1950 Turing predicted that in about fifty years "an average interrogator will not
have more than a 70 percent chance of making the right identification after five
minutes of questioning".
1957 Newell and Simon predicted that "Within ten years a computer will be the
world's chess champion, unless the rules bar it from competition."
http://www.alicebot.org/
John saw a boy and a girl with a red wagon with one blue and one white wheel
dragging on the ground under a tree with huge branches.
The number of parses for an expression with n terms is the n’th Catalan number:
2n 2n
Cat ( n) = −
n n − 1
Department of Information Technology By Mukesh Barapatre 35
Can We Get Around the Search Problem ?
Department of Information
From Hans Technology
Moravec, Robot By Mukesh
Mere Machine BarapatreMind 1998.
to Transcendent 37
How Much Compute Power is There?
•Wings or not?
•Games, mathematics, and other knowledge-poor tasks
•The silver bullet?
•Knowledge-based systems
•Hand-coded knowledge vs. machine learning
•Low-level (sensory and motor) processing and the resurgence
of subsymbolic systems
•Robotics
•Natural language processing
•Programming languages
•Cognitive modeling
Department of Information Technology By Mukesh Barapatre 39
Symbolic vs. Subsymbolic AI
1943 McCulloch and Pitts A Logical Calculus of the Ideas Immanent in Nervous
Activity
40 50 60 70 80 90 00 10
•Games
•Theorem proving
•Chess
•Checkers:
•1952-1962 Art Samuel built the first checkers program
•Chinook became the world checkers champion in 1994
•Othello:
•Logistello beat the world champion in 1997
•Chess
•Checkers: Chinook became the world checkers champion in
1994
•Othello: Logistello beat the world champion in 1997
•Go:
1967 Macsyma
Gradually theorem proving has become well enough understood that it is usually no
longer considered AI
Start Goal
1961
Joe went to a restaurant. Joe ordered a hamburger. When the hamburger came, it
was burnt to a crisp. Joe stormed out without paying.
One example domain, medicine, has expert systems whose tasks include:
•arrhythmia recognition from electrocardiograms
•coronary heart disease risk group detection
•monitoring the prescription of restricted use antibiotics
•early melanoma diagnosis
•gene expression data analysis of human lymphoma
•breast cancer diagnosis
eXpertise2Go: http://www.expertise2go.com/
AcquiredIntelligence: http://www.aiinc.ca/demos/
(whales, graduate school)
•Common sense
•Moving Around
•Language
•Common sense
•CYC
•UT (http://www.cs.utexas.edu/users/mfkb/RKF/tree/ )
•WordNet (http://www.cogsci.princeton.edu/~wn/)
•Moving around
•Language
http://www.ai.mit.edu/people/brooks/papers/fast-cheap.pdf
Department of Information Technology By Mukesh Barapatre 64
http://www.ai.mit.edu/projects/ants/
Robotics - Dante
Using its tether cable anchored at the crater rim, Dante II is able to descend down sheer
crater walls in a rappelling-like manner to gather and analyze high temperature gasses
from the crater floor.
Department of Information Technology By Mukesh Barapatre 65
Robotics - Sojourner
Oct. 30, 1999 Sojourner on Mars. Powered by a 1.9 square foot solar array,
Sojourner can negotiate obstacles tilted at a 45 degree angle. It travels at less than
half an inch per second.
Department of Information Technology By Mukesh Barapatre
http://antwrp.gsfc.nasa.gov/apod/ap991030.html 66
Robotics – Mars Rover
Tutorial on Rover:
http://marsrovers.jpl.nasa.gov/gallery/video/animation.html
Department of Information Technology By Mukesh Barapatre 67
Sandstorm
March 13, 2004 - A DARPA Grand Challenge: an unmanned offroad race, 142 miles
from Barstow to Las Vegas.
Department of Information Technology By Mukesh Barapatre 68
Moving Around and Picking Things Up
http://www.eecs.mit.edu/100th/images/Brooks-Cog-Kismet.html
Department of Information Technology By Mukesh Barapatre 72
At the Other End of the Spectrum - Roomba
The distance from New York to Los Angeles is 3000 miles. If the
average speed of a jet plane is 600 miles per hour, find the time it
takes to travel from New York to Los Angeles by jet.
1965 ELIZA models a Rogerian therapist
young woman: Men are all alike.
eliza: In what way?
young woman: They're always bugging us about something
specific or other.
eliza: Can you think of a specific example?
young woman: Well, my boyfriend made me come here.
Department of Information Technology By Mukesh Barapatre 74
eliza: Your boyfriend made you come here?
NLP, continued
1966 Alpac report kills work on MT
1971 SHRDLU
But suppose we want generality? One approach is “shallow” systems that punt the
complexities of meaning.
•Chatbots
•See the list at: http://www.aaai.org/AITopics/html/natlang.html#chat/
•Speech systems
Olive oil
Olive oil
Peanut oil
Coconut oil
Baby oil
Cooking oil
•Newsblaster: http://www1.cs.columbia.edu/nlp/newsblaster/
ancestor(A,B) :- parent(A,B)
ancestor(A,B) :- parent(A,P), ancestor(P,B)
Emotions
Understanding
Consciousness
sad surprise
http://www.ai.mit.edu/projects/humanoid-robotics-group/kismet/
Department of Information Technology By Mukesh Barapatre 91
Understanding
"AI can have two purposes. One is to use the power of computers to
augment human thinking, just as we use motors to augment human or
horse power. Robotics and expert systems are major branches of that.
The other is to use a computer's artificial intelligence to understand
how humans think. In a humanoid way. If you test your programs not
merely by what they can accomplish, but how they accomplish it, they
you're really doing cognitive science; you're using AI to understand the
human mind."
- Herb Simon
• State Space - set of all states reachable from the initial state.
• The set of all possible configuration is the space of the problem states.
Comments:
3. Hard to generalize.
8 3 4
1 5 9
6 7 2
15 − (8 + 5)
Department of Information Technology
106 By Mukesh Barapatre
Introductory Problem: Tic-Tac-Toe
Comments:
Program 3:
2. Otherwise, consider all the moves the opponent could make next.
Assume the opponent will make The move that is worst for us. Assign
the rating of that move to the current node.
3. The best node is then the one with the highest rating.
Comments:
❖ Isolate and represent the task knowledge that is necessary to solve the
problem.
• The state space representation forms the basis of most of the AI methods.
• Its structure corresponds to the structure of problem solving in two
important ways:
– It allows for a formal definition of a problem as the need to convert
some given situation into some desired situation using a set of
permissible operations.
– It permits us to define the process of solving a particular problem as a
combination of known techniques (each represented as a rule defining a
single step in the space) and search, the general technique of exploring
the space to try to find some path from current state to a goal state.
– Search is a very important process in the solution of hard problems for
which no more direct techniques are available.
• To build a program that could “play chess”, we could first have 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.
• In addition, we must make explicit the previously implicit goal of not only
playing the legal game of chess but also winning the game, if possible,
• The starting position can be described as an 8by 8 array where each position
contains a symbol for appropriate piece.
• We can define as our goal the check mate position.
• The legal moves provide the way of getting from 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 reflect the move
• However, this approach leads to large number of rules 10120 board positions !!
• Using so many rules poses problems such as:
– No person could ever supply a complete set of such rules.
– No program could easily handle all those rules. Just storing so many rules
poses serious difficulties.
Department of Information Technology By Mukesh Barapatre 113
Defining chess problem as State Space search
• We need to write the rules describing the legal moves in as general a way
as possible.
• For example:
– White pawn at Square( file e, rank 2) AND Square( File e, rank 3) is
empty AND Square (file e, rank 4) is empty, then move the pawn from
Square( file e, rank 2) to Square( file e, rank 4).
• In general, the more succinctly we can describe the rules we need, the less
work we will have to do to provide them and more efficient the program.
• The state space for this problem can be described as the set of ordered pairs
of integers (x,y) such that
x = 0, 1,2, 3 or 4 and
y = 0,1,2 or 3;
4 (x,y) if y > 0 (x, y-d) Pour some water out of the 3-gallon
jug
7 (x,y) if x+y >= 4 and y >0 (4, y-(4-x)) Pour water from the 3 –gallon jug
into the 4 –gallon jug until the 4-
gallon jug is full
9 (x, y) if x+y <=4 and y>0 (x+y, 0) Pour all the water from the 3-gallon jug
into the 4-gallon jug
10 (x, y) if x+y <= 3 and x>0 (0, x+y) Pour all the water from the 4-gallon jug
into the 3-gallon jug
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 possible
situations from which the problem solving process may start ( initial
state)
• A set of rules, each consisting of a left side that determines the applicability of
the rule and a right side that describes the operation to be performed if that rule is
applied.
• 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 rule applier
• We must first reduce it to one for which a precise statement can be given.
This can be done by defining the problem’s state space ( start and goal
states) and a set of operators for moving that space.
• The problem can then be solved by searching for a path through the space
from an initial state to a goal state.
• How to decide which rule to apply next during the process of searching for
a solution to a problem?
(0,0)
(4,0) (0,3)
• In this search, we pursue a single branch of the tree until it yields a solution
or until a decision to terminate the path is made.
• DFS requires less memory since only the nodes on the current path are
stored.
• By chance, DFS may find a solution without examining much of the search
space at all.
• Simply explore all possible paths in the tree and return the shortest path.
• If there are N cities, then number of different paths among them is 1.2….(N-1)
or (N-1)!
Monotonic NonMonotonic
By
Prof. Mukesh Barapatre
• Breadth-first search
Expand all the nodes of
one level first.
• Depth-first search
Expand one of the nodes at
the deepest level.
BFS
• Root node is expanded first.
• Then all the successors of the root are expanded next.
• And then their successors and so on.
Search Strategies
(0, 0)
(4, 0) (0, 3)
Algorithm BFS:
1. Create a variable called NODE-LIST and set it to the initial state.
2. Until a goal state is found or NODE-LIST is empty do:
Remove the first element from NODE-LIST and call it E. If
NODE-LIST was empty, quit.
For each way that each rule can match the state described in E do:
Apply the rule to generate a new state.
If the new state is a goal state, quit and return this state.
Otherwise, add the new state to the end of NODE-LIST.
Depth-first search
Algorithm DFS:
1. If the initial state is a goal state, quit and return success.
2. Otherwise, do the following until success or failure is signaled:
Generate a successor, E, of the initial state. If there are no more
successors, signal failure.
Call Depth-First Search with E as the initial state.
If success is returned, signal success. Otherwise continue in this
loop.
Continue this process until some rule
produces a goal state.
Advantage BFS
Complete? Yes No
2. Test to see if this Actually a Solution by compairing the chosen point or the endpoint
of the chosen path to the set of acceptable goal states.
6 3
Informed Search Techniques/ Heuristic
Search
It exploit domain specific knowledge.
• Generate And Test
• Hill Climbing
– Simple hill climbing
– Steepest Ascent hill climbing
• Best First Search
– OR Graph
– A* Algorithm
• Problem Reduction
– AND OR Graph
– AO* Algorithm
• Constraint satisfaction
Generate And Test
1. It is Depth first Search procedure since complete solution must be generated
before they can be generated
2. Exhaustive Search
Similar to generate-and-test
Feedback from the test procedure is used to help
the generator, decides which direction to move
in the search space.
In pure generate & test procedure the test
function responds only Yes or No.
It is augmented with heuristic functionshow
close a given state is to goal state.
Simple Hill Climbing
1. Evaluate the initial state. If it is a goal state ,return & Quit else continue
with initial state as the current state.
2. Loop until a solution is found or until there are no operators left to be applied
in the current state.
a) Select an operator that has not yet been applied to the
current state and apply it to produce a new state
b) Evaluate a New State
i) If it is a goal state then return it & quit
ii) If it is not a goal state, but it is better than the
current state then make it the current state.
iii) If it is not better than the current state,…then continue in the loop.
EXA. Water jug problem by path
Simple Hill Climbing
• At each point in the search path, a successor node that appears to lead most
quick to the goal is selected for exploration.
• Hill climbing is like Depth first Search where the most promising child is
selected for expansion to get goal state.
(or near to goal state.)
Steepest-Ascent Hill Climbing
A A A
B C D
B C D
(3) (5)
(5)
E F G H E F
(4) (6) (6) (5)
(4) (6)
Step-5
B C D
(5)
G H E F
(6) (5)
(4) (6)
I J
(2) (1)
Lists Required?
• OPEN:-Nodes that have been generated and have had the heuristic function
applied to them but which have not been examined.
(Visited, but not expanded)
• CLOSED:-nodes that have already been examined.
(Visited, expanded)
Algorithm :-Best First Search
1.Start with OPEN containing just the initial state.
2.Until a goal is found or there are no nodes left on OPEN do:
a) Pick them best node on OPEN
b) Generate its successor.
For each successor do:
(i) If it has not been generated before. evaluate it. add it to OPEN, and record its
parent.
(ii) If it has been generated before, change the parent if this new path is better
than the previous one.
in that case update the cost of getting to this node and to any successors that
this node may already have.
Oradea Neamt
71
Zerind Iasi
87
75 151 92
Arad Vaslui
140 Sibiu99 Fagaras
118 142
Timisoara 220 Rimnicu Vilcea
211 98
Urziceni Hirsova
Pitesti 85
111 Lugoj 97
101 Bucharest
70 146
Mehadia 86
138 90
75
Dobreta Giurgiu
120 Craiova
Notations.
• F’-Heuristic function to be used
• g-measure of the cost of getting from the initial state to the current node.
• h’ –Estimate of the additional cost of getting from the current node to the
goal state.
• F’(x)=g(x)+h(x)
A* Algorithm
1.Place the starting node S on open.
2.If open is empty, Stop & return failure.
3.Remove from open the node n that has the smallest value of f*(n).
If the node is a goal node, return success & Stop. Otherwise.
4. Expand n, generating all of its successor n’ and place n on closed.
For every successor n’, if n’ is not already on open or closed
attach a back-pointer to n, Compute f*(n’) and place it on open.
5.Each n’ that is already on open or closed should be attached to
back-pointers which reflect the lowest g*(n’) path. If n’ was on
closed and its pointer was changed, remove it and place it on
open.
6.Return to step 2
Heuristics: Example
• Travel: h(n) = distance(n, goal)
Oradea Neamt (234)
71 (380)
Zerind (374) Iasi (226)
87
75 151 92
Arad (366) Vaslui (199)
140 Sibiu99
(253) Fagaras
118 (176)
142
Timisoara 220 Rimnicu Vilcea
211 98
(329) (193) Urziceni Hirsova
Pitesti (98) 85 (80) (151)
111 Lugoj (244) 97
101 Bucharest (0)
70 146
Mehadia 86
138 90
75
Dobreta Giurgiu (77) Eforie (161)
(242) 120 Craiova
(160)
Problem Characteristics
To choose an appropriate method for a
particular problem:
1) Is the problem decomposable?
2) Can solution steps be ignored or undone?
3) Is the universe predictable?
4) Is a good solution absolute or relative?
5) Is the solution a state or a path?
6) What is the role of knowledge?
7) Does the task require human-interaction?
1) Is the problem decomposable?
• Can the problem be broken down to smaller problems to be solved
independently?
∫ ½(1+cos2X)dx
Is the problem decomposable?
Start Goal
A ON(B,C)
C B ON(A,B)
A B C
Blocks World
ON(B, C) ON(A, B)
CLEAR(A) ON(A, B)
A
C B
A B C
2)Can solution steps be ignored or undone?
Theorem Proving
A lemma that has been proved can be ignored for next steps.
Ignorable!
Can solution steps be ignored or undone?
The 8-Puzzle
2 8 3 1 2 3
1 6 4 8 4
7 5 7 6 5
Recoverable!
Can solution steps be ignored or undone?
Playing Chess
Moves cannot be retracted.
Irrecoverable!
Can solution steps be ignored or undone?
Certain outcome!
Is the universe predictable?
Playing Bridge
We cannot know exactly where all the cards are or what
the other players will do on their turns.
Uncertain outcome!
Is the universe predictable?
Is Marcus alive?
Is a good solution absolute or relative?
• Any-path problems can be solved using heuristics that suggest good paths
to explore.
Playing Chess
Knowledge is important only to
constrain the search for a solution.
Reading Newspaper
Knowledge is required even to be able
to recognize a solution.
Exa-Cricket news(players)
7) Does the task require human-interaction
• Solitary problem, in which there is no intermediate communication and no
demand for an explanation of the reasoning process.
By
Prof. Mukesh Barapatre
AI by Mukesh Barapatre
Knowledge Representation
PREPARED BY M Barapatre 2
Introduction
• Knowledge representation is a study of ways of how knowledge is actually
represented or picturized .
PREPARED BY M Barapatre 3
• Knowledge Base
Forms the system's intelligence source
Inference mechanism uses to reason and draw
conclusions
PREPARED BY M Barapatre 4
• Many knowledge representation schemes
– Can be programmed and stored in memory
– Are designed for use in reasoning
PREPARED BY M Barapatre 5
Representation and Mapping
• Facts: things we want to represent.
• Representations of facts: things we can manipulate.
• Eg Sky is blue Sky(BLUE)
6
Representation and Mapping
• Representation Mapping
• Forward
• Backward
reasoning
programs
Internal
Facts
Representations
English English
understanding generation
English
Representations
7
Representation and Mapping
forward backward
representation representation
mapping mapping
Internal Internal
representations representations
of initial facts operation of final facts
of program
8
Representation
• Sets of Syntax and Semantic
– Convention which make it possible to describe things
PREPARED BY M Barapatre 9
Representation and Mapping
• Spot is a dog
• Spot is a dog
dog(Spot)
hastail(Spot)
Spot has a tail
11
Representation and Mapping
12
Properties of Representation
Good representation:
Representational adequacy
13
Properties of Representation
• Inferential efficiency
– The ability to direct the inferential mechanisms into the
most productive directions by storing appropriate guides.
• Acquisitional efficiency
– the ability to acquire new knowledge using automatic
methods wherever possible rather than reliance on
human intervention
PREPARED BY M Barapatre 14
Approaches to KR
15
Approaches to KR
Inheritable knowledge:
• This approach uses the concept of inheritance ,in which elements
of specific classes inherits attributes and values from more
general classes.
• Objects are organized into classes and classes are organized in a
generalization hierarchy.
• Inheritance is a powerful form of inference, but not adequate.
16
PREPARED BY M Barapatre 17
Approaches to KR
Inferential knowledge:
▪ Facts represented in a logical form, which facilitates reasoning.
▪ Inheritance is not the only form to represent the knowledge.
▪ This approach make use of power of traditional logic
▪ It make use of predicate logic to represent the knowledge.
▪ An inference engine is required.
18
Approaches to KR
Procedural knowledge:
• Representation of “how to make it” rather than “what it is”.
• May have inferential efficiency, but no inferential adequacy and
acquisitional efficiency.
• In this approach Knowledge is encoded by using some procedures.
• The most common way is simply a code in some programming
language Such as LISP.
• The machine uses the knowledge when it executes the code to perform
the task.
19
Issues in Knowledge Representation
• Important Attributes.
• Relationship Among Attributes.
• Choosing the granularity of representation.
• Representing Set of objects.
• Finding right structure as needed.
PREPARED BY M Barapatre 20
Important Attributes
• Are there any attributes so basic, that occur in many different types of
problem?
• If there are we need to make sure that they are handled appropriately
in each of problem.
• There are two such attributes as instance & isa, which are important
because each supports property of inheritance.
PREPARED BY M Barapatre 21
Relationship Among Attributes
• The attributes we use to describe object are themselves act as entity.
• The relationship between attributes of an object, is independent of
specific knowledge they encode, & may hold properties like
– Inverse
– Existence in a isa hierarchy
– Technique for reasoning about values.
– Single value attributes.
PREPARED BY M Barapatre 22
Relationship Among Attributes
• Inverse
– Entities in the world are related to each other in many different ways.
– Eg Student- Read -Book, Student-Purchase-Book.
– Eg team ( Pee-wee-reese, Brooklyn-Dodgers)
– 1st assumption team=pee wee reese team= Brooklyn Dodgers
– 2nd assumption team member =pee wee reese team= Brooklyn
Dodgers
Existence in a isa hierarchy
– Generalization & Specialization relationships for attributes are
important because they support inheritance
PREPARED BY M Barapatre 23
Relationship Among Attributes
• Technique for reasoning about values.
– Some constraints has to be followed by the value of an attributes.
– Information about type of value.
– Eg Value of height must be a number measured in unit of length.
– Constraints on the value
– Eg Age of person can not be greater than his parents age.
• Single value attributes
– This is about specific attribute that is guaranteed to take unique
value.
– Eg Baseball player can at a time have single height.
PREPARED BY M Barapatre 24
Choosing Granularity of Representation
• High-level facts may not be adequate for inference.
• Low-level primitives may require a lot of storage.
• At what level of detail the knowledge should be represented & what
should be our primitive.
• Eg Depending on the level of audience we should represent
knowledge.
25
Representing Set of objects.
• There are certain properties of an object which are true as member of
• set but not as individual.
• Eg A person is very strict at a company but he is very calm at his
• home.
• Eg Page number written on page of book.
PREPARED BY M Barapatre 26
Finding right structure as needed.
• Selection of appropriate structure is necessary in order to represent
knowledge effectively.
Following problems were raised while selecting appropriate structure.
• How to perform initial selection of most appropriate structure.
• How to fill appropriate details from current situation.
• How to find better structure if one chosen is not appropriate.
• What to do if none of the available structure is appropriate
PREPARED BY M Barapatre 27
Ontology
• Ontology: the study of "being" or existence
• An ontology = "A catalog of types of things that are assumed to exist in
a domain of interest" (Sowa, 2000)
• An ontology = "The arrangement of kinds of things into types and
categories with a well-defined structure" (Passin 2004)
28
Ontology
top-level
categories
domain-specific
29
Ontology
Substance Accident
Property Relation
30
Ontology
31
Ontology
Relation
32
Ontology
Relation
33
Ontology
ANIMAL
Eat
FOOD
1 2
PERSON: john Has-Relative PERSON: *
1 2
PERSON: john Has-Wife WOMAN: mary
35
Representation in Logic and Other Schemas
• Inputs (Premises)
• Facts known true can be used to derive new facts that are true
PREPARED BY M Barapatre 36
• Symbolic logic: System of rules and procedures that
permits the drawing of inferences from various
premises
• Rules are used to determine the truth (T) or falsity (F) of the new
proposition
PREPARED BY M Barapatre 38
• A: Ram is boy
• B: He is well mannered
• A and B
• Ram is boy and well mannered
PREPARED BY M Barapatre 39
Properties of PL
PREPARED BY M Barapatre 40
Syntax for Preposition Logic
• Symbols
• Truth Symbols
• Connectives
PREPARED BY M Barapatre 41
Using Propositional Logic
Representing simple facts
It is raining
RAINING
It is sunny
SUNNY
It is windy
WINDY
If it is raining, then it is not sunny
RAINING → SUNNY
42
Examples
Weather examples
1. It is hot.
2. It is humid.
3. It is raining.
PREPARED BY M Barapatre 43
Weather examples
1. It is hot. -A
2. It is humid. - B
3. It is raining. - c
PREPARED BY M Barapatre 44
Using Propositional Logic
45
Using Predicate Logic
46
Using Predicate Logic
47
Using Predicate Logic
48
Using Predicate Logic
49
Using Predicate Logic
50
Using Predicate Logic
51
Using Predicate Logic
exclusive-or
x: Roman(x) → (loyalto(x, Caesar) hate(x, Caesar))
(loyalto(x, Caesar) hate(x, Caesar))
52
Using Predicate Logic
53
Using Predicate Logic
7. People only try to assassinate rulers they are not loyal to.
54
Using Predicate Logic
55
Using Predicate Logic
56
Using Predicate Logic
• Many English sentences are ambiguous.
• There is often a choice of how to represent knowledge.
• Obvious information may be necessary for reasoning
• We may not know in advance which statements to deduce (P or P).
57
Reasoning
Is Marcus alive?
58
Reasoning
59
Reasoning
61
Resolution
KB |= KB |= false
62
Resolution
KB |= KB |= false
( ) ( ) ( )
63
Resolution
KB |= KB |= false
( ) ( ) ( )
64
Resolution in Propositional/Predicate Logic
65
Resolution in Propositional Logic
Example:
KB = {P, (P Q) → R, (S T) → Q, T}
=R
66
Resolution in Predicate Logic
Example:
KB = {P(a), x: (P(x) Q(x)) → R(x), y: (S(y) T(y)) → Q(y), T(a)}
= R(a)
67
Resolution in Predicate Logic
Unification:
UNIFY(p, q) = unifier where SUBST(, p) = SUBST(, q)
68
Resolution in Predicate Logic
Unification:
x: knows(John, x) → hates(John, x)
knows(John, Jane)
y: knows(y, Leonid)
y: knows(y, mother(y))
x: knows(x, Elizabeth)
Unification: Standardization
UNIFY(knows(John, x), knows(y, Elizabeth)) = {John/y, Elizabeth/x}
70
Resolution in Predicate Logic
71
Resolution in Predicate Logic
72
Conversion to Clause Form
1. Eliminate →.
P → Q P Q
2. Reduce the scope of each to a single term.
(P Q) P Q
(P Q) P Q
x: P x: P
x: p x: P
P P
73
Conversion to Clause Form
4. Move all quantifiers to the left without changing their relative order.
(x: P(x)) (y: Q(y)) x: y: (P(x) (Q(y))
5. Eliminate (Skolemization).
x: P(x) P(c) Skolem constant
x: y P(x, y) x: P(x, f(x))Skolem function
6. Drop .
x: P(x) P(x)
7. Convert the formula into a conjunction of disjuncts.
(P Q) R (P R) (Q R)
8. Create a separate clause corresponding to each conjunct.
9. Standardize apart the variables in the set of obtained clauses.
74
Conversion to Clause Form
1. Eliminate →.
2. Reduce the scope of each to a single term.
3. Standardize variables so that each quantifier binds a unique variable.
4. Move all quantifiers to the left without changing their relative order.
5. Eliminate (Skolemization).
6. Drop .
7. Convert the formula into a conjunction of disjuncts.
8. Create a separate clause corresponding to each conjunct.
9. Standardize apart the variables in the set of obtained clauses.
75
FOL To CNF
“Every one who love all animal is loved by someone”
Fol➔
x:[y:animal(y)→ love(x,y)]→ [y:love(y,x)]
Remove implification
x:[y: animal(y) love(x,y)]→ [y:love(y,x)]
x:[y: animal(y) love(x,y)]→ [y:love(y,x)]
PREPARED BY M Barapatre 76
Example
1. Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. All Pompeians were either loyal to Caesar or hated him.
6. Every one is loyal to someone.
7. People only try to assassinate rulers they are not loyal to.
8. Marcus tried to assassinate Caesar.
77
Example
1. Man(Marcus).
2. Pompeian(Marcus).
3. x: Pompeian(x) → Roman(x).
4. ruler(Caesar).
5. x: Roman(x) → loyalto(x, Caesar) hate(x, Caesar).
6. x: y: loyalto(x, y).
7. x: y: person(x) ruler(y) tryassassinate(x, y)
→ loyalto(x, y).
8. tryassassinate(Marcus, Caesar).
78
Example
Prove:
hate(Marcus, Caesar)
79
Question Answering
80
Question Answering
PROLOG:
• Only Horn sentences are acceptable
81
Question Answering
PROLOG:
• Only Horn sentences are acceptable
• The occur-check is omitted from the unification: unsound
test P(x, x)
P(x, f(x))
82
Question Answering
PROLOG:
• Only Horn sentences are acceptable
• The occur-check is omitted from the unification: unsound
test P(x, x)
P(x, f(x))
• Backward chaining with depth-first search: incomplete
P(x, y) Q(x, y)
P(x, x)
Q(x, y) Q(y, x)
83
Question Answering
PROLOG:
• Unsafe cut: incomplete
A B, C A
B D, !, E
D B, C
D, !, E, C
!, E, C
84
Question Answering
PROLOG:
• Unsafe cut: incomplete
A B, C A
B D, !, E
D B, C
D, !, E, C
!, E, C
PREPARED BY M Barapatre 86
Predicate Calculus
PREPARED BY M Barapatre 87
Scripts
• Elements include
– Entry Conditions
– Props
– Roles
– Tracks
– Scenes
PREPARED BY M Barapatre 88
Semantic Networks
• Nodes: Objects
• Arcs: Relationships
– is-a
– has-a
PREPARED BY M Barapatre 89
• Semantic networks can show inheritance
PREPARED BY M Barapatre 90
Semantic Network Example
Human
Boy Being
Goes to Needs
Joe Woman
School
Has Food
a child
Kay
PREPARED BY M Barapatre 91
Frames
Definitions and Overview
PREPARED BY M Barapatre 92
Frame Terminology
Default Instantiation
Facet Object
Hierarchy of Range
frames
If added Slot
Instance of
PREPARED BY M Barapatre 93
• Concise, natural, structural representation of knowledge
• Encompasses complex objects, entire situations or a management
problem as a single entity
• Frame knowledge is partitioned into slots
• Slot can describe declarative knowledge or procedural knowledge
PREPARED BY M Barapatre 94
Frame Capabilities
Related ability to constrain the allowable values that an attribute can take on
More readable and consistent syntax for referencing domain objects in the
rules
Mechanism that will allow us to restrict the scope of facts considered during
forward or backward chaining
PREPARED BY M Barapatre 95
Multiple Knowledge
Representations
• Rules + Frames
• Others
• Acquiring knowledge
• Retrieving knowledge
• Reasoning
PREPARED BY M Barapatre 96
Structured Knowledge
By
Prof. Mukesh Barapatre
mother age
Sue John 5 mother (john, sue)
age (john, 5)
age father wife (sue, max)
age (max, 34)
…
34 Max
recipient giver
Mary GIVE John
object
book
Department of Information Technology by Mukesh Barapatre 6
Inheritance
instance N
instance
Nixon
Department of Information Technology by Mukesh Barapatre 8
Advantages of Semantic nets
• Easy to visualize
• Formal definitions of semantic networks have been
developed.
• Related knowledge is easily clustered.
• Efficient in space requirements
– Objects represented only once
– Relationships handled by pointers
GO
NEW YORK
JOHN
Who Where
How
isa
Birds Mammals
Legs 2 Legs 4
Flies T
isa
Penguins Cats Bats
Flies F Legs 2
Flies T
instance
Opus Bill Pat
Name Opus Name Bill Name Pat
Friend Friend
Department of Information Technology by Mukesh Barapatre 15
Modern Data-Bases combine three approaches:
conceptual graphs, frames, predicate logic
(relational algebra)
• Syntax – concerns how can be put together to form correct sentences and
determines what structural role each word plays in the sentence and what
phrases are subparts of other phrases.
• Semantics – concerns what words mean and how these meaning combine
in sentences to form sentence meaning. The study of context-independent
meaning.
Department of Information Technology by Mukesh Barapatre 33
Knowledge of Language (cont.)
• Pragmatics – concerns how sentences are used in different situations
and how use affects the interpretation of the sentence.
S S
NP VP NP VP
I V NP NP I V NP
her duck
Computer Human
Human Judge
Words
Morphological Analysis
Morphologically analyzed words (another step: POS tagging)
Syntactic Analysis
Syntactic Structure
Semantic Analysis
Context-independent meaning representation
Discourse Processing
Final meaning representation
By
Prof. Mukesh Barapatre
• 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.
3. User Interface
4. Explanation Facility
Expert System Structure
Knowledge
Based Rules Expert
Interpreter Natural
Inference Language
Data base
Engine Context Set Interface
of facts
User
Knowledge Base
• Represents all the data and information imputed by experts in the field.
• Stores the data as a set of rules that the system must follow to make
decisions.
• Applies the knowledge and the rules held in the knowledge base.
• 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.
• 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, question marks ) , colors , numbers , text.
Used for capturing the way people compare and order concepts;
it may reveal knowledge about classes, properties and priorities.
Department
of
Information
31 Technology
AI by
Representing the Knowledge
Knowledge
acquisition
Prototype
Prototype
critiquing
development
Cyclical development
Knowledge Preliminary
acquisition exploration of field -
initial k.e. interviews
Prototype
Prototype
critiquing
development
Cyclical development
Prototype
Prototype
critiquing
development
Cyclical development
Present the
prototype to the Knowledge
domain expert for acquisition
him/her to criticise
and improve
Prototype
Prototype
critiquing
development
Cyclical development
Prototype
Prototype
critiquing
development
Cyclical development
Prototype
Prototype
critiquing
development
Cyclical development
Present the revised
prototype to the domain Knowledge
expert for him/her to acquisition
criticise and improve
Prototype
Prototype
critiquing
development
Cyclical development
Prototype
Prototype
critiquing
development
Cyclical development
Prototype
Prototype
critiquing
development
Cyclical development
Present the revised
prototype to the domain Knowledge
expert for him/her to acquisition
criticise and improve
Prototype
Prototype
critiquing
development
Cyclical development
• This has the advantage that the KE is able to show early progress in the
Knowledge elicitation task.
Cyclical development
• It also generates enthusiasm in the domain expert.
Turban’s account of the
expert system development
lifecycle
The expert system development lifecycle
• Comment on Phase 1:
– it's important to discover what problem/problems the client expects
the system to solve for them, and what their real needs are. The
problem may very well be that more knowledge is needed in the
organisation, but there may be other, better ways to provide it.
– 'Management issues' include availability of finance, legal constraints,
and finding a 'champion' in top management.
The expert system development lifecycle
• Comment on Phase 2:
– the 'conceptual design' will describe the general capabilities of the
intended system, and the required resources.
– The problems of selecting software, and finding a domain expert (and
persuading him/her to co-operate) have been discussed in the last two
lectures.
The expert system development lifecycle
• Comments on Phase 3:
– Comments: See below on the question of what exactly this
prototype is used for.
– It's important to establish the feasibility (economic, technical and
operational) of the system before too much work has been done, and
it's easier to do this if a prototype has been built.
The expert system development lifecycle
Department
of
Information
71 Technology
AI by
Expert systems Vs conventional programs II
Department
of
Information
72 Technology
AI by
Expert systems Vs conventional programs III
Department
of
Information
73 Technology
AI by
Elements of an Expert System
80
Department of Information Technology AI by Mukesh Barapatre
Foundation of Expert Systems
BY
PROF. MUKESH BARAPATRE
By Mukesh Barapatre
Outline
2
Probability
Bayesian networks
Fuzzy logic
Crisp set
By Mukesh Barapatre
Probability
3
By Mukesh Barapatre
Probability
4
By Mukesh Barapatre
Probability
5
By Mukesh Barapatre
Probability
6
By Mukesh Barapatre
Probability
7
Example:
S = stiff neck
M = meningitis
P(S | M) = 0.5
P(M) = 1/50000
P(S) = 1/20
By Mukesh Barapatre
Probability
8
By Mukesh Barapatre
Probability
9
Axioms:
• 0 P(A) 1
• P(true) = 1 and P(false) = 0
• P(A B) = P(A) + P(B) - P(A B)
By Mukesh Barapatre
Probability
10
Derived properties:
• P(A) = 1 - P(A)
• P(U) = P(A1) + P(A2) + ... + P(An)
U = A1 A2 ... An collectively exhaustive
Ai Aj = false mutually exclusive
By Mukesh Barapatre
Probability
11
Bayes’ theorem:
By Mukesh Barapatre
Probability
12
By Mukesh Barapatre
Probability
13
Independence:
P(A B) = P(A).P(B)
P(A) = P(A | B)
Conditional independence:
P(A B | E) = P(A | E).P(B | E)
P(A | E) = P(A | E B)
Example:
P(Toothache | Cavity Catch) = P(Toothache | Cavity)
P(Catch | Cavity Toothache) = P(Catch | Cavity)
By Mukesh Barapatre
Probability
14
By Mukesh Barapatre
Probability
15
By Mukesh Barapatre
Probability
16
By Mukesh Barapatre
Bayesian Networks
17
By Mukesh Barapatre
Bayesian Networks
18
P(B) P(E)
Burglary .001 Earthquake .002
B E P(A)
Alarm T T .95
T F .94
F T .29
F F .001
A P(J) A P(M)
JohnCalls T .90 MaryCalls T .70
F .05 F .01
By Mukesh Barapatre
Bayesian Networks
19
Syntax:
A set of random variables makes up the nodes
A A
yes B B no
C C
D D
By Mukesh Barapatre
Bayesian Networks
20
Semantics:
An ordering on the nodes: Xi is a predecessor of Xj i < j
Example:
P(J M A B E)
J M
By Mukesh Barapatre
Bayesian Networks
22
By Mukesh Barapatre
Uncertain Question Answering
23
P(Query | Evidence) = ?
J M
By Mukesh Barapatre
Uncertain Question Answering
24
By Mukesh Barapatre
Uncertain Question Answering
25
By Mukesh Barapatre
Uncertain Question Answering
26
P(B | A)
= P(B A)/P(A)
= aP(B A)
P(B | A)
= aP(B A)
By Mukesh Barapatre
General Conditional Independence
27
By Mukesh Barapatre
General Conditional Independence
28
U1 Um
Z1j Znj
Y1 Yn
U1 Um
Z1j Znj
Y1 Yn
X E Y
Z
By Mukesh Barapatre
General Conditional Independence
31
Example:
Battery
Starts
Moves
By Mukesh Barapatre
General Conditional Independence
32
Example:
Battery
By Mukesh Barapatre
Vagueness
33
“Words like smart, tall, and fat are vague since in most contexts of
use there is no bright line separating them from not smart, not tall,
and not fat respectively …”
By Mukesh Barapatre
Vagueness
34
vs.
By Mukesh Barapatre
Fuzzy Sets
35
By Mukesh Barapatre
Fuzzy Sets
36
By Mukesh Barapatre
Fuzzy Sets
37
By Mukesh Barapatre
Fuzzy Set Definition
38
mA: U → [0, 1] 1
young
mA A 0.5
0
25 30 40 Age
By Mukesh Barapatre
Fuzzy Set Representation
39
Discrete domain:
high-dice score: {1:0, 2:0, 3:0.2, 4:0.5, 5:0.9, 6:1}
Continuous domain:
0
25 30 40 Age
By Mukesh Barapatre
Fuzzy Set Representation
40
a-cuts:
Aa = {u | A(u) a}
Aa+ = {u | A(u) > a} strong a-cut
0
25 30 40 Age
By Mukesh Barapatre
Fuzzy Set Representation
41
a-cuts:
Aa = {u | A(u) a}
Aa+ = {u | A(u) > a} strong a-cut
A(u) = sup {a | u Aa}
0
25 30 40 Age
By Mukesh Barapatre
Fuzzy Set Representation
42
Support:
supp(A) = {u | A(u) > 0} = A0+
Core:
core(A) = {u | A(u) = 1} = A1
Height:
h(A) = supUA(u)
By Mukesh Barapatre
Fuzzy Set Representation
43
By Mukesh Barapatre
Membership Degrees
44
Subjective definition
By Mukesh Barapatre
Membership Degrees
45
Subjective definition
Voting model:
Each voter has a subset of U as his/her own crisp
definition of the concept that A represents.
By Mukesh Barapatre
Membership Degrees
46
Voting model:
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10
1
3 x x
4 x x x x x
5 x x x x x x x x x
6 x x x x x x x x x x
By Mukesh Barapatre
Fuzzy Subset Relations
47
“X is A” entails “X is B”
By Mukesh Barapatre
Fuzzy Set Operations
48
Standard definitions:
By Mukesh Barapatre
Fuzzy Set Operations
49
Example:
old = young
By Mukesh Barapatre
Fuzzy Relations
50
Crisp relation:
R(U1, ..., Un) U1 ... Un
By Mukesh Barapatre
Fuzzy Relations
51
Crisp relation:
R(U1, ..., Un) U1 ... Un
By Mukesh Barapatre
Fuzzy Relations
52
Fuzzy relation:
U1 = {New York, Paris}, U2 = {Beijing, New York, London}
R = “very far”
NY Paris
Beijing 1 .9
NY 0 .7
London .6 .3
By Mukesh Barapatre
Fuzzy Numbers
53
By Mukesh Barapatre
Basic Types of Fuzzy Numbers
54
1 1
0 0
1 1
0 0
By Mukesh Barapatre
Basic Types of Fuzzy Numbers
55
1 1
0 0
By Mukesh Barapatre
Operations of Fuzzy Numbers
56
Interval-based operations:
(A B)a = Aa Ba
By Mukesh Barapatre
Operations of Fuzzy Numbers
57
By Mukesh Barapatre
Operations of Fuzzy Numbers
58
[a, b] + [d, e] = [a + d, b + e]
[a, b] - [d, e] = [a - e, b - d]
[a, b]*[d, e] = [min(ad, ae, bd, be), max(ad, ae, bd, be)]
By Mukesh Barapatre
Operations of Fuzzy Numbers
59
about 2 about 3
1
about 2 + about 3 = ?
about 2 about 3 = ?
0
2 3 +
By Mukesh Barapatre
Operations of Fuzzy Numbers
60
Discrete domains:
AB=?
By Mukesh Barapatre
Operations of Fuzzy Numbers
61
Extension principle:
f: U1 U2 → V
induces
~ ~ ~
g: U1 U2 → V
By Mukesh Barapatre
Operations of Fuzzy Numbers
62
Discrete domains:
By Mukesh Barapatre
Fuzzy Logic
63
if x is A then y is B
x is A*
------------------------
y is B*
By Mukesh Barapatre
Fuzzy Logic
64
By Mukesh Barapatre
Fuzzy Controller
65
By Mukesh Barapatre
Fuzzy Controller
66
By Mukesh Barapatre
Fuzzy Controller
67
FUZZY
actions Defuzzification CONTROLLER
model
Fuzzification
conditions model
By Mukesh Barapatre
Fuzzification
68
0
x0
By Mukesh Barapatre
Defuzzification
69
Center of Area:
x = (A(z).z)/A(z)
By Mukesh Barapatre
Defuzzification
70
Center of Maxima:
M = {z | A(z) = h(A)}
By Mukesh Barapatre
Defuzzification
71
Mean of Maxima:
M = {z | A(z) = h(A)}
x = z/|M|
By Mukesh Barapatre
SUBJECT:- Artificial Intelligence
Semester:-VII
Syllabus: History and Application of AI, The Turing Test approach, AI Problems and AI
Techinques, Defining problem as state space representation. Production system, Problem
characteristics, monotonic and non-monotonic production systems. Solving problems by
searching-Toyproblems,Real-Worldproblems.
Artificial Intelligence :
1
Artificial Intelligence (AI) is the intelligence of machines and the
branch of computer science that aims to create it A.I. is the study of how
to make computers do things at which, at the moment, people are better.
Introduction - AI
Artificial Intelligence (AI) is the intelligence of machines and the branch
of computer science that aims to create it.
AI is the study of : How to make computers do things which, at the
moment, people do better.
AI is the study and design of intelligent agents, where an intelligent
agent is a system that perceives its environment and takes actions
that maximize its chances of success. Relate to tasks involving higher
mental processes. Examples: creativity, solving problems, pattern
recognition, learning.
General application of AI
2
1. Finance
2. Medical
3. Industries
4. Telephone maintains
5. Telecom
6. Transport
7. Entertainment
8. Pattern reorganization
9. Robotics
10. Neural Networks
11. Genetic Algorithm
12. Data mining
Specific Application of AI
1) Game Playing
Much of the early research in state space search was done using common board games such
as checkers, chess, and the 15-puzzle. Games can generate extremely large search spaces.
Theses are large and complex enough to require powerful techniques for determining what
alternative to explore
Theorem-proving is one of the most fruitful branches of the field. Theorem-proving research
was responsible in formalizing search algorithms and developing formal representation
languages such as predicate calculus and the logic programming language.
3) Expert System
One major insight gained from early work in problem solving was the importance of
domain-specific knowledge. Expert knowledge is a combination of a theoretical
understanding of the problem and a collection of heuristic problem-solving rules
One of the long-standing goals of AI is the creation of programming that are capable of
understanding and generating human language
6) Robotics
3
A robot that blindly performs a sequence of actions without responding to changes or being
able to detect and correct errors could hardly considered intelligent. It should have some
degree of sensors and algorithms to guild it
7) Machine Learning
Learning has remained a challenging area in AI. An expert system may perform extensive
and costly computation to solve a problem; unlike human, it usually don’t remember the
solution.
Intelligent Behavior -
GOALS OF AI
4
Q.2) Write a short note on AI techniques.
5
Ans: -
1) It is voluminous.
2) 2. It is hard to characterize and identify correctly
3) It is endless changing
4) Knowledge is different from data, because it is organized in a way that agrees to
the ways it will be used.
1) The knowledge captures generalization. What this mean is grouping situation that
share important properties rather than representing each situation separately.
2) The advantage that knowledge has would be that unreasonable amounts of memory
and updating will no longer be required. Anything without this property is called
‘data’ rather than knowledge.
3) It should be represented in such a way that it can be understood by people who must
prepare it. For many program the size of the data be achieved automatically by taking
reading from a number of instruments, but in many AI areas, most of the knowledge a
program has must basically be provides by the people in terms that they understand
it.
4) it could easily be adjusted to correct errors and to demonstrate changes in the world.
5) It could be used to help overcome it own through volume by helping to restrict the
range of responsibilities that must usually be considered or discussed.
(iv)Requires testable theories of the workings of the human mind: cognitive science.
Thinking Rationally: Laws of Thought:- Aristotle was one of the first to attempt to
codify “right thinking, i.e., irrefutable reasoning processes. Formal logic provides a
6
precise notation and rules for representing and reasoning with all kinds of things in
the world.
What is Turing Test? Explain the purpose of turing test? [w-17, s-16]
Or
Explain the Turing test approach carried out by Alan Turing. [w-16]
Or
Statement :
The art of creating machines that perform functions requiring
intelligence when performed by people; that it is the study of, how to make
computers do things which at the moment people do better.
7
.
Turing Test :
If Interrogator not able to distinguish between human & Comp then Comp posses
intelligence.The machine tries to fool the interrogator to believe that it is the
human, and the person also tries to convince the interrogator that it is the human.
A . HUMAN INTERROGATOR
B. HUMAN
C. AI SYSTEM.
The Turing Test, proposed by Alan Turing (Turing, 1950), was designed to provide a
satisfactory operational definition of intelligence. Turing defined intelligent behavior as the
ability to achieve human-level performance in all cognitive tasks, sufficient to fool an
interrogator. Roughly speaking, the test he proposed is that the computer should be
interrogated by a human via a teletype, and passes the test if the interrogator cannot tell if
there is a computer or a human at the other end.
Programming a computer to pass the test provides plenty to work on. The computer would
need to possess the following capabilities:
8
interrogator to pass physical objects ``through the hatch.'' To pass the total Turing Test, the
computer will need computer vision to perceive objects, and robotics to move them about.
Within AI, there has not been a big effort to try to pass the Turing test. The issue of
acting like a human comes up primarily when AI programs have to interact with people, as
when an expert system explains how it came to its diagnosis, or a natural language
processing system has a dialogue with a user. These programs must behave according to
certain normal conventions of human interaction in order to make themselves understood.
The underlying representation and reasoning in such a system may or may not be based on
a human model.
9
AI Techniques
Various techniques that have evolved, can be applied to a variety of AI tasks.
The techniques are concerned with how we represent, manipulate and reason
with knowledge in order to solve problems.
10
11
Task Domains of AI / Typical AI problems
Ans :
• Define the problem precisely
• Analyze the problem.
• Isolate and represent the task knowledge that is
necessary to solve the problem.
• Choose the best problem solving technique and apply
them to the particular problem.
12
The Foundations of AI:- Philosophy (423 BC - present):
(a) Logic, methods of reasoning.
(b)Mind as a physical system.
(c) Foundations of learning, language, and rationality.
1. Mathematics (c.800 - present):
- Formal representation and proof.
- Algorithms, computation, decidability, tractability.
- Probability.
2. Psychology (1879 - present):
- Adaptation.
- Phenomena of perception and motor control.
- Experimental techniques.
3. Linguistics (1957 - present):
- Knowledge representation.
- Grammar.
1. Mundane Tasks:
– Perception
• Vision
• Speech
– Natural Languages
• Understanding
• Generation
• Translation
– Common sense reasoning
– Robot Control
2. Formal Tasks
– Games : chess, checkers etc
– Mathematics: Geometry, logic,Proving properties of programs
–
3. Expert Tasks:
– Engineering ( Design, Fault finding, Manufacturing planning)
– Scientific Analysis
– Medical Diagnosis
– Financial Analysis
13
AI Technique:- Intelligence requires Knowledge, knowledge posesses less desirable
properties such as:
– Voluminous
– Hard to characterize accurately
– Constantly changing
– Differs from data that can be used
14
Problem characteristics (W-15)
(S-16)
Explain the problem characteristics for solving following AI-problems :- (W-16)
i) Water – jug problem. (S-17)
ii) Chess Playing. (W-17)
iii) 8-puzzle problem.
iv) Travelling sales man problem
OR
Define AI. Explain the 7 problem characteristics with example. .
OR
Analyze the different problem characteristics for the following problem :
(i) Travelling Salesman problem
(ii) 8-puzzle problem.
OR
what are characteristics of Artificial Intelligence problems with suitable example
Ans : AI Problems
(i) Define the problem precisely:- This definition must include precise
specification of what the initial situations will be as well as what final situations
constitute acceptable to solution of problem.
(ii) Analyze the problem:- A few important features can have a immense impact on
the appropriateness of various possible technique for solving the problem.
(iii) Isolate and represent the task knowledge that is necessary to solve the
problem.
Choose the best problem solving technique and apply it to the particular problem
15
Problem characteristics
16
4) Is good solution absolute or relative ? (Is the solution a state or a path ?)
There are two categories of problems. In one, like the water jug and 8 puzzle problems, we
are satisfied with the solution, unmindful of the solution path taken, whereas in the other
category not just any solution is acceptable. We want the best, like that of traveling sales
man problem, where it is the shortest path. In any – path problems, by heuristic methods we
obtain a solution and we do not explore alternatives. For the best-path problems all possible
paths are explored using an exhaustive search until the best path is obtained.
17
Problem Solution :
i) Water – jug problem.
ii) Chess Playing.
iii) 8-puzzle problem.
iv) Travelling sales man problem
18
Production System
Explain different categories of Production system.
OR
Give the difference between monotonic and non-monotonic Reasoning System.
OR
Explain the working of production system. Differentiate between monotonic and
nonmonotonic production system. Give one example of monotonic and non-
monotonic production system.
OR
What are the characteristics of a production system? Write one example of
monotonic and nonmonotonic production system.
OR
What do you mean by production systems? State its different types and explain each
of the types in brief.
Ans:-
19
Production System Characteristics
2. If so, what relationships are there between problem types and the types
of production systems best suited to solving the problems?
3. Classes of Production systems:
1. Monotonic Production System: 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.
2. Non-Monotonic Production system
3. Partially commutative Production system: property that if
application of a particular sequence of rules transforms state x to
state y, then permutation of those rules allowable, also transforms
state x into state y.
4. Commutative Production system
20
• They can be implemented without the ability to backtrack to previous
states when it is discovered that an incorrect path has been followed.
• This often results in a considerable increase in efficiency, particularly
because since the database will never have to be restored, It is not
necessary to keep track of where in the search process every change was
made.
• They are good for problems where things do not change; new things get
created.
Non Monotonic
• Useful for problems in which changes occur but can be reversed and in
which order of operations is not critical.
• Example: Robot Navigation, 8-puzzle, blocks world
• Suppose the robot has the following ops: go North (N), go East (E), go
South (S), go West (W). To reach its goal, it does not matter whether the
robot executes the N-N-E or N-E-N.
21
systems, the order in which operations are performed is very important and hence
correct decisions have to be made at the first time itself..
1. One important disadvantage is the fact that it may be very difficult analyse the flow of
control within a production system because the individual rules don’t call each other.
2. Production systems describe the operations that can be performed in a search for a
solution to the problem. They can be classified as follows.
3. Monotonic production system :- A system in which the application of a rule never
prevents the later application of another rule, that could have also been applied at the
time the first rule was selected.
Ans :
Problem Space : The environment where the search is performed.
22
23
State Space - set of all states reachable from the initial state.
• The set of all possible configuration is the space of the problem states.
24
25
Topic 3: AI Example
OR
Suppose, you are given two jugs 4 gallon and 3 gallon capacity. Neither has any
measuring mark on it. There is a pump that can be used to fill jug with water. How can
you get exactly 2 gallon of water in 3 gallon jug & you cannot throw water on ground.
Determine final state and give the state space representation for this problem.
Assume, initial state of both the jugs are empty.
Ans:-
Water Jug Problem
The water jug problem: You are given two jugs, a 4-litre one and a 3-litre one. Neither have
any measuring markers on it. There is a pump that can be used to fill the jugs with water.
How can you get exactly 2 liters of water into 4-litre jug.
Let x and y be the amounts of water in 4-Lt and 3-Lt Jugs respectively Then (x,y)
refers to water available at any time in 4-Lt and 3-Lt jugs. Also (x, y) (x-d, y + dd) means
drop some unknown amount d of water from 4-Lt jug and add onto 3-Lt jug.
All possible production rules can be written as follows
• The state space for this problem can be described as the set of ordered pairs of
integers (x,y) such that
x = 0, 1,2, 3 or 4 and
y = 0,1,2 or 3;
Remember: There is NO hard and fast rules to follow this sequence. In any state space
search problem, there can be numerous ways to solve, your approach can be different to
solve a problem and sequence of actions too.
26
Production rules for Water Jug Problem :
Obviously to solve water jug problem, we can perform following sequence of actions,
(0,0) (0,3) (3,0) (3,3) (4,2) (0,2) (2,0)
By applying rules 2,9,2,7,5 and 9 with initial empty jugs
27
Q.6) b) Explain the term “combinatorial explosion” W-14,(3) Summer-13 (3)
Ans:-
The search tree for a travelling salesman problem becomes unmanageably large as the
number of cities increase, many problems have the property that as the number of
individual items being considered increase, the number of possible paths in the search tree
increases exponentially, meaning that as the problems gets larger, it becomes more and
more unreasonable to expect a computer program to be able to solve it. This problem is
known as combinatorial explosion because the amount of work that a program needs to do
to solve the problems seems to grow at an explosive rate, due to the possible combinations it
must consider.
“Mary went shopping for a new coat. She found a red one she really liked. When she got it
home, she discovered that it went perfectly with her favourite dress”.
Program 1:
1. Match predefined templates to questions to generate text patterns.
2.Match text patterns to input texts to get answers.
“What did X Y”
“What did Mary go shopping for?”
“Mary go shopping for Z”
Z = a new coat
Program 2:
Structured representation of sentences:
Event2: Thing1:
instance: Finding instance: Coat
tense: Past colour: Red
agent: Mary
object: Thing 1
28
Program 3:
Background world knowledge:
C finds M
C leaves L C buys M
C leaves L
C takes M
29