Sunteți pe pagina 1din 12

PROBLEM REPRESENTATION

IN AI:
1

1. DEFINE THE PROBLEM PRECISELY :LIKE WHAT IS INITIAL


SITUATION, WHAT WILL BE THE FINAL, ACCEPTABLE
SOLUTIONS.

2. ANALYZE THE PROBLEM: 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 AND


APPLY IT
Biomedical Department, NIT Raipur 10/10/09
Methods of problem representation in AI
2

State space representation

“A set of all possible states for a given problem is


known as the state space of the problem.”
or
“A state space represents a problem in terms of states
and operators that change states.”

Biomedical Department, NIT Raipur 10/10/09


3

A problem space consists of :

Precondition/An initial state

Post condition/Final states ( Goal State)

Actions

Total Cost

Biomedical Department, NIT Raipur 10/10/09


EXAMPLE OF PROBLEM SPACE
4

If one wants to make a cup of coffee.


What one have to do:

analyze the problem

check necessary ingredients are available or not.

if they are available ,apply procedure of making coffee


( Actions).

Biomedical Department, NIT Raipur 10/10/09


STATE SPACE REPRESENTATION OF COFFEE
MAKING
5

Biomedical Department, NIT Raipur 10/10/09


What have we done?
6

1. We started with Ingredients i.e the Initial state.


2. Followed by sequence of Steps.
3. We added only needed amount of coffee powder,
milk & sugar. These are Operators/ Actions.
4. At last had a cup of coffee –Goal state.

Biomedical Department, NIT Raipur 10/10/09


ANOTHER EXAMPLE: WATER JUG PROBLEM
7

PROBLEM Given:
1.Two Jugs: one 4 gallon & one 3 gallon.
2. No measuring markers.
3. There is a pump that can be used to fill jug with
waters.
4. How can you get exactly 2 gallons of water in to 4-
gallon jug?

Biomedical Department, NIT Raipur 10/10/09


PROBLEM SPACE
8

Initial States– amount of water in both jugs.


Actions—Empty large/small, pour from
large/small
Goal—specified amount of water in both jug
Path cost—total no of actions applied

Biomedical Department, NIT Raipur 10/10/09


Another Example:
Find a driving route from city A to city B
9

Problem Space:
1.States– location specified by city .
2.Actions– driving along the roads between cities
3.Goal— city B
4.Path cost—total distance or expected travel time.

Biomedical Department, NIT Raipur 10/10/09


STATE APACE FOR WATER JUG PROBLEM
10

 State: (x,y)
 x= 0,1,2,3, or 4 and,
 y= 0,1,2, or 3
 x represents the number of gallons of water in 4-gallon jug
 y represents the number of gallons of water in 3-gallon jug
 Start state: (0,0);
 Goal state: (2,n); n is not specified in question.
 Operators: Various operations/actions which can be carried out.
 Path Cost: Total no of steps.

Biomedical Department, NIT Raipur 10/10/09


ANOTHER EXAMPLE
11

Example: Consider a 4-puzzle problem,


where in a 4-cell board there are 3
cells filled with digits and 1 blank cell.
The initial state of the game
represents a particular orientation of
the digits in the cells and the final
state to be achieved is another
orientation supplied to the game
player. The problem of the game is to
reach from the given initial state to the
goal (final) state, if possible, with a Operators:
minimum of moves. Let the initial and
the final state be as shown in figures 1.blank-up (BU)
1(a) and (b) respectively. 2.blank-down (BD)
3. blank-left (BL)
4. blank-right (BR)

Biomedical Department, NIT Raipur 10/10/09


STATE SPACE TREE FOR 4 PUZZLE PROBLEM
12

Biomedical Department, NIT Raipur 10/10/09