Professional Documents
Culture Documents
Akaash Tonk
1311211
Amit Kumar
1311214
Rakesh Mondal 1311247
Shikha Rath
1311261
Initial State
The initial state is represented by the state State consisting only of the single assignment Digit 5
State : { Digit 5 }
II.
Goal State :
Final state State: { lnteger digit } such that the sum is correct.
Goal test function:
-All assignments lnteger Digit have been completed
-Sum (d) == True for equation "DONALD + GERALD = ROBERT"
III.
Operators :
Q : Assignment Operator given by lnteger digit ,
Apply Q2
Q1
S3
S3
S2
S3
It processes the column by taking information from the state about the three letters and the carry
(t) in the column The output is an expression with respect to the variable with missing
information in the state
ti (carry)
PC (C1)
s1
D=5
s2
= s3
D=5
ti +1(carry)
?
Output
T=0 ; t2 =1
TO : Test Operator
The input to 'TO Operator' is the letter and information known with respect to the letter , along
with the digit to be assigned . The output is whether the assignment is valid or invalid based on
current state information.
E.g. For TO(D , 1 )
The operator will check if 1 has been assigned to another letter , or if the letter D has been assigned
another digit. In this case the operator will return invalid , since D has been assigned the letter 5 in
the initial state
GA : Generate Alternatives
The input to the GA operator is the letter and the information known with respect to the letter in
the given state. The output is the set of admissible values not taking into account whether or not the
digit has been assigned to another letter or not
E.g. GA (R , R is odd and R <5) => 1 , 3
The process flow for a variable can occur in the following manner
GA (T) -> TO (T,0) -> PC (C1) Q1( T<-0)
Initial
Q1
S2
S2
The termination of a branch will occur when any of three conditions defined for the goal state are
violated by the assignment.
Simon. How would you apply the means-ends analysis technique for solving
the water jug problem discussed in class? Provide a clear description of the
goals, sub-goals and operators and draw a diagram of the search path. Can you
specify a heuristic that will help curtail the search space (possibly a heuristic
better than the one discussed in class)?
Means-Ends Analysis
In the means-ends analysis, two key features are
1. Difference reduction
2. Sub-goaling
In this method, we carry out state space searching by state evaluation and operator ordering. If a
difference is detected between the current and goal states, then a sub-goal to eliminate the
difference is created. We then apply the operator that will make the most important difference to
the current state. In selecting the operator to apply, we match the conditions of the operator to the
current state to identify the most important difference.
Water jug problem
There are two jugs 3-litre and 4-litre. Initially both of them are empty i.e (0,0) state. The goal is to
fill 2-litre water in 3-litre jug i.e. final goal state is (2,0). We can use Means-Ends analysis to solve
the Water jug problem. We can start from the goal state and do backward search to arrive at the
initial state. Before proceeding, we need to define the generators and operators for solving the
problem.
Generators for water jug problem
1. Fill 3 (Fill 3-litre jug)
2. Fill 4 (Fill 4-litre jug)
3. Pour34 (Pour water from 3-litre jug to 4-litre jug)
4. Pour43 (Pour water from 4-litre jug to 3-litre jug)
5. Empty 3 (Empty 3-litre jug)
6. Empty 4 (Empty 4-litre jug)
Generators can be classified into three operators which are
being using in solving the water jug problem
3-litre jug
AAa
4-litre jug
(2,1)1
(2,4)4
(3,3)4 (2,2)2
(0,2)4 (2,3)3
(2,3)3
(0,3)5
(3,0)5
(0,0)---Initial State
Q. 4. Draw the search tree for a depth-first search for the problem below. You may go
up to 4 levels. Assume all letters have a unique assignment of numerals.
SEND
+
MORE
---------------------------M ONEY
Identifying the Constraints
{S,E,N,D,M,O,R,Y} in {0,1,2,3,4,5,6,7,8,9}
D+EY
N+R+C1 E
E+O+C2 N
S+ M+C3 O
carrying over C1
carrying over C2
carrying over C3
carrying over C4
2X
3X
4X
5X
6X
7X
8X
9 (For S=9,C3=1, M=O=1 which is not possible, therefore C3=0)
2X
3X
4X
5 (C2=1 as EN)
6 ( N= E+1)
2X
3X
4X
7X
8 (For C1=0, R=S=9 which is not possible, so C1=1)
2X
3X
4X
7
2
Therefore the digits assigned to { M,O,S,E,N,D,R,Y} map as {1,0,9,5,6,7,8,2}