A 3rd grade math problem: fill in blanks with numbers to obtain a valid equation

Solution 1:

I assume that (as usual in this type of problem) the operations are executed left toright (not by arithemtic priority). Here are the solutions:

  • [9, 4, 8, 6, 7, 3, 1, 2, 5]: $9+13=22$, $22\times 4=88$, $88:8=11$, $11+6=17$, $17+12=29$, $29\times 7=203$, $203-3=200$, $200-11=189$, $189+1=190$, $190\times 2=380$, $380:5=76$, $76-10=66$.
  • [9, 7, 2, 8, 4, 3, 6, 1, 5]
  • [9, 6, 3, 8, 5, 7, 2, 1, 4]
  • [9, 1, 4, 8, 2, 7, 5, 6, 3]
  • [9, 5, 3, 8, 1, 2, 7, 6, 4]
  • [9, 2, 4, 7, 8, 6, 5, 1, 3]
  • [9, 3, 2, 4, 8, 7, 6, 1, 5]
  • [9, 3, 2, 7, 6, 5, 8, 1, 4]
  • [9, 5, 3, 7, 1, 2, 8, 6, 4]
  • [9, 4, 3, 5, 2, 1, 8, 6, 7]
  • [9, 3, 2, 6, 1, 7, 5, 8, 4]
  • [9, 3, 2, 5, 1, 7, 6, 8, 4]
  • [8, 9, 7, 1, 4, 2, 5, 3, 6]
  • [7, 9, 8, 5, 6, 2, 4, 1, 3]
  • [7, 9, 4, 8, 6, 2, 3, 1, 5]
  • [7, 9, 5, 8, 3, 6, 1, 2, 4]
  • [2, 9, 4, 3, 8, 6, 7, 1, 5]
  • [7, 9, 5, 6, 1, 8, 3, 4, 2]
  • [7, 9, 5, 3, 1, 8, 6, 4, 2]
  • [1, 9, 7, 5, 2, 8, 6, 4, 3]
  • [1, 9, 7, 3, 5, 8, 6, 2, 4]
  • [3, 9, 6, 5, 4, 8, 7, 1, 2]
  • [6, 9, 3, 1, 4, 8, 5, 2, 7]
  • [1, 9, 3, 7, 2, 5, 8, 4, 6]
  • [1, 9, 6, 2, 3, 7, 8, 4, 5]
  • [4, 9, 3, 2, 6, 7, 8, 1, 5]
  • [3, 9, 4, 6, 5, 1, 8, 2, 7]
  • [2, 9, 5, 7, 1, 3, 6, 8, 4]
  • [2, 9, 5, 6, 1, 3, 7, 8, 4]
  • [7, 9, 5, 6, 3, 1, 2, 4, 8]
  • [1, 9, 7, 2, 5, 3, 6, 4, 8]
  • [8, 6, 9, 7, 5, 3, 1, 2, 4]
  • [8, 3, 9, 5, 7, 6, 1, 2, 4]
  • [8, 6, 9, 5, 2, 1, 7, 4, 3]
  • [8, 5, 9, 3, 6, 4, 7, 1, 2]
  • [8, 1, 9, 3, 4, 2, 7, 6, 5]
  • [8, 6, 9, 3, 5, 2, 1, 4, 7]
  • [8, 5, 9, 1, 4, 2, 3, 6, 7]
  • [5, 4, 9, 1, 8, 7, 2, 3, 6]
  • [5, 4, 9, 1, 6, 8, 7, 2, 3]
  • [5, 4, 9, 3, 7, 6, 8, 1, 2]
  • [5, 1, 9, 3, 7, 2, 8, 4, 6]
  • [5, 6, 9, 7, 1, 4, 3, 8, 2]
  • [5, 4, 9, 7, 1, 3, 6, 8, 2]
  • [5, 6, 9, 3, 1, 4, 7, 8, 2]
  • [5, 4, 9, 6, 1, 3, 7, 8, 2]
  • [5, 1, 9, 2, 3, 6, 7, 8, 4]
  • [5, 4, 9, 1, 3, 2, 7, 8, 6]
  • [5, 1, 9, 2, 4, 3, 7, 8, 6]
  • [7, 3, 9, 4, 5, 2, 1, 6, 8]
  • [5, 7, 9, 1, 6, 2, 3, 4, 8]
  • [2, 6, 9, 1, 7, 3, 5, 4, 8]
  • [8, 1, 7, 9, 2, 4, 5, 6, 3]
  • [8, 4, 3, 9, 5, 7, 1, 2, 6]
  • [8, 1, 3, 9, 5, 2, 6, 4, 7]
  • [2, 8, 4, 9, 1, 7, 5, 6, 3]
  • [5, 8, 6, 9, 1, 3, 7, 4, 2]
  • [7, 6, 8, 9, 2, 5, 1, 4, 3]
  • [5, 2, 4, 9, 8, 7, 6, 1, 3]
  • [3, 1, 4, 9, 8, 6, 7, 2, 5]
  • [7, 1, 3, 9, 6, 8, 5, 2, 4]
  • [7, 1, 4, 9, 2, 8, 5, 6, 3]
  • [5, 7, 6, 9, 4, 8, 3, 1, 2]
  • [1, 7, 6, 9, 3, 8, 2, 4, 5]
  • [5, 1, 6, 9, 7, 8, 3, 2, 4]
  • [5, 4, 1, 9, 3, 8, 6, 2, 7]
  • [4, 6, 3, 9, 7, 2, 8, 1, 5]
  • [5, 1, 3, 9, 6, 7, 8, 2, 4]
  • [5, 4, 3, 9, 6, 1, 8, 2, 7]
  • [7, 3, 6, 9, 1, 5, 4, 8, 2]
  • [7, 3, 4, 9, 2, 5, 1, 8, 6]
  • [2, 7, 6, 9, 1, 4, 5, 8, 3]
  • [2, 6, 3, 9, 1, 7, 5, 8, 4]
  • [5, 3, 2, 9, 1, 6, 7, 8, 4]
  • [7, 1, 3, 9, 6, 5, 2, 4, 8]
  • [7, 3, 1, 9, 2, 5, 6, 4, 8]
  • [8, 1, 7, 3, 9, 5, 6, 2, 4]
  • [8, 4, 7, 3, 9, 5, 1, 2, 6]
  • [8, 4, 6, 5, 9, 3, 1, 2, 7]
  • [7, 4, 8, 5, 9, 6, 2, 1, 3]
  • [7, 2, 8, 1, 9, 4, 5, 3, 6]
  • [3, 4, 8, 7, 9, 5, 1, 2, 6]
  • [7, 2, 6, 8, 9, 5, 4, 1, 3]
  • [7, 1, 3, 8, 9, 5, 4, 2, 6]
  • [3, 6, 4, 8, 9, 7, 2, 1, 5]
  • [3, 1, 6, 8, 9, 7, 4, 2, 5]
  • [7, 6, 4, 2, 9, 8, 3, 1, 5]
  • [3, 7, 6, 5, 9, 8, 2, 1, 4]
  • [1, 5, 7, 4, 9, 3, 8, 2, 6]
  • [5, 1, 6, 3, 9, 7, 8, 2, 4]
  • [3, 2, 6, 1, 9, 7, 5, 4, 8]
  • [2, 1, 5, 3, 9, 6, 7, 4, 8]
  • [1, 8, 6, 7, 3, 9, 2, 4, 5]
  • [6, 8, 4, 5, 3, 9, 7, 1, 2]
  • [7, 5, 8, 4, 2, 9, 1, 6, 3]
  • [7, 2, 5, 1, 8, 9, 4, 3, 6]
  • [1, 2, 7, 5, 8, 9, 4, 3, 6]
  • [3, 5, 2, 7, 8, 9, 4, 1, 6]
  • [1, 4, 7, 5, 2, 9, 8, 6, 3]
  • [1, 4, 3, 7, 2, 9, 8, 6, 5]
  • [2, 1, 5, 3, 7, 9, 8, 4, 6]
  • [2, 7, 3, 6, 1, 9, 5, 8, 4]
  • [2, 7, 3, 5, 1, 9, 6, 8, 4]
  • [3, 7, 2, 5, 1, 9, 4, 8, 6]
  • [3, 7, 2, 4, 1, 9, 5, 8, 6]
  • [1, 4, 7, 5, 3, 9, 2, 8, 6]
  • [6, 3, 4, 7, 2, 9, 1, 8, 5]
  • [4, 1, 6, 7, 3, 9, 2, 8, 5]
  • [5, 1, 6, 2, 3, 9, 7, 8, 4]
  • [2, 5, 6, 4, 3, 9, 1, 8, 7]
  • [6, 2, 1, 5, 3, 9, 7, 4, 8]
  • [8, 1, 7, 5, 6, 4, 9, 2, 3]
  • [5, 8, 6, 7, 1, 3, 9, 4, 2]
  • [2, 8, 4, 5, 1, 7, 9, 6, 3]
  • [1, 7, 8, 6, 4, 5, 9, 2, 3]
  • [3, 6, 8, 7, 5, 1, 9, 2, 4]
  • [1, 6, 7, 8, 2, 5, 9, 4, 3]
  • [2, 1, 5, 8, 6, 3, 9, 4, 7]
  • [2, 1, 6, 3, 8, 5, 9, 4, 7]
  • [2, 6, 5, 4, 7, 8, 9, 1, 3]
  • [7, 3, 6, 4, 1, 5, 9, 8, 2]
  • [7, 2, 5, 1, 3, 4, 9, 8, 6]
  • [2, 7, 6, 5, 1, 4, 9, 8, 3]
  • [1, 3, 7, 5, 2, 6, 9, 8, 4]
  • [1, 2, 7, 5, 3, 4, 9, 8, 6]
  • [5, 3, 2, 7, 1, 6, 9, 8, 4]
  • [2, 6, 3, 5, 1, 7, 9, 8, 4]
  • [5, 2, 4, 1, 3, 7, 9, 8, 6]
  • [3, 5, 4, 1, 2, 7, 9, 8, 6]
  • [4, 5, 1, 7, 3, 6, 9, 2, 8]
  • [7, 4, 6, 8, 1, 2, 5, 9, 3]
  • [7, 4, 6, 5, 1, 2, 8, 9, 3]
  • [8, 7, 3, 1, 2, 4, 5, 6, 9]
  • [8, 2, 1, 7, 3, 6, 5, 4, 9]
  • [8, 2, 1, 6, 3, 5, 7, 4, 9]
  • [1, 8, 7, 2, 6, 3, 5, 4, 9]
  • [1, 8, 4, 7, 5, 2, 6, 3, 9]
  • [5, 8, 3, 1, 2, 4, 7, 6, 9]
  • [3, 7, 8, 5, 4, 1, 2, 6, 9]
  • [7, 1, 2, 8, 6, 3, 5, 4, 9]
  • [7, 2, 1, 8, 4, 6, 5, 3, 9]
  • [1, 4, 2, 8, 5, 7, 6, 3, 9]
  • [3, 1, 4, 8, 5, 2, 7, 6, 9]
  • [5, 7, 4, 1, 8, 6, 3, 2, 9]
  • [2, 1, 3, 6, 8, 7, 5, 4, 9]
  • [7, 1, 2, 4, 5, 8, 3, 6, 9]
  • [4, 6, 1, 7, 2, 8, 5, 3, 9]
  • [1, 2, 4, 7, 5, 8, 3, 6, 9]
  • [2, 3, 5, 6, 7, 8, 1, 4, 9]
  • [4, 6, 1, 5, 2, 7, 8, 3, 9]
  • [2, 7, 6, 4, 3, 5, 1, 8, 9]
  • [2, 1, 6, 4, 5, 3, 7, 8, 9]

