I'm mildly annoyed that they don't actually post the solution their algorithm found.
# Initialize it with the most we can need of any individual numbers, plus the maximum possible zero's we could use
# (Just picked 5, because it can't take more than 7, and we have at least 2 of everything. I know there are better ways of doing this, but I was just hacking something up quickly).
x = [2.15,2.75,3.35,3.55,4.2,5.8].map{|n| [n]*(15.05/n).to_i}.flatten + [0]*5
# Find all of the combinations that add up to 15.05
x.combination(7).select{|c| c.inject(:+)==15.05}.uniq
There are two answers to this. [2.15,2.15,2.15,2.15,2.15,2.15,2.15]
[2.15,3.55,3.55,5.80]That's one of the problems with Genetic Programming in general - you might get a specific program optimised to a specific problem, but you never learn anything about the problem space from it.