January 30, 2011 at 9:16 pm (Monte Carlo)
Tags: MCMC, Metropolis, Metropolis-Hasting, Riddle, simulated annealing
Yesterday, while reading the last issue of the NewScientist, I came across the following very cute riddle:
Lazy, I asked myself if it were possible to write lines long Python code to solve this innocent looking enigma. The whole pyramid is entirely determined by the numbers lying at the bottom, and each one of them is an integer between and : these numbers must be different so that there are at most possibilities to test! Brute force won’t work my friend!
When stupid brute force does not work, one can still try annealing/probabilist methods: this works pretty well for Sudoku (which is NP-hard) as this is brilliantly described here and there. The principle is simple: if one can find a good energy function such that a solution to the problem corresponds to a low energy configuration, one can do MCMC-simulating annealing-etc on the target distribution
The issue is that it might be very difficult to choose a sensible energy function . Foolishly, I first tried the following energy function, and then ran a random walk Metropolis algorithm with as target probability:
where is the numbers of levels that one can fill, starting from the bottom, without encountering any problem no repetition and no number greater than . With different values of and letting run the algorithm for a few millions iterations ( min on my crappy laptop), one can easily produce configurations that are -levels high: but the algorithm never found any real solution a configuration with height equal to .
Now I am curious wether this is possible to produce a non-stupid energy function so that this riddle is solvable in a reasonable amount of time by standard MCMC – annealing methods.
As a conclusion, I should mention that with a pen and a cup of coffee, one can easily find a solution: I will not spoil the fun, but just say that the configuration space is not that big if one think more carefully about it…
June 6, 2010 at 12:44 pm (17x17 challenge, Monte Carlo, probability)
Tags: 17x17 challenge, MCMC, Monte Carlo, optimization, simulated annealing, William Gasarch
Have you already heard about the 17×17 Challenge ? It all started 7 months ago, and still no solution has been found. I have the feeling though that no really serious attempt at solving the problem has been done, even if very encouraging results have been found. It could be very interesting to keep track of the progress made so that results will be published here. Send what you have reached so far!
In the next few weeks, I will try to write about the Monte Carlo approaches described in the excellent book “Monte Carlo Strategies in Scientific Computing” by Jun Liu: I do not think that one can easily solve the problem with a direct implementation of these methods, but I want to know more about it. These are all more or less Markov Chain Monte Carlo Methods: I have tried the “parallel tempering” method, which gives results that are not that bad, and was planning to check the “flat histogram” method. “Simulated annealing” methods have succesfully been used to solve the Sudoku problem though: see Christian Robert blog for example. I am also planning to continue my reading of the fascinating book “Information, Physics, and Computation” by Marc Mezard: methods described in this book (belief propagation, k-SAT problem, etc…) are more adapted to the 17×17 challenge I think, and I am quite optimistic about it.
Best Solution so far, by Rohan Puttagunta: only 4 monochromatic rectangles!
Read also here,here,here,here and there – and have a try with this on-line simulator !