Wednesday, May 22, 2013

project euler problem 185

Number Mind

This is one of the best problems in the first 200 problems. I really like this problem.  But one thing I do not understand is that a lot of people solved it. Is it that simple?

This problem is very interesting and difficult.  One does not need to have any background knowledge to solve this problem. I could not find a solution for a long time. I googled a lot and found some discussion from other forums. One mentioned that genetic algorithm may be used to solve this problem.  I have no idea about genetic algorithm and found some knowledge in wikipedia. I followed the idea. I did not do well, but it was luckily solved in 2 to 3 minutes!

I reviewed the discussion. There are so many totally different approaches. I was surprised to find one from davy wybiral. He used some sort of simulated annealing algorithm. The run time is only two to three seconds! This is probably a rare problem that can be solved using random number algorithms

There are also a lot of other solutions. I want to understand hk's solution. But I do not know delphi. He solve the problem in 300 ms! What a pity!  There are also some other great algorithms. I will update this post when I learned more.


No comments:

Post a Comment