Solution 2:

There is 1 equation and 9 unknowns, the problem is we have an underdetermined system: http://en.wikipedia.org/wiki/Underdetermined_system.

The only relationship we know (in the typical phrasing of the question) is that they all belong to the set [1...9] and are mutually exclusive. While all solutions can be found using brute force (with a program), I don't believe there is a mathematical way to prove or derive the existence of any solutions since the placement of any number impacts the choices for the remaining numbers and the information is too limited. We know without brute forcing that the system has at most a limited number of solutions. We know from running programs (only after the fact) that the puzzle is consistent and has solutions.

a + d - f + 12*e + 13*b/c + g*h/j = 87

The values of a and d are interchangeable, as are g and h. It does not help us with the problem, but it does show that if at least 1 solution exists, then more than 1 solution must exist; specifically, if you find 1 it has 4 variants since some of the math is commutative.

Solution 3:

There are 136 solutions for this:

126478359 1 2 6 4 7 8 3 5 9 66

126478539 1 2 6 4 7 8 5 3 9 66

132458796 1 3 2 4 5 8 7 9 6 66

132458976 1 3 2 4 5 8 9 7 6 66

132956478 1 3 2 9 5 6 4 7 8 66

132956748 1 3 2 9 5 6 7 4 8 66

134765298 1 3 4 7 6 5 2 9 8 66

