You are on page 1of 9

Unit 2: Problem Solving:

Problem solving, particularly in artificial intelligence, may be characterized as a


systematicsearch through a range of possible actions in order to reach some predefined
goal or solution. Problem-solving methods divide into special purpose and general
purpose. A special-purpose method is tailor-made for a particular problem and often
exploits very specific features of the situation in which the problem is embedded. In
contrast, a general- purpose method is applicable to a wide variety of problems. One
general-purpose technique used in AI is means-end analysis—a step-by-step, or
incremental, reduction of the difference between the current state and the final goal.

Four general steps in problem solving:


Goal formulation
-What are the successful world states
Problem formulation
-What actions and states to consider given the goal
Search
-Determine the possible sequence of actions that lead to the states of
known values and then choosing the best sequence.
-Execute
Give the solution perform the actions.

Problem formulation:

A problem is defined by:

– An initial state: State from which agent start


– Successor function: Description of possible actions available to the
agent.
– Goal test: Determine whether the given state is goal state or not
– Path cost: Sum of cost of each path from initial state to the given state.

A solution is a sequence of actions from initial to goal state.


Optimal solution has the lowest path cost.

State Space representation

The state space is commonly defined as a directed graph in which each node is
a state and each arc represents the application of an operator transforming a
state to a successor state.

A solution is a path from the initial state to a goal state.

State Space representation of Vacuum World Problem:


Compiled By: Saroj Giri
States?? two locations with or without
dirt: Initial state?? Any state can be
initial
Actions?? {Left, Right, Suck}
Goal test?? Check
whether squares are clean.
Path cost?? Number of
actions to reach goal.

Production System:

A production system (or production rule system) is a computer program


typically used to provide some form of artificial intelligence, which consists
primarily of a set of rules about behavior. These rules, termed productions,
are a basic representation found useful in automated planning, expert systems
and action selection. A production system provides the mechanism necessary
to execute productions in order to achieve some goal for the system.

Productions consist of two parts: a sensory precondition (or "IF" statement) and
an action (or "THEN"). If a production's precondition matches the current state
of the world, then the production is said to be triggered. If a production's action
is executed, it is said to have fired. A production system also contains a
database, sometimes called working memory, which maintains data about
current state or knowledge, and a rule interpreter. The rule interpreter must
provide a mechanism for prioritizing productions when more than one is
triggered.

Compiled By: Saroj Giri


The underlying idea of production systems is to represent knowledge
in the form of condition-action pairs called production rules:

If the condition C is satisfied then the action A is appropriate.


If it is raining then open the umbrella.

CRYPTO-ARITHMETIC PUZZLE Some example:


1) SEND + MORE = MONEY

5 4 3 2 1 (Column)
c3 c2 c1
S E N D
+ M O R E

----------------------
M O N E Y

1. From Column 5, M=1, since it is only carry-over possible from sum of 2 single digit
number in column 4.
2. To produce a carry from column 4 to column 5 'S + M' is at least 9 so
'S=8or9' so 'S+M=9or10' & so 'O = 0 or 1'. But 'M=1', so 'O = 0'.
3. If there is carry from Column 3 to 4 then 'E=9' & so 'N=0'. But 'O = 0' so there is no
carry & 'S=9' & 'c3=0'.
4. If there is no carry from column 2 to 3 then 'E=N' which is impossible, therefore there
is carry & 'N=E+1' & 'c2=1'.
5. If there is carry from column 1 to 2 then 'N+R=E mod 10' & 'N=E+1' so 'E+1+R=E
mod 10', so 'R=9' but 'S=9', so there must be carry from column 1 to 2.
Therefore 'c1=1' & 'R=8'.
6. To produce carry 'c1=1' from column 1 to 2, we must have 'D+E=10+Y' as Y cannot
be 0/1 so D+E is atleast 12. As D is atmost 7 & E is atleast 5 (D cannot be 8 or 9 as it is
already assigned). N is atmost 7
& 'N=E+1' so 'E=5or6'.
7. If E were 6 & D+E atleast 12 then D would be 7, but 'N=E+1' & N would also be 7
which is impossible. Therefore 'E=5' & 'N=6'.

Compiled By: Saroj Giri


8. D+E is atleast 12 for that we get 'D=7' & 'Y=2'.

SOLUTION:

9 5 6 7
+ 1 0 8 5
-----------------
1 0 6 5 2

VALUES:
S=9
E=5
N=6
D=7
M=1
O=0
R=8
Y=2

2) WRONG

+WRONG

-------------------

RIGHT

has multiple solutions.

one is:

12734 G=4 H=6 I=5 N=3 O=7 R=2 T=8 W=1

+12734

----------

25468

Compiled By: Saroj Giri


3) CROSS+ROADS=DANGER

Compiled By: Saroj Giri


Compiled By: Saroj Giri
Compiled By: Saroj Giri
Compiled By: Saroj Giri
Compiled By: Saroj Giri

You might also like