1. ## Cryptarithmetic puzzle :(

Hi there...I am in a great danger !!!

I have to write a program just in 14hours....not finding any ref. code for that.....can anyone help a bit???

http://www.rci.rutgers.edu/~cfs/305_...blemSolve.html

Something like this!

SEND

+MORE
----------------------
MONEY

2. ## ...

Maybe can you explain us, what exactly your program should do?
You posted here, like we have the same exercise, so please relax, write down what *should* your program do, and we'll try to help you out.

3. ## no code solution

I found a set of values which is a solution, but only one solution in an infinite set. The problem was to find one solution, so the problem is solved:

N=0
A=1
L=2
G=3
R=4
B=5
T=20

I don't think you should create a program to get a solution, just use algebra.

4. ## Completion of the precedent reply

I didn't give the values for O and E: you can use an arbitrary value, different for the values choosen before(to satisfy the problem's requests), such as O=100 E=200

5. It said that you have to use values from 0-9, and each number must be assigned to one letter, and vice versa, and D=5.

Solution:
D=5
O=2
N=6
A=4
L=8
R=7
B=3
T=0
G=1
E=9

6. ## Correction

I made an error, here is the final solution:
N=0
A=1
L=2
G=3
R=4
B=5
T=15
O=100
E=200

I'm sorry for the error I made before...

7. It's an invalid solution. See my above post.

treat each char as a integer variable, you get an equation:
15+N+2A+2L+G=R+B+T
Now, to solve this linear equation is impossible because you should have more indipendent relations between the variables, as much relations as variables-1.

We need only one solution, not every solution, so we can give an arbitrary value to each variable-1, not to all, so we can reach a simple equation like T+n1=n2=>T=n2-n1, where n1 and n2 are the sums of the members of the equation.

Just choose variable's values so that n2>n1.
BrownB

PS I found no errors on my last post..perhaps I should look better

9. Well, the error is pretty blatant.

Find an assignment of the integers 0-9 to the letters...

10. ## OOps..

Absolutely true!...

11. 
Hm... I'll have to give this a bit more thought.
[/edit]

[edit2]
Good luck. Though there is a lot on the subject, were you to spend a moment looking for it.
[/edit2]

Quzah.

12. now there's a problem that could eat up your day if you let it... not that I've spent any time on it (Just in case someone feels like spending a day at it, I'd love to see if anyone can write an algorithm to solve it!)

13. Sorry...yes...you are correct...I should have write the whole thing in a programmers manner

The problem statement:

The following:

S E N D

+ M O R E

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

M O N E Y

is a cryptarithmetic problem. Each letter must be given a digit value (0 through 9), with M ≠ 0. No two letters must have the same value. The sum of the digits must be as shown in the problem. The solution of the above problem is:

D = 7, E = 5, M = 1, N = 6, O = 0, R = 8, S = 9, Y =2.

Indeed:

9 5 6 7

+ 1 0 8 5

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

1 0 6 5 2

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

Algorithm:

http://sentinel.cs.cf.ac.uk/Dave/AI2/node28.html

Constraint satisfaction problem (CSP)

states are sets of variables
goal test is set of constraints on values of variables.
each variable has domain (D) which is set of possible values.(discrete/continuous)
unary constraint specifies allowable subset of domain for each variable
binary constraint between 2 variables specifies allowable combinations (subset of cross-product)
solution specifies state of values such that all constraints are met
constraints may be absolute or just preferences

Can be solved via general search, but special purpose algorithms generally perform better

Discrete/finite domain like 8-queens

may be able to list solutions/constraints
max depth of tree is number of variables
solutions are at max depth
backtracking search backtracks as soon as constraint is violated
forward checking looks ahead to detect unsolvability. Delete from domains of uninstantiated variables any values that conflict with current assignment. If any domain becomes empty, backtrack immediately.

14. noone reads the math forums Look here they also have more here (the first three)

15. Thanks for the math forum link
Yes...sometimes programming and algorithms make us too much involved...that we forget...these lies on Mathematics