134765928 1 3 4 7 6 5 9 2 8 66

136279458 1 3 6 2 7 9 4 5 8 66

136279548 1 3 6 2 7 9 5 4 8 66

139478256 1 3 9 4 7 8 2 5 6 66

139478526 1 3 9 4 7 8 5 2 6 66

148279356 1 4 8 2 7 9 3 5 6 66

148279536 1 4 8 2 7 9 5 3 6 66

152348796 1 5 2 3 4 8 7 9 6 66

152348976 1 5 2 3 4 8 9 7 6 66

152847396 1 5 2 8 4 7 3 9 6 66

152847936 1 5 2 8 4 7 9 3 6 66

153942786 1 5 3 9 4 2 7 8 6 66

153942876 1 5 3 9 4 2 8 7 6 66

183745269 1 8 3 7 4 5 2 6 9 66

183745629 1 8 3 7 4 5 6 2 9 66

196458372 1 9 6 4 5 8 3 7 2 66

196458732 1 9 6 4 5 8 7 3 2 66

196752348 1 9 6 7 5 2 3 4 8 66

196752438 1 9 6 7 5 2 4 3 8 66

214379568 2 1 4 3 7 9 5 6 8 66

214379658 2 1 4 3 7 9 6 5 8 66

236179458 2 3 6 1 7 9 4 5 8 66

