3rd grade math problem My niece asked me to help her with a problem, since she and her parents couldn't figure it out.
The question was:
abcde - fghi = 42137
with a-i being 1-9 (so for example 12345 - 6789), with each digit appearing once.
I had no idea how to do this intelligently, and wrote some code which brute-forced through all permutations of 1-9 and give me the results ((43726, 1589),(43789, 1652),(47326, 5189),(47398, 5261)).
How would I go about this as a 9 year old student who cannot code this? Just trial and error?
All we could really say is that the first digit is a 4 or 5, but thats it, aside from that it was just trying, and at some point I was so pissed with that task I wrote code to deal with it.
 A: If $abcde-fghi=42137$, then (supposing no carrying operations are expected of the student) $e$ and $i$ must be either $8$ and $1$ or $9$ and $2$. Suppose they are $9$ and $2$. Then we have $\{1,3,4,5,6,7,8\}$ remaining.
  Then $a$ must be $4$ as we've used the $9$. Remaining: $\{1,3,5,6,7,8\}$.
 Now we can use $8$ and $5$ in the spots of $d$ and $h$ to make $3$. Remaining: $\{1,3,6,7\}$.
Now we can use $7$ and $6$ for $c$ and $g$ to make $1$. Remaining: $\{1,3\}$.
And obviously, we can use $3$ and $1$ for $b$ and $f$ to make $2$.
So we have $43789 - 1652 = 42137$.
We got here more or less deductively from the initial assumptions --- the total number of 'guesses' I had to take was actually only two --- I guessed that we need to use $9$ and $2$ to make $7$ as opposed to $8$ and $1$, and I guessed the order in which I had to proceed. Note that there aren't that many integer combinations in this puzzle anyway.
It is, however, not a good problem --- if you really think about it and begin to consider the possibility of carrying operations being necessary, then it becomes much more intimidating. I don't think this is pedagogically useful in teaching math --- if anything, it teaches the student a haphazard trial-and-error approach, instead of cementing the foundations of deductive argument.
