> BTW, could anyone come up with the answer for the problem within 10 > secs on a modern PC?
I am pretty sure I could. The approach is this: - write down the implicit (linear) equations - use Gaussian elimination to simplify the matrix - try all possibilities in the independent variables Thus: send +more ------ money (d+e)=y+ 10*c1 (n+r)=e+c1+10*c2 (e+o)=n+c2+10*c3 (s+m)=o+c3+10*m etc. ----- Original Message ----- From: June Kim <[EMAIL PROTECTED]> Date: Thursday, September 20, 2007 20:21 Subject: Re: [Jchat] Arithmetic puzzle To: Chat forum <[email protected]> > Duh! > > m=: ans 'money = send + more' > #m > 25 > {: m > 10652 = 9567 + 1085 > > BTW, could anyone come up with the answer for the problem within 10 > secs on a modern PC? > > 2007/9/21, June Kim <[EMAIL PROTECTED]>: > > Thanks for the interesting solution, but it can't solve the most > > well-known verbal arithmetic equation: > > > > money=: ans 'send + more = money' > > |limit error: ans > > | money=: ans'send + more = money' > > > > What is "limit error"? > > > > 2007/9/19, Raul Miller <[EMAIL PROTECTED]>: > > > It occurred to me that it would be useful for this > > > digit problem solving verb to allow the user to > > > see answers for partially worked-out cases. > > > > > > This is a relatively simple change, but it changes some > > > of the underlying assumptions. Also, after this change, > > > I see only two solutions for 'four = 4 * one' because it > > > excludes all solutions where a letter stands for the digit > > > four. > > > > > > Anyways, here's the variant approach: > > > > > > require'stats strings' > > > sub=: ~.@(#~ e.&(a.{~,65 97+/i.26)) > > > dgt=: '0123456789'&-. > > > dgs=: dgt {~ [EMAIL PROTECTED]@sub ,/@({"1/) [EMAIL PROTECTED] comb > > > [EMAIL PROTECTED] > > > pos=: (sub ,/@,."1 dgs) charsub"1 ] > > > ans=: (". # ])@pos > > > > > > -- > > > Raul > > > ------------------------------------------------------------- > --------- > > > For information about J forums see > http://www.jsoftware.com/forums.htm> > > > > ----------------------------------------------------------------- > ----- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
