Jul 7, 2009, 06:58 AM
|
1
#1 of 21
|
How powerful is the scripting inside excel?
You can't solve this problem closed form, but you could solve this by setting it up as an optimization problem, and this one looks perfect for a genetic algorithm.
You want to minimize the difference between 94,204,280 and the sum of each of those numbers multiplied by an integer that is either 1 or 0. Those integers becomes the binary string that represents the "gene", and the algorithm takes a swarm of initial guesses, and mutates and "mates" them, keeping the best (as in the ones that produce the closest sum to 94,204,280) and moves on to the next generation.
There's a learning curve here, but it seems possible depending how powerful the scripting capability is in Excel. Keep in mind that genetic algorithms can be computationally intensive (though in this case, evaluation of the objective is just adding a bunch of numbers, so I wouldn't expect a problem), and that an interpreted language isn't always ideal for implementation of a numerical algorithm.
There are some tools out there that you can play around with if you want to try this.
Note: Goal Seek in excel is probably some kind of quasi-Newton gradient descent method. This is something that is also used for minimization problems, but it won't work here because the objective is nonlinear and discrete (as opposed to a continuous function).
How ya doing, buddy?
Slightly Dark -- updated weekly with rare out-of-print game music.
Last edited by Secret Squirrel; Jul 7, 2009 at 07:05 AM.
|