# CSP in 2007 Exam

Posted by nobbie
Announcements Last Post
SoC Curricula 09/30/2017 01:08PM
Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
School of Computing Short Learning Programmes 11/24/2014 08:37AM
Unisa contact information 07/28/2011 01:28PM
 CSP in 2007 Exam November 11, 2008 10:40AM Registered: 14 years ago Posts: 78 Rating: 0
Hi,

Inc Oct 2007, the CSP given in the exam was:
``` HOCUS
+POCUS
------
PRESTO```

How would you go about solving that during the exam other then brute force guessing ?

Using the text book, i can get to these conclusions:

```     S+S = O + 10*X1
X1 + U+U = T + 10*X2
X2 + C+C = S + 10*X3
X3 + O+O = E + 10*X4
X4 + H+P = R + 10*X5
X5 = P```

constraint graph:

 Re: CSP in 2007 Exam November 11, 2008 11:03AM Registered: 12 years ago Posts: 125 Rating: 0
I Don't understand the graph what do the variables pointing to the box, that point the letters mean?
 Re: CSP in 2007 Exam November 11, 2008 12:05PM Registered: 14 years ago Posts: 78 Rating: 0
The square boxes indicate constraint: all variables connected to the same square box impose some restriction on each other.

Finally found a solution by working backwards from P:

If no leading zero is allowed, P must be non-zero and can at most be 1. so P=1
That means, H has to be 8 or 9 in order to carry a 1 and make X5=P=1.

If "H" is 8, then "O" has to be:
1) some even int (because of S+S)
2) >= 5 (in order to carry)
3) cannot be 8 because it conflicts with H
4) 6

If "O" is 6:
1) S+S must be 3
2) C+C must be S, which means X2 will have to carry and C must be 1, which conflicts with P

we've exhausted H=8.

(edited to fix my mistake)

So H=9:
Then "O" has to be:
1) some even int (because of S+S)
2) <5 because if it carries, it will conflict with R=0
3) can be 2 if S = 6

from there it's easy .... O=2 implies:
S=6; which implies
C=3 or 8; but only 8 allows U+U+1 to = 7
U=3
T=7
 Re: CSP in 2007 Exam November 11, 2008 12:19PM Registered: 14 years ago Posts: 78 Rating: 0

HOCUS + POCUS = PRESTO
92836 + 12836 = 105672
 Re: CSP in 2007 Exam November 11, 2008 03:48PM Registered: 14 years ago Posts: 898 Rating: 0
Hey, What exatly was required in the exam? the values of the variables? the CSP Graph? the Domain and Constraints?
 Re: CSP in 2007 Exam November 11, 2008 04:44PM Registered: 14 years ago Posts: 78 Rating: 0
According do another post, it required the constraint graph. I don't remember myself, it was too long ago and too painful.
 Re: CSP in 2007 Exam November 11, 2008 05:29PM Registered: 12 years ago Posts: 125 Rating: 0
Shot

Thanks Nobbie
 Re: CSP in 2007 Exam November 12, 2008 05:36AM Registered: 11 years ago Posts: 10 Rating: 0
This is called Cryptarithmetic which is a CSP with higher order constraints (3 or more variables) Capter 5, pg 140.

Cryptarithmetic
 Re: CSP in 2007 Exam November 12, 2008 10:13AM Registered: 11 years ago Posts: 62 Rating: 0
nobbie Wrote
--------------------
S+S = O + 10*X1
X1 + U+U = T + 10*X2
X2 + C+C = S + 10*X3
X3 + O+O = E + 10*X4
X4 + H+P = R + 10*X5
X5 + P

What does X5 + P equate to???

Aint it supposed to be:

X5 = P?
 Re: CSP in 2007 Exam November 12, 2008 10:43AM Registered: 14 years ago Posts: 78 Rating: 0
yes, sorry .... have edited the above

X5 = P
 Re: CSP in 2007 Exam November 12, 2008 11:51AM Registered: 11 years ago Posts: 343 Rating: 0
found this a little nicer than the text book

solution
Sorry, only registered users may post in this forum.