You are not logged in.
ABC + DEF = GHIJ
solution is given : 437 + 589 = 1026
or
743 + 859 = 1602
how is this possible ??
Offline
Hi;
Alphametics can have more than 1 solution. This one has 96 solutions!
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Hi;
How do you know it have 96 solutions? Through M? Explain please.
His dominion is an everlasting dominion, Which shall not pass away, And His kingdom the one Which shall not be destroyed.
Offline
The fastest way to get an answer to this type problem especially if there are multiple solutions is to use M.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
How do you do that with m?
His dominion is an everlasting dominion, Which shall not pass away, And His kingdom the one Which shall not be destroyed.
Offline
Do you program yet?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
No. But I want to
His dominion is an everlasting dominion, Which shall not pass away, And His kingdom the one Which shall not be destroyed.
Offline
You have two options to code this:
1) Download someone elses code.
2) Write it yourself.
For 1) I recommend Rashers' code.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Do you do Java?
His dominion is an everlasting dominion, Which shall not pass away, And His kingdom the one Which shall not be destroyed.
Offline
I came from BASIC -> Assembly -> C++ -> M. No room for Java in there.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Maybe we could learn Java together? I really like Java.
His dominion is an everlasting dominion, Which shall not pass away, And His kingdom the one Which shall not be destroyed.
Offline
Nope, I hate it. Do not let that stop you though if you really like it you should do it.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Why do you hate it?
His dominion is an everlasting dominion, Which shall not pass away, And His kingdom the one Which shall not be destroyed.
Offline
Perhaps we could write the program together for m?
His dominion is an everlasting dominion, Which shall not pass away, And His kingdom the one Which shall not be destroyed.
Offline
I have it written already, how do you think I got the answers?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Hi Bobby,
I also got 96 answers, but am having trouble getting M to restrict the output to just those 96. My output includes invalid answers with a leading zero.
Could you please point me in the right direction?
Thanks.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
Sometimes I roll my own or sometimes I just use Rasher's. Want to see his?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Yes please. You probably saw my comment in the other thread about me going fishing blindly without success...
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
ClearAll[a, b, c, d, e, f, g, h, i, j];
(*Define alphabet,terms,and sum*)
vars = {a, b, c, d, e, f, g, h, i, j};
term1 = {a, b, c};
term2 = {d, e, f};
sum = {g, h, i, j};
(*Define Constraints*)
(*minimum and maximun values*)
{min, max} = {0,
9};
(*must all letters assume differing values?*)
mustDiffer = True;
(*Additional constraints,use {} for none*)
conditions = {a > 0, d > 0, g > 0};
(*Solve It*)
solutions =
TableForm[
Select[vars /.
Solve[Join[{FromDigits[term1] + FromDigits[term2] ==
FromDigits[sum]}, Table[min <= zz <= max, {zz, vars}],
conditions], vars, Integers], ! mustDiffer || Unequal @@ # &],
TableHeadings -> {None, vars}];
(*Display Results& Checks*)
If[
solutions[[1]] == vars ||
solutions[[1]] == {}, "No solutions found for given",
Labeled[solutions, {Length[
solutions[[1]]] "Solutions found for given\n",
"\nCheck all ok:" (varSave = SymbolName /@ vars;
res =
And @@ ((ToExpression[
ToString[varSave] <> "=" <> ToString[#]];
FromDigits[term1] + FromDigits[term2] ==
FromDigits[sum]) & /@ solutions[[1]]);
ClearAll @@ varSave; res)}, {Top, Bottom}] // Framed]
This is Rasher's code.
It is not that fast but it is generic.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
Thanks! I've saved it in my M, and am looking at it now...
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
It should be easy to adapt it to any of that type.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
It works instantaneously with SEND + MORE = MONEY.
ABC + DEF = GHIJ takes about 18 seconds for a complete solution that excludes answers with leading zeros, whereas my code takes about 22 seconds for answers that don't exclude them.
I haven't tried the code from hummmer98's thread yet (hope I can get the 2-equation thing going).
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
hummer98?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
hummmer98's thread ("help me please and fast")
Btw, hummmer98 hasn't come back on board yet, so maybe you were too slow with your answer!
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson
Offline
Yes, he wanted super speed m and got me instead.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline