David G. Andersen wrote:
> Thanks for the inspiration to improve my code a little more. :-)
 > [...]

This improved solution is nicely fast. However I have found one example 
where it doesn't find the closest solution:
(The code is as posted, I have only modified it to print out the time 
taken (in seconds).)

Dennis-Rankes-Computer:~/Desktop exo$ ./countdown2.rb -m 93475 3 7 17 29 
51 71
"(((71 * 51) - (17 + 7)) * (29 - 3))"
Itercount: 16504
2.082612
Dennis-Rankes-Computer:~/Desktop exo$ irb
irb(main):001:0> (((71*51)-(17+7))*(29-3))
=> 93522
irb(main):002:0> (((17*71)+7)*((29-3)+51))
=> 93478

The lower solution has been found by my code.