in reply to Brute force perl
0: 4-4 1: 4/4 2: 4/4+4/4 3: 4-4/4 4: 4 ...
The minimum length of these expressions would make an easy fitness function if you wanted to experiment with GA.
I originally heard this problem as a math-golf-type challenge to a fifth and sixth grade math club.
I don't remember the algorithm that I ended up using, but I do recall writing a generator that created valid expressions, so that the code wouldn't try to eval things like 4-( as an expression.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Brute force perl
by jdporter (Paladin) on Jun 12, 2007 at 20:18 UTC |