Second Grade Homework Problem - Methodology

423 Views Asked by At

Ashamed to admit that I cannot aid my friend's niece with her second grade homework problem. So much for that college education, eh? Here's the problem.

Using only the natural numbers 1 through 9 without repeating any of them (natural because there cannot occur any rationals anywhere in this process, i.e. the first number cannot be prime, since otherwise there would be a fraction after the first operation), place the numbers in the boxes so that the following statement is true.

$\square \div \square \times \square + \square \times \square \times \square \div \square + \square \times \square = 100$

I am aware that I can use brute force to work this problem out, but this is going to be tedious at best, and might require a computer at worst. Furthermore, the problem doesn't specify anything about using the order of operations. On one hand, that would make sense, but on the other, this is a second grade problem in an American school, and I know that order of operations wasn't on my second grade curriculum.

In either case, does anyone know how to approach this in a somewhat elegant way? (Also apologies over tagging, someone please retag this appropriately if they think it isn't).

2

There are 2 best solutions below

1
On

I do have a suggestion for an algorithm that would reduce the cases to try. If I understand correctly that there isn't an operator precedence, but all operations are simply done left to right, then last thing you do is a multiplication. But $100 = 2 \times 2 \times 5 \times 5$. So the last box can only be 1, 2, 4 or 5. And so forth (handwaving!), i.e. use backtracking. But it's better than brute force for sure.

Ok, here are a few steps...

Assume $x_9 = 5$, for the last unknown (which is highest available value given what I said above about the factorization of 100). Then you want $y_8 = 20$, where $y_8$ is the result of all operations up to $x_8$, inclusively. So assume $x_8 = 9$ (again, the highest available value). Now you want $y_7 = 11$. This is where it gets a bit more "intuitive", or rather where you can eliminate some more candidates. You want a quotient of $11 = y_6 / x_7$. Note that you have 3 numbers that you need to multiply to produce $y_6$. So it needs at least three different factors in its factorization including 1. And two of these factors have to be single-digit. What could work? $22/2$, $33/3$? No! Because $22/2$ has already "used up" 2 for the division, so now you can't have it as $11 \times 2 \times 1$ because 2 would be duplicated. Likewise for $33/3$. So let's go for $44/4$, i.e. set $x_7$ to 4. Since $44=22 \times 2\times 1$, set $x_6 = 2$ and set $x_5 = 1$. Now $y_4=22$. Since 9 is used up, set $x_4=8$ so $y_3=22-8=14$. Then set $x_3=7$ as the next available number. All you need now is $y_2=14/7=2$. And luckily we can get that with the two numbers left, 6 and 3 by their division.

This is not entirely computer-driven backtracking, but close enough I hope (for one paragraph that I had the patience to write). So whoever downvoted this answer better explain yourself now why you did that.

N.B. I have "cheated" a little bit above, in that I actually forgot when I got to the quotient business that until there I had picked the default value (i.e. when I have no immediate clue what to choose) as the highest available digit. For the quotient I used the lowest and got to a solution. So what happens if I use the highest? Neither $88/8$ nor $77/7$ lead to a solution, although showing this is more involved for $88/8$ (there are several branches to backtrack from), but for $77/7$ it is as easy as it was for $22/2$ or $33/3$. So next try $66/6$. This ultimately leads to a solution but you have more cases to try as $33 \times 2 \times 1$ does not yield a solution, but $22 \times 3 \times 1$ does so again because 8 is free and so is 7, yielding $(22-8)/7=2$ and we've used up 6 and 3 this time, but 4 and 2 are available and their quotient is again 2.

So here you have two solutions obtained this way.

Looking at the other answer, its computer-generated list does show that there are no solutions for the last digit set to 1 (but there are some for 2). I can't think off the top of my head how to quickly eliminate the last-digit-1 branch, so if you instead start by using the lowest available digit as the default value, you'll probably be in a world of frustration for quite a while. There are also only two solution for the last digit 2, while the rest of 30 solutions are for 4 or 5 as last digit. So maybe there is some room for rational improvement to my method... like somehow inferring that 4 or 5 as last digit could/would yield a lot more solutions than 1 or 2 do, but I can't say right now how to infer that without actually trying-cases/backtracking; a proof of that without using backtracking might involve Ramsey theory... which would obviously be way inaccessible for the 2nd grade.

5
On

Assuming that the usual order of operations is to be ignored, there are precisely 32 solutions to your problem in which fractions do not appear in any intermediate step. Unfortunately, I have no idea how one might arrive at such a solution by hand; I produced these with an exhaustive computer search.

$$4\div2\times7+8\times1\times3\div6+9\times5=100$$ $$4\div2\times7+8\times3\times1\div6+9\times5=100$$ $$4\div2\times9+8\times1\times3\div6+7\times5=100$$ $$4\div2\times9+8\times3\times1\div6+7\times5=100$$ $$6\div2\times3+5\times1\times8\div7+9\times4=100$$ $$6\div2\times3+5\times8\times1\div7+9\times4=100$$ $$6\div2\times9+7\times1\times4\div8+3\times5=100$$ $$6\div2\times9+7\times4\times1\div8+3\times5=100$$ $$6\div3\times1+5\times2\times8\div7+9\times4=100$$ $$6\div3\times1+5\times8\times2\div7+9\times4=100$$ $$6\div3\times1+7\times2\times8\div9+4\times5=100$$ $$6\div3\times1+7\times8\times2\div9+4\times5=100$$ $$6\div3\times7+8\times1\times2\div4+9\times5=100$$ $$6\div3\times7+8\times2\times1\div4+9\times5=100$$ $$6\div3\times9+8\times1\times2\div4+7\times5=100$$ $$6\div3\times9+8\times2\times1\div4+7\times5=100$$ $$8\div2\times1+5\times3\times6\div9+7\times4=100$$ $$8\div2\times1+5\times6\times3\div9+7\times4=100$$ $$8\div2\times7+5\times1\times6\div9+3\times4=100$$ $$8\div2\times7+5\times6\times1\div9+3\times4=100$$ $$8\div4\times1+7\times3\times6\div9+2\times5=100$$ $$8\div4\times1+7\times6\times3\div9+2\times5=100$$ $$8\div4\times9+3\times1\times6\div7+2\times5=100$$ $$8\div4\times9+3\times6\times1\div7+2\times5=100$$ $$9\div3\times1+4\times2\times6\div7+8\times5=100$$ $$9\div3\times1+4\times6\times2\div7+8\times5=100$$ $$9\div3\times4+2\times1\times6\div7+8\times5=100$$ $$9\div3\times4+2\times6\times1\div7+8\times5=100$$ $$9\div3\times5+7\times1\times8\div4+6\times2=100$$ $$9\div3\times5+7\times8\times1\div4+6\times2=100$$ $$9\div3\times6+8\times1\times2\div4+7\times5=100$$ $$9\div3\times6+8\times2\times1\div4+7\times5=100$$