Thursday 27 August 2009

Science is cool- part 2

I am beginning to enjoy this even more and moreeeee! Got around the generation problem, wrote another couple of pretty standard procedures (e.g. finding the size of the largest connected component) and now to the pen-and-paper job. After two whole days of “hm, how do you describe love with an equation” I finally got to an answer, and we all believe it is correct! It is a system of 6 non-linear simultaneous equations, which , unfortunately, proved to be analytically intractable. Again, I went to consult a specialist, and he recommended the Broyden method, which supposedly generalises the secant method for N-dimentional space. Without going into too much detail, it is supposed to find a solution relatively quickly. However, with some manual work the system is easily reduced to 2 equations, and given the limited domain of the variables ( [0;1], since they are probabilities ), made me think GUESSING is the best option. Even if I had to linearly iterate over all possible combinations of value, it would still take only a million steps (for accuracy of three decimal places), which on a modern computer is...well, insignificant! Of course, being an AI-engineer-to-be, this is not a satisfactory approach, so I went for a technique called simulated annealing. In a nutshell, this is a very basic genetic algorithm inspired by metallurgy and chemistry(look it up yourselves, it takes less time to code than to explain how and why it works).

Next time- a programmer's reflections on software design.

No comments:

Post a Comment