236179548 2 3 6 1 7 9 5 4 8 66

248179356 2 4 8 1 7 9 3 5 6 66

248179536 2 4 8 1 7 9 5 3 6 66

269851473 2 6 9 8 5 1 4 7 3 66

269851743 2 6 9 8 5 1 7 4 3 66

286941573 2 8 6 9 4 1 5 7 3 66

286941753 2 8 6 9 4 1 7 5 3 66

296351478 2 9 6 3 5 1 4 7 8 66

296351748 2 9 6 3 5 1 7 4 8 66

314279568 3 1 4 2 7 9 5 6 8 66

314279658 3 1 4 2 7 9 6 5 8 66

321547896 3 2 1 5 4 7 8 9 6 66

321547986 3 2 1 5 4 7 9 8 6 66

324851796 3 2 4 8 5 1 7 9 6 66

324851976 3 2 4 8 5 1 9 7 6 66

328651794 3 2 8 6 5 1 7 9 4 66

328651974 3 2 8 6 5 1 9 7 4 66

352148796 3 5 2 1 4 8 7 9 6 66

352148976 3 5 2 1 4 8 9 7 6 66

364958172 3 6 4 9 5 8 1 7 2 66

364958712 3 6 4 9 5 8 7 1 2 66

392815674 3 9 2 8 1 5 6 7 4 66

392815764 3 9 2 8 1 5 7 6 4 66

396251478 3 9 6 2 5 1 4 7 8 66

396251748 3 9 6 2 5 1 7 4 8 66

426178359 4 2 6 1 7 8 3 5 9 66

426178539 4 2 6 1 7 8 5 3 9 66

432158796 4 3 2 1 5 8 7 9 6 66

432158976 4 3 2 1 5 8 9 7 6 66

