Ai Techniques
Ai Techniques
Properties of AI Problems
Knowledge Representation
Intelligence/intelligent behaviour requires knowledge.
Properties of Knowledge
Voluminous
Hard to characterize
Constantly changing
Use of Knowledge
Provides a way of solving complex problems by
exploiting the structures of the objects that are
involved.
Abstraction
Provides a way of separating important features
and variations from the many unimportant ones
that would otherwise overwhelm any process.
Advantages of using AI Techniques
They are much less fragile. They will not be thrown off
completely by a small changes in their input.
People easily understand what the program knowledge
is.
These techniques can work for large problems when
direct methods fail.
Search
Search is the fundamental technique of AI.
Possible answers, decisions or courses of action are structured into
an abstract space, which we then search.
Search is either "blind" or “uninformed":
blind
we move through the space without worrying about
what is coming next, but recognising the answer if
we see it
informed
we guess what is ahead, and use that information to
decide where to look next.
We may want to search for the first answer that satisfies our
goal, or we may want to keep searching until we find the
best answer.
Knowledge Representation & Reasoning
The second most important concept in AI is Knowedge
Representation and Reasoning.
If we are going to act rationally in our environment, then
we must have some way of describing that environment
and drawing inferences from that representation.
–how do we describe what we know about the world ?
–how do we describe it so that we can get hold of the
right piece of knowledge when we need it ?
–how do we generate new pieces of knowledge ?
–how do we deal with uncertain knowledge ?
Types of Knowledge
Declarative Knowledge
Expressed as statements of facts about the world.
Ex.- Personnel data in a database is a declarative
knowledge.
Procedural Knowledge
It is a compiled knowledge related to the performance of
some task.
Ex.- The steps used to solve an algebraic equation are
expressed as procedural.
Heuristic
A special type of knowledge used by human to solve
complex problems. Heuristics are the knowledge used to
make good judgments or strategies, tricks or “rules of
thumb” used to simplify the solution of problem.
Heuristics are usually acquired with much experience.
Ex.- Fault finding in a TV set.
Problems, Problem Spaces, and Search
Building a Problem-Solving Program
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).
Way to Describe Chess Moves
A Water Jug Problem
Water Jug Problem
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; x represents the number of
gallons of water in the 4-gallon jug and y represents the
quantity of water in 3-gallon jug
The start state is (0,0)
The goal state is (2,n)
Production Rules for the
Water Jug Problem
A Water Jug Problem (Cont’d)
To solve the water jug problem
• Breadth-first search
• Uniform-cost search
• Depth-first search
• Depth-limited search
• Iterative deepening search
Comparing Uninformed Search
Strategies
• Completeness
– Will a solution always be found if one exists?
• Time
– How long does it take to find the solution?
– Often represented as the number of nodes searched
• Space
– How much memory is needed to perform the search?
– Often represented as the maximum number of nodes
stored at once
• Optimal
– Will the optimal (least cost) solution be found?
Algorithm:
Create a variable called NODE-LIST and set it to
initial state
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
Breadth-First Search
Breadth-First Search
Breadth-First Search
Breadth-First Search
Properties of Breadth-First
Search
• Complete
– Yes if b (max branching factor) is finite
• Time
– 1 + b + b2 + … + bd + b(bd-1) = O(bd+1)
– exponential in d
• Space
– O(bd+1)
– Keeps every node in memory
– This is the big problem; an agent that generates nodes at
10 MB/sec will produce 860 MB in 24 hours
• Optimal
– Yes (if cost is 1 per step); not optimal in general
Lessons From Breadth First
Search
• The memory requirements are a bigger problem for
breadth-first search than is execution time
(4,0) (0,3)
They are bad to the extent that they may miss points of interest
to particular individuals.
On the average they improve the quality of the paths that are
explored.