problem formulation

11
Problem formulation Problem formulation Involves 4 steps 1. Define the problem precisely. The definition must comprise of precise specification of the initial situation as well the final situation with acceptable solutions to the problem. 2. Analyse the problem. 3. Isolate and represent the task knowledge which is required to solve the problem. 4. Choose the best problem-solving technique(s) and apply it (them) to the particular problem. 1

Upload: adri-jovin

Post on 14-Apr-2016

6 views

Category:

Documents


3 download

DESCRIPTION

Steps involved in Problem Formulation, Description, Chess, Water Jug ProblemPrescribed for Under-Graduate Engineering Students of Computer Science and Information Technology.

TRANSCRIPT

Page 1: Problem Formulation

Problem formulationProblem formulationInvolves 4 steps

1. Define the problem precisely. The definition must comprise of precise specification of the initial situation as well the final situation with acceptable solutions to the problem.

2. Analyse the problem.3. Isolate and represent the task knowledge which is

required to solve the problem.4. Choose the best problem-solving technique(s)

and apply it (them) to the particular problem.

1

Page 2: Problem Formulation

Problem DefinitionProblem Definition• Done as a State Space Search

• Chess Game, Water Jug Problem

2

Page 3: Problem Formulation

Chess GameChess Game• Legal Moves

• Position that represents a win

• It is not only the play but also the winning condition which terminates the game

3

Page 4: Problem Formulation

Chess GameChess Game

4

Page 5: Problem Formulation

Chess GameChess Game

5

Goal•Opponent does not have a legal move•King is under attack

Practical Difficulties•No person could ever supply a complete set of such rules. It would take too long and could certainly not be done without mistakes.

•No program could easily handle all those rules. Although a hashing scheme could be used to find the relevant rules for each move fairly quickly, storing is in fact a difficulty.

Page 6: Problem Formulation

Chess GameChess Game

6

Page 7: Problem Formulation

Chess GameChess Game

7

White pawn atSquare(file e, rank 2)

ANDSquare(file e, rank 3)

is emptyAND

Square(file e, rank 4)Is empty

Move pawn from Square(file e, rank 2)to Square(file e, rank 4)

Advantage of State Space Search•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 and search. Search is a very important process in the solution of hard problems for which no more direct techniques are available.

Page 8: Problem Formulation

Water Jug ProblemWater Jug Problem

8

Problem You are given two jugs, a 4-litre one and a 3-litre one. Neither has 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 litres of water into 4-litre jug?

Page 9: Problem Formulation

Water Jug ProblemWater Jug Problem

9

S. No. Condition Rule Definition 1 (x, y)

if x<4 (4, y) Fill the 4-litre jug

2 (x, y) if y<3

(x, 3) Fill the 3-litre jug

3 (x, y) if x>0

(x-d, y) Pour some water out of the 4-litre jug

4 (x, y) if y>0

(x, y-d) Pour some water out of the 3-litre jug

5 (x, y) if x>0

(0, y) Empty the 4-litre jug on the ground

6 (x, y) if y>0

(x, 0) Empty the 3-litre jug on the ground

7 (x, y) if x+y 4 and y > 0

(4, y- (4-x)) Pour water from the 3-litre jug into the 4-litre jug until the 4-litre jug is full

8 (x, y) if x+y 3 and y > 0

(x – (3 – y), 3) Pour water from the 4-litre jug into the 3-litre jug until the 3-litre jug is full

9 (x, y) if x + y 4 and y > 0

(x+y, 0) Pour all the water from the 3-litre jug into the 4-litre jug

10 (x, y) if x + y 3 and y > 0

(0, x+y) Pour all the water from the 4-litre jug into the 3-litre jug

11 (0, 2) (2, 0) Pour the 2 litres from the 3-litre jug into the 4-litre jug

12 (2, y) (0, y) Empty the 2 litres in the 4-litre jug on the ground

Page 10: Problem Formulation

Water Jug ProblemWater Jug Problem

10

Page 11: Problem Formulation

Problem DescriptionProblem Description

11

Therefore, in order to provide a formal description of a problem, one need to do the following:1.Define a state space that contains 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 starts, which are termed the initial states.3.Specify one or more states that would be acceptable as solutions to the problem, which are termed the goal states.4.Specify a set of rules that describe the actions/operators available.The problem can be solved using the rules which can be combined with appropriate control strategies.