Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Represent the following logic puzzle as a constraint satisfaction problem (defin

ID: 3672519 • Letter: R

Question

Represent the following logic puzzle as a constraint satisfaction problem (define all variables, domains and constraints). Each weekday, Bonnie takes care of five of the neighbors' children. The children's names are Keith, Libby, Margo, Nora, and Otto; last names are Fell, Gant, Hall, Ivey, and Jule. Each is a different number of years old, from two to six. Can you find each child's full name and age? One child is named Libby Jule. Keith is one year older than the Ivey child, who is one year older than Nora. The Fell child is three years older than Margo. Otto is twice as many years old as the Hall child. Determine: First name - Last name - Age You do not need to solve it, you only need to represent it as a csp. Solve the cryptarithmetic problem N O + N O = Y E S by hand using backtracking, forward checking, and the MRV and least-conslraing-value heuristics (provide one solution). Solution of Ex.6,5 from the textbook shows how it is done for TWO+TWO=FOUR puzzle. Consider the following constraint satisfaction problem: V = {x.y.z}, Dx = Dy = Dz = {0.1,2,3,4.5} Constraints: x + y is even; y - z = 4; y > 2x.

Explanation / Answer

1)
Given constraints are

child = {Libby, Jule}
sequence as per age = {nora,Ivey,Keith}
{Fell > margo by 3 years}
{Otto age is 2*Hall}

So sequence would be this
{Otto Gant->6, nora fell->5,Libby Jule -> 4, hall->3,keith margo->2}

---------------------------------------------------------------------------------------------------------------------------------------------------------------
2)
NO
NO
--------------
YES
----------------
variables
N = {0..9}; O = {0..9}, Y = {0..9};E = {0..9}; S = {0..9}

constraints:
O+O = S + 10*X1
X1 + N + N = E + 10*X2
X2 = Y

NO + NO = YES
each letter has differnt digit {{Y!=E}, {E!=N} .. }

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

3)
Given constraints are
(i) x + y is even ..
so x and Y are ODD values .. so we have to pick up either in {1,3,5}
(ii) Y-Z = 4, that means the difference between Y and Z are 1.
SO X = 1, Y = 5, Z = 1

These numbers meets our constraints..
(X+Y) = (1+5) = 6 even .. verified
(Y-Z) = (5-1) =4 ==> verified
(5 > 2*x) ==> (5>2) ==> verified