Unit 2 Problem Solving
Unit 2 Problem Solving
Problem formulation:
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.
Production 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.
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'.
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
one is:
+12734
----------
25468