Welcome! Log In Create A New Profile

Advanced

CSP in 2007 Exam

Posted by nobbie 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
CSP in 2007 Exam
November 11, 2008 10:40AM
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:

avatar Re: CSP in 2007 Exam
November 11, 2008 11:03AM
I Don't understand the graph what do the variables pointing to the box, that point the letters mean? confused smiley
Re: CSP in 2007 Exam
November 11, 2008 12:05PM
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
found a solution at http://answers.yahoo.com/question/index?qid=1006021711052


HOCUS + POCUS = PRESTO
92836 + 12836 = 105672
avatar Re: CSP in 2007 Exam
November 11, 2008 03:48PM
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
According do another post, it required the constraint graph. I don't remember myself, it was too long ago and too painful.
avatar Re: CSP in 2007 Exam
November 11, 2008 05:29PM
Shot

Thanks Nobbiesmiling bouncing smiley
ll
Re: CSP in 2007 Exam
November 12, 2008 05:36AM
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
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
yes, sorry .... have edited the above

X5 = P
avatar Re: CSP in 2007 Exam
November 12, 2008 11:51AM
found this a little nicer than the text book

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

Click here to login