Question: 2 . [ 1 0 points ] In the cryptarithmetic problem below, the aim is to find a substitution of digits for the letters T
points
In the cryptarithmetic problem below, the aim is to find a substitution of digits for
the letters
T W O F U
and
R
such that each letter stands for a different digit, and the resulting
sum is arithmetically correct. The leading letters
T
and
F
cannot be
Auxiliary variables
x x
and
x
are introduced for representing carry overs.
The domains for the variables and the constraints
for the problem are specified below.
Assume that we use the Backtracking algorithm in the Appendix to find a solution for this problem.
Since
x
and
F
only have one value in their domain, they will be chosen by the Backtracking
algorithm first and assigned the value In the search tree generated, assume that level is for
empty assignment, level is for assigning to variable F and level is for assigning to variable
x Determine the total number of nodes that will be generated by the Backtracking algorithm in
the
worst case
Show all work to get full credits.
You do not have to actually generate a search
tree. Just provide an upper bound on the total number of nodes generated based on the information given. Here, the question asks for an upper bound, not time complexity in terms of the big
notation. Backtracking search algorithm for CSP:
function BACKTRACKINGSEARCHCSp returns solution or failure
return BACKTRACK CSP
function BACKTRACKassignment csp returns a solution or failure
if assignment is complete then return assignment
var leftarrowmathrm SELECTUNASSIGNEDVARIABLEcsp
for each value in ORDERDOMAINVALUESvar assignment, csp do
if value is consistent with assignment then
add var value to assignment
inferences leftarrow INFERENCEcsp var, value
if inferences failure then
add inferences to assignment
result leftarrowBACKTRACKassignment csp
if result failure then
return result
remove varvalue and inferences from assignment
return failure
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