439178256 4 3 9 1 7 8 2 5 6 66

439178526 4 3 9 1 7 8 5 2 6 66

496158372 4 9 6 1 5 8 3 7 2 66

496158732 4 9 6 1 5 8 7 3 2 66

512967348 5 1 2 9 6 7 3 4 8 66

512967438 5 1 2 9 6 7 4 3 8 66

521347896 5 2 1 3 4 7 8 9 6 66

521347986 5 2 1 3 4 7 9 8 6 66

531726894 5 3 1 7 2 6 8 9 4 66

531726984 5 3 1 7 2 6 9 8 4 66

541927386 5 4 1 9 2 7 3 8 6 66

541927836 5 4 1 9 2 7 8 3 6 66

548967132 5 4 8 9 6 7 1 3 2 66

548967312 5 4 8 9 6 7 3 1 2 66

572839164 5 7 2 8 3 9 1 6 4 66

572839614 5 7 2 8 3 9 6 1 4 66

593621784 5 9 3 6 2 1 7 8 4 66

593621874 5 9 3 6 2 1 8 7 4 66

628351794 6 2 8 3 5 1 7 9 4 66

628351974 6 2 8 3 5 1 9 7 4 66

631925784 6 3 1 9 2 5 7 8 4 66

631925874 6 3 1 9 2 5 8 7 4 66

693521784 6 9 3 5 2 1 7 8 4 66

693521874 6 9 3 5 2 1 8 7 4 66

714965238 7 1 4 9 6 5 2 3 8 66

714965328 7 1 4 9 6 5 3 2 8 66

728965134 7 2 8 9 6 5 1 3 4 66

728965314 7 2 8 9 6 5 3 1 4 66

731526894 7 3 1 5 2 6 8 9 4 66

731526984 7 3 1 5 2 6 9 8 4 66

732859164 7 3 2 8 5 9 1 6 4 66

732859614 7 3 2 8 5 9 6 1 4 66

734165298 7 3 4 1 6 5 2 9 8 66

734165928 7 3 4 1 6 5 9 2 8 66

752849136 7 5 2 8 4 9 1 3 6 66

752849316 7 5 2 8 4 9 3 1 6 66

764859132 7 6 4 8 5 9 1 3 2 66

764859312 7 6 4 8 5 9 3 1 2 66

783145269 7 8 3 1 4 5 2 6 9 66

783145629 7 8 3 1 4 5 6 2 9 66

796152348 7 9 6 1 5 2 3 4 8 66

796152438 7 9 6 1 5 2 4 3 8 66

824351796 8 2 4 3 5 1 7 9 6 66

824351976 8 2 4 3 5 1 9 7 6 66

832759164 8 3 2 7 5 9 1 6 4 66

832759614 8 3 2 7 5 9 6 1 4 66

852147396 8 5 2 1 4 7 3 9 6 66

852147936 8 5 2 1 4 7 9 3 6 66

852749136 8 5 2 7 4 9 1 3 6 66

852749316 8 5 2 7 4 9 3 1 6 66

864759132 8 6 4 7 5 9 1 3 2 66

864759312 8 6 4 7 5 9 3 1 2 66

869251473 8 6 9 2 5 1 4 7 3 66

869251743 8 6 9 2 5 1 7 4 3 66

872539164 8 7 2 5 3 9 1 6 4 66

872539614 8 7 2 5 3 9 6 1 4 66

892315674 8 9 2 3 1 5 6 7 4 66

892315764 8 9 2 3 1 5 7 6 4 66

912567348 9 1 2 5 6 7 3 4 8 66

912567438 9 1 2 5 6 7 4 3 8 66

914765238 9 1 4 7 6 5 2 3 8 66

914765328 9 1 4 7 6 5 3 2 8 66

928765134 9 2 8 7 6 5 1 3 4 66

928765314 9 2 8 7 6 5 3 1 4 66

931625784 9 3 1 6 2 5 7 8 4 66

931625874 9 3 1 6 2 5 8 7 4 66

932156478 9 3 2 1 5 6 4 7 8 66

