Algebra problem stumping me I have recently run into an algebra problem that goes as follows.
Using the digits $1$ to $9$,
$$
\left\{
\begin{align}
    A + B + C + D &= EF \\
    E + F + G + H &= CJ \\
    B + G + J     &= ?D \\
    \text{total} &= B?
\end{align}
\right.
$$
also $A-H > F$
where each letter is a different unique number.
I believe when it says $EF$ it does not mean $E \cdot F$, but more like if answer was $15$, $E = 1$ and $F = 5$ sort of thing.
Been working on this for hours, even attempted to write a computer program to help solve but to no avail.
Any tips on how to solve (or a work through of it) would be greatly appreciated.
 A: Assumptions:


*

*"$EF$" means $10\cdot E+F$

*$total$ means $EF+CJ+xD+By$


Using Mathematica:
Input:
Reduce[a+b+c+d==e*10+f
    && e+f+g+h==c*10+j
    && b+g+j ==x*10+d
    && 10*(e+c+x)+(f+j+d)==b*10+y
    && a-h>f
    && (a|b|c|d|e|f|g|h|j|x|y) \[Element] Integers
    && 1<=a<=9
    && 1<=b<=9
    && 1<=c<=9
    && 1<=d<=9
    && 1<=e<=9
    && 1<=f<=9
    && 1<=g<=9
    && 1<=h<=9
    && 1<=j<=9
    && 1<=x<=9
    && 1<=y<=9]

The output was 45 different possibilities.  Filtering for uniqueness left 1 solution:
(a==9 && b==5 && c==1 && d==8 && e==2 && f==3 && g==7 && h==4 && j==6 && x==1 && y==7)

Now that we know the right assumptions that lead to a unique solution ... who can show him how to solve it by hand?
A: Since you mentioned using a program, and the generalization of this problem is NP-complete anyway, here is the solution:
A:9 B:5 C:1 D:8 E:2 F:3 G:7 H:4 I:6 x:1 y:7

The "main part" of the code:
int main() {

  int digits = 9;
  int digit_array[digits];

  for (permutation_initialize(digit_array, digits, 1);
       permutation_finished  (digit_array, digits, 1);
       permutation_next      (digit_array, digits, 1)) {

    int a = digit_array[0];
    int b = digit_array[1];
    int c = digit_array[2];
    int d = digit_array[3];
    int e = digit_array[4];
    int f = digit_array[5];
    int g = digit_array[6];
    int h = digit_array[7];
    int j = digit_array[8];

    int sum1 = a + b + c + d;
    int sum2 = e + f + g + h;
    int sum3 = b + g + j;

    if (sum1 != 10*e + f) continue;
    if (sum2 != 10*c + j) continue;
    if (a - h <= f) continue;

    for (int x = 1; x <= 9; x++) {

      if (sum3 != 10*x + d) continue;
      if (((sum1 + sum2 + sum3) / 10) != b) continue;
      print_array(digit_array, digits);
      printf("x:%d y:%d\n", x, (sum1 + sum2 + sum3)%10);
   }
 }
 return 0;
}

I realize this is only comment worthy but it's too long, and hopefully it will help motivate due to the demonstration that there is a unique answer.
A: There are a number of ways to approach this. In the following I assume:
A,B,C,D,E,F,G,H,J are distinct from 1 to 9 and total refers to the sum of the previous equations.
The following Mathematica code firstly reduces the candidate partitions of Range[9] to achieve first two criteria then searches this reduced space for solutions.This is a little faster than looking through 362880 permutations.
ran = Range[9];
sub = Subsets[ran, {4}];
cand = Select[
   Select[Select[
     Select[Flatten[
       Map[Function[
         x, {#, x, Total@#, Total@x, Intersection[#, x]} & /@ sub], 
        sub], 1], Last@# == {} &], 
     Not[Or[IntegerDigits[#[[3]]][[2]] == 0, 
        IntegerDigits[#[[4]]][[2]] == 0]] &], 
    Length@Intersection[#[[2]], IntegerDigits[#[[3]]]] == 2 &],
   And[
     MemberQ[#[[1]], IntegerDigits[#[[4]]][[1]]], 
     Not[MemberQ[#[[1]], IntegerDigits[#[[4]]][[2]]]], 
     Not[MemberQ[#[[2]], IntegerDigits[#[[4]]][[2]]]]] &
   ];
fun[u_, v_, w_] := 
 Module[{pu, pv, a, b, c, d, e, f, g, h, j, r1, r2, r3, tp},
  pu = Permutations[u];
  pv = Permutations[v];
  r1 = Thread[{a, b, c, d} -> #] & /@ pu;
  r2 = Thread[{e, f, g, h} -> #] & /@ pv;
  r3 = {j -> IntegerDigits[w][[2]]};
  tp = Partition[Flatten[Tuples[{r1, r2, r3}]], 9];
  #[[All, 2]] & /@ 
   Union[Select[tp, 
     And[a + b + c + d == 10 e + f, e + f + g + h == 10 c + j, 
        b + g + j > 10, Mod[b + g + j, 10] == d, 
        IntegerPart[(a + b + c + d + e + f + g + h + b + g + j)/10] == 
         b] /. # &]]
  ]
arg = cand[[All, {1, 2, 4}]];
answers = Cases[fun @@ # & /@ arg, Except[{}]];
dat[x_] := 
 Join[x, {Total[x[[1 ;; 4]]], Total[x[[5 ;; 8]]], 
   x[[2]] + x[[7]] + x[[9]], 
   Total[{Total[x[[1 ;; 4]]], Total[x[[5 ;; 8]]], 
     x[[2]] + x[[7]] + x[[9]]}]}]
tab = Column[
  TableForm[#, 
     TableHeadings -> {None, {"a", "b", "c", "d", "e", "f", "g", "h", 
        "j", "c1", "c2", "c3", "c4"}}] & /@ Map[dat, answers, {2}]]

I apologize for the ugliness of the code.
It yields the following (where c1,c2,c3,c4 are the constraints of the puzzle, e.g. c1= A+B+C+D=EF}

Update
In light of the additional constraint mentioned in comment:


*

*cand selects two disjoint subsets of {1,2,3,...,9}of size 4 with the properties that the first subset sums to a two digit number whose digits are in the second subset and the sum of the digits in this second subset has first digit in first subset. 

*fun then evaluates candidate partitions and selects the order that satisfies the constraints. This is applied to relevant elements of cand

*dat is just a way to display solution and tab displays it.


In light of constraint A-H>F here is the trivially modified code:
ran = Range[9];
sub = Subsets[ran, {4}];
cand = Select[
   Select[Select[
     Select[Flatten[
       Map[Function[
         x, {#, x, Total@#, Total@x, Intersection[#, x]} & /@ sub], 
        sub], 1], Last@# == {} &], 
     Not[Or[IntegerDigits[#[[3]]][[2]] == 0, 
        IntegerDigits[#[[4]]][[2]] == 0]] &], 
    Length@Intersection[#[[2]], IntegerDigits[#[[3]]]] == 2 &],
   And[
     MemberQ[#[[1]], IntegerDigits[#[[4]]][[1]]], 
     Not[MemberQ[#[[1]], IntegerDigits[#[[4]]][[2]]]], 
     Not[MemberQ[#[[2]], IntegerDigits[#[[4]]][[2]]]]] &
   ];
fun[u_, v_, w_] := 
 Module[{pu, pv, a, b, c, d, e, f, g, h, j, r1, r2, r3, tp},
  pu = Permutations[u];
  pv = Permutations[v];
  r1 = Thread[{a, b, c, d} -> #] & /@ pu;
  r2 = Thread[{e, f, g, h} -> #] & /@ pv;
  r3 = {j -> IntegerDigits[w][[2]]};
  tp = Partition[Flatten[Tuples[{r1, r2, r3}]], 9];
  #[[All, 2]] & /@ 
   Union[Select[tp, 
     And[a + b + c + d == 10 e + f, e + f + g + h == 10 c + j, 
        b + g + j > 10, Mod[b + g + j, 10] == d, 
        IntegerPart[(a + b + c + d + e + f + g + h + b + g + j)/10] == 
         b, a - h > f] /. # &]]
  ]
arg = cand[[All, {1, 2, 4}]];
answers = Cases[fun @@ # & /@ arg, Except[{}]];
dat[x_] := 
 Join[x, {Total[x[[1 ;; 4]]], Total[x[[5 ;; 8]]], 
   x[[2]] + x[[7]] + x[[9]], 
   Total[{Total[x[[1 ;; 4]]], Total[x[[5 ;; 8]]], 
     x[[2]] + x[[7]] + x[[9]]}]}]
tab = Column[
  TableForm[#, 
     TableHeadings -> {None, {"a", "b", "c", "d", "e", "f", "g", "h", 
        "j", "c1", "c2", "c3", "c4"}}] & /@ Map[dat, answers, {2}]]

yielding the unique solution:

A: Solutions of this problem can be easily obtained in Mathematica.
It turns out that there is just one solution, as it should be for this type of puzzle.
The equations are
eq1 = a + b + c + d == 10 e + f;
eq2 = e + f + g + h == 10 c + j;
eq3 = b + g + j == 10 x + d;
eq4 = 10 e + f + 10 c + j + 10 x + d == 10 b + y;
eq5 = a - h == f + z;

Here we have modified the inequality to an equation eq5.
Notice that the auxiliary quantities x, y, and z are also decimal digits, but they are allowed to be equal to one of the main variables.
The condition of all variables being a decimal place is
dec = And @@ Thread[1 <= {a, b, c, d, e, f, g, h, j, x, y, z} <= 9];

The solution is obtained in a matter of seconds:
sol = Solve[Reduce[eq1 && eq2 && eq3 && eq4 && eq5 && dec, Integers]];
Length[sol]

(* Out[192]= 45 *)

Now we impose on these 45 tuples the condition that all main variables {a, ...,j} are pairwise different.
sel = Select[{a, b, c, d, e, f, g, h, j, x, y, z} /. sol, 
  Length[Union[Take[#, {1, 9}]]] == 9 &]

(* Out[187]= {{9, 5, 1, 8, 2, 3, 7, 4, 6, 1, 7, 2}} *)

This is the unique solution.
Writen in replacement format it becomes:
List @@ Inner[Rule, {a, b, c, d, e, f, g, h, j, x, y, z}, sel[[1]]]

(*
Out[188]= {a -> 9, b -> 5, c -> 1, d -> 8, e -> 2, f -> 3, g -> 7, h -> 4, j -> 6,  x -> 1, y -> 7, z -> 2}
*)

Observation
There are two obvious points in the code which can certainly be improved
1) the selection should be done immediately in the conditions to be fed into Reduce[]
2) The replacement form should have a more elegant form
