Ai Assignment 3 D
Ai Assignment 3 D
Ai Assignment 3 D
Ans1. Solution:-
S=1
M=1
Now, let's consider the units place: D + E = Y. Since D and E
cannot be 0, the only possibility for D + E = Y is 10. This means:
S=1
E=8
N=0
D=7
M=1
O=9
R=6
Y=0
Identify Constraints:
Since "CROSS" and "ROADS" both have 5 letters, the result
"DANGER" must have 6 letters.
The sum of two 5-digit numbers can produce a 6-digit result that
starts with either 1 or 2 (the maximum sum of two 5-digit
numbers being 199998).
Trial and Error Method:
CROSS = 18988
CROSS= 18988
ROADS = 01909
ROADS= 01909
DANGER = 198797
DANGER=198797
So,
CROSS + ROADS = 18988 + 01909 = 198797
CROSS+ROADS=18988+01909=198797, which satisfies the
equation.
Evaluation: While the open list is not empty, select the node
with the lowest combined cost (the sum of the actual cost from
the start node to the current node and the estimated cost from the
current node to the goal node) and remove it from the open list.
If the selected node is the goal node, terminate the search and
return the optimal path. Otherwise, expand the selected node by
generating its neighboring nodes and adding them to the open
list.