#
# https://medium.com/@themahfujur/31-can-you-solve-this-math-problem-3a88655ee706
# """
# If 4 + 2 = 26, 8 + 1 = 79, 6 + 5 = 111, then what is 7 + 3 = ?
# """
#
# I.e.
#  4 + 2 = 26
#  8 + 1 = 79
#  6 + 5 = 111
#  7 + 3 = ?
#
# The "natural" solution is 410
# 4-2 = 2, 4+2 = 6 -> 26
# 8-1 = 7, 8+1 = 9 -> 79
# 6-5 = 1, 6+5 = 11 -> 1 11 -> 111
# 7-3 = 4, 7+3 = 10 -> 4 10 -> 410
#
# Interesting:
# When I encode the problem as the following (with "? ?"):
#   4 2 2 6
#   8 1 7 9
#   6 5 1 11
#   7 3 ? ?
# I got these solutions
#   (V1 + V2) - (V2 - V2)
# 7.0 3.0 -1.0    Result: 10.0 
#
# V2 + V1
#    7.0 3.0 -1.0    Result: 10.0
#
# V1 + (V1 - V3)
#   7.0 3.0 -1.0    Result: 15.0
#
# And that isn't really correct
#
# I then tested to change the problem a little
# (It's actually the problem I first solved, i.e.
#  thought that "111" was "11")
#
# 4 2 26
# 8 1 79
# 6 5 11
# 7 3 ?
#
# And then the result should be 40
#   i.e. 6+5=11 :  6-5 = 1, 6+5 = 11 mod 10 = 1 -> 11
# but it doesn't give any solution...
#
presentation: Equation
# num_input_variables: 4
# variable_names: a b c d x
# functions: Multiply,Add,Subtract,Divide
functions: Multiply,Add,Subtract,Divide,Modulo
# functions: Multiply,Divide,Add,Subtract,Sqrt,Pow
# functions: Multiply,Divide,Add,Subtract,Modulo
# functions: Multiply,Divide,Add,Subtract,Modulo,GreaterThan,LesserThan,IfElse,If,Equals,And,Or,Not,Xor
# Cheating?
# constant: 10.0
terminal_range: -100 100
terminal_wholenumbers: true
max_init_depth: 4
population_size: 1000
max_crossover_depth: 8
num_evolutions: 1000
max_nodes: 21
mutation_prob: 0.25
crossover_prob: 0.9
show_similiar: true
# show_population: true
# show_progression: true
show_results: true
stop_criteria_fitness: 0
data

# Original problem
# 4 2 26
# 8 1 79
# 6 5 111
# 7 3 ?

# Forcing solution:
# 4 2 26
# 8 1 79
# 6 5 111
# 7 3 410

# This is not a proper encoding
# (but interesting)
4 2 2 6
8 1 7 9
6 5 1 11
7 3 ? ?

# Simpler 111 -> 11 ?
# 4 2 26
# 8 1 79
# 6 5 11
# 7 3 ?
