How do you substitute integers 0-9 in this equation to solve it?

303 Views Asked by At

The goal of the word math problem is to assign each letter an integer value, 0-9. Only one number per letter

Problem: WORMHOLE/IDIOT=HEM

Example: MAKE+KEYS=PSST
In this example: E=3, K+1, A=4, Y=5, S=7, T=0, M=8, and P=9

1

There are 1 best solutions below

0
On BEST ANSWER

Running this Matlab code, which takes a few minutes:

M=perms([0 1 2 3 4 5 6 7 8 9]);
lx=length(M)
for I=1:lx
    D=M(I,:);
    [w o r m h l e i d t]=deal(D(1),D(2),D(3),D(4),D(5),D(6),D(7),D(8),D(9),D(10));
    x=[w o r m h o l e]*[10000000;1000000;100000;10000;1000;100;10;1];
    y=[i d i o t]*[10000;1000;100;10;1];
    z=[h e m]*[100;10;1];
    if x==y*z
        x,y,z,D
    end
end

You realize that there is no solution for the problem.

The closest fits are:

wormhole       idiot         hem    wormhole-idiot*hem
60418093       72705         831         238
49538970       61692         803         294
43957382       60631         725         -93
42067298       53521         786        -208
41837160       59512         703         224
48765823       90981         536           7
32895210       64627         509          67
38697820       54581         709        -109
31876190       52514         607         192
25043581       79756         314         197
21473196       58510         367          26
17432790       85876         203         -38
10492078       36305         289         -67
 9183957       24296         378          69
 7485726       13179         568          54