So especially in the previous section, you've seen that we can use fitting procedures to describe very
complicated physical problems and to understand then what is going on and to do this, we have formulated
a lot of the function.
We have then formulated an oral function between the data and our model function.
And then we used the so-called gradient descent methods to minimize this error until we had the perfect
fit.
However, it turns out that when you have many objects, for example, in the previous section, many
of these oscillators, then it takes an enormous amount of time to really do this gradient descent and
to minimize the error in this way.
So instead, a different approach would be to not use gradient descent, so not just update the parameters
along the gradient direction, but instead to use randomness.
So it means we randomly change one of the parameters.
And if this change reduces the error function, then it's considered a good change and it is accepted.
However, when the change increases the energy, it's considered a bad change and then it will just
be disregarded.
So it means that we use randomness to gain knowledge, and this is really the idea of Monte Carlo simulations.
So really exploiting randomness and luck, and we will start with a very simple and mathematical example.
We will approximate the value of PI by basically placing random points in a square.
And then we're counting how many points are inside of a certain region, which is a circle and how many
points are outside.
And then we will turn to a physical problem that we will simulate the collective behavior of a magnet.
So you see, a magnet consists of individual tiny magnets.
And all of these magnets can point along all three directions in space, and they interact with each
other.
So it means when you try to minimize here or error, then it really takes an enormous amount of time.
So instead, you minimize the error by just randomly reorienting individual magnets and checking if
the error has reduced.
And if this is the case, then you accept the chain to change.
And if not, then you disregard the change.
And we will really try this for this magnet and we will see that it brings about a lot of advantages.