/* From Muhammad Zain Sarwar: "Only High-IQ Minds Can Solve This Missing Numbers Puzzle!" https://medium.com/puzzle-sphere/only-high-iq-minds-can-solve-this-missing-numbers-puzzle-0012300b0199 """ Find the missing numbers 37 48 ? 64 67 35 27 19 20 84 72 ? 57 53 62 """ After solved it manually, I'm trying to see if this can be solve by symbolic regression. There are two principal approaches one can do: - focus on rows - focus on column For fun, let's start with rows. There are three rows with full data so we model this. But no solution was found after some minutes (which would have surprised me). So let's focus on the column (which happens to be the correct/intended approach). This (D-C) is not the complete solution to the problem, but is a hint. The result is also not really relevant since the 0s dummy values is not the correct input. AllGood: [program = D - C,res = -20,count = 106] [program = A - B + D,res = -35,count = 98] [program = D + (A - B),res = -35,count = 93] [program = A + D - B,res = -35,count = 61] [program = D * 1 - C,res = -20,count = 27] [program = D - B + (B - C),res = -20,count = 27] [program = A + (D - B),res = -35,count = 21] [program = D - B + A,res = -35,count = 15] [program = A - B + D * 1,res = -35,count = 15] [program = D * 1 + (A - B),res = -35,count = 3] resultMap = [-35 = 7,-20 = 3] So, the last value has something to do with the difference of D - C. Also, there is A+D-B. Is that relvant? */ /* data(missing_number3_rows,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- Data = [ [[64,67],35], [[27,19],20], [[57,53],62] ], Ops = [+,-,*,/,pow2,pow3,pow4], Constants = 1..10, Vars = ['A','B'], Unknown = [37,48], MaxSize = 11, Params = new_map([ init_size=1000, num_gens=1, show_only_good=false ]). */ data(missing_number3_columns,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- Data = [ [[37,64,27,84],57], [[48,67,19,72],53] ], Ops = [+,-,*,/,pow2,pow3,pow4], Constants = 1..10, Vars = "ABCD", Unknown = [0,35,20,0], % Set the unknown to 0 MaxSize = 11, Params = new_map([ init_size=1000, num_gens=100, show_only_good=false ]).