932156748 9 3 2 1 5 6 7 4 8 66

941527386 9 4 1 5 2 7 3 8 6 66

941527836 9 4 1 5 2 7 8 3 6 66

948567132 9 4 8 5 6 7 1 3 2 66

948567312 9 4 8 5 6 7 3 1 2 66

953142786 9 5 3 1 4 2 7 8 6 66

953142876 9 5 3 1 4 2 8 7 6 66

964358172 9 6 4 3 5 8 1 7 2 66

964358712 9 6 4 3 5 8 7 1 2 66

986241573 9 8 6 2 4 1 5 7 3 66

986241753 9 8 6 2 4 1 7 5 3 66

I used c++ and Excel to solve it.

Check the solution here:

https://github.com/jpruiz114/cpp-tests/tree/master/DevCppTest02

Solution 4:

I ask StackOverflow for a programmatic solution, turn out having 20 answer:

2015-05-20 01:44:23.568 Math[29526:3757225] a=3 b=2 c=1 d=5 e=4 f=7 g=8 h=9 i=6
2015-05-20 01:44:23.569 Math[29526:3757225] a=3 b=2 c=1 d=5 e=4 f=7 g=9 h=8 i=6
2015-05-20 01:44:24.074 Math[29526:3757225] a=5 b=2 c=1 d=3 e=4 f=7 g=8 h=9 i=6
2015-05-20 01:44:24.075 Math[29526:3757225] a=5 b=2 c=1 d=3 e=4 f=7 g=9 h=8 i=6
2015-05-20 01:44:24.127 Math[29526:3757225] a=5 b=3 c=1 d=7 e=2 f=6 g=8 h=9 i=4
2015-05-20 01:44:24.127 Math[29526:3757225] a=5 b=3 c=1 d=7 e=2 f=6 g=9 h=8 i=4
2015-05-20 01:44:24.162 Math[29526:3757225] a=5 b=4 c=1 d=9 e=2 f=7 g=3 h=8 i=6
2015-05-20 01:44:24.163 Math[29526:3757225] a=5 b=4 c=1 d=9 e=2 f=7 g=8 h=3 i=6
2015-05-20 01:44:24.290 Math[29526:3757225] a=5 b=9 c=3 d=6 e=2 f=1 g=7 h=8 i=4
2015-05-20 01:44:24.290 Math[29526:3757225] a=5 b=9 c=3 d=6 e=2 f=1 g=8 h=7 i=4
2015-05-20 01:44:24.381 Math[29526:3757225] a=6 b=3 c=1 d=9 e=2 f=5 g=7 h=8 i=4
2015-05-20 01:44:24.381 Math[29526:3757225] a=6 b=3 c=1 d=9 e=2 f=5 g=8 h=7 i=4
2015-05-20 01:44:24.548 Math[29526:3757225] a=6 b=9 c=3 d=5 e=2 f=1 g=7 h=8 i=4
2015-05-20 01:44:24.548 Math[29526:3757225] a=6 b=9 c=3 d=5 e=2 f=1 g=8 h=7 i=4
2015-05-20 01:44:24.630 Math[29526:3757225] a=7 b=3 c=1 d=5 e=2 f=6 g=8 h=9 i=4
2015-05-20 01:44:24.630 Math[29526:3757225] a=7 b=3 c=1 d=5 e=2 f=6 g=9 h=8 i=4
2015-05-20 01:44:25.115 Math[29526:3757225] a=9 b=3 c=1 d=6 e=2 f=5 g=7 h=8 i=4
2015-05-20 01:44:25.115 Math[29526:3757225] a=9 b=3 c=1 d=6 e=2 f=5 g=8 h=7 i=4
2015-05-20 01:44:25.143 Math[29526:3757225] a=9 b=4 c=1 d=5 e=2 f=7 g=3 h=8 i=6
2015-05-20 01:44:25.143 Math[29526:3757225] a=9 b=4 c=1 d=5 e=2 f=7 g=8 h=3 i=6
2015-05-20 01:44:25.294 Math[29526:3757225] Result: 20 correct / 362880 total 

Not sure how it will look like as a mathematic problem.