0% found this document useful (0 votes)
20 views6 pages

Reporte 2

The document discusses exploration and exploitation in optimization algorithms. Exploration searches for new solutions while exploitation refines known solutions. Keeping a balance between the two is important for finding the best solution. Code examples are provided to demonstrate a search method and probabilistic sampling of data sequences.

Uploaded by

diego.campos7896
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views6 pages

Reporte 2

The document discusses exploration and exploitation in optimization algorithms. Exploration searches for new solutions while exploitation refines known solutions. Keeping a balance between the two is important for finding the best solution. Code examples are provided to demonstrate a search method and probabilistic sampling of data sequences.

Uploaded by

diego.campos7896
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1

Homework 2
Diego Campos Peña
222978969

I. ESSAY
A. Introduction
When we talk about optimization algorithms, there are some crucial points to consider, for example,
exploration and exploitation. These two points are crucial in the search part, and this is what we want
to discuss in this document, the importance of this point to get a solution.
We can also see these two concepts in real life. For example, in animals, when they are hunting, they
use exploration and exploitation, even the human when looking for something lost like keys.
B. Body
Exploration is, basically, the process of the algorithm searching for new best solutions. So, we could
say that the synonymous of exploration is the search. This search is not limited to just one space search,
we can have many spaces as needed (another name could be domains: visual scenes, memory,
databases, etc.).
Diversity is another word very related to the search. It is impossible to think about exploration and not
about diversity because the exploration process is in charge of maintaining the diversity of the
population. One way to keep a good relationship between exploration and exploitation is to have good
diversity.
Besides, exploitation is the process of refining the known solutions. While the exploration process is
focused on new spaces, exploitation focuses on those regions that we already know and look at in a
little space called neighborhood. As mentioned before, the relationship between these two processes
is significant in getting the best solution.
Let us say that we have a function that describes our problem, it is the first time we see it, and we want
to get the solution to that problem. We can not just have the right solution by looking at it because it
has a form, and it could have many minimus so, if we only use exploration, we can not have the best
solutions cause, as we said before, we do not know the solutions, exploration may give us a good value,
but we can not affirm that is the best solution, and here is where the exploitation process appears. Now
with exploitation, we can do a local search knowing the best solution given by exploration, and use it
to look around it.
C. Conclusion
Keeping a good relationship between these two processes is fundamental in our search algorithm. As
we said before, having a diverse population is one thing that helps with this work, but this is only a
prerequisite. Another simple meaning is "fitness". This is used in many methods to guide exploration
and exploitation.

II. CODING: POINT 2


Using the net model (image 2.1), try the following search method (figure 2.2) and find the problem's
solution.
2

Model
figure 2.1

xBEST is the best-found solution, and r is a random vector.

Search method
figure 2.2
In this method, what we want is to maximize.
A. Process
As seen before in the descent gradient method, we first have to prepare some parameters for the correct
functioning of this method. We have a similar process using this method.
A pseudocode for this could be the following:
• Define parameters: limits and the number of iterations.
• Calculate the start random point and evaluate it to make it the best solution (for now).
• Calculate another random point to have a different result and make the whole process.
• Start the "while" cycle for n number of iterations
o Evaluate the random point
o Select the best solution between this new one and the old one.
o Using the model, calculate a new point to evaluate
▪ Just in some cases, force the point to the limits previously established.

And now, the most important part: the code. Having a pseudocode, we have to make it step by step, so
we first set the parameters:

Now that we have set the parameters, if we want to have a general view of the function, we have to do
the following part of code:
3

This step is optional, to have a perspective of how it looks like. What is very important is to initialize
our starting point, make it our best solution and get another random starting point. Let's say that the
first is our first evaluation point, and the second is our real starting point. The question of not doing
this is whether, if we use the same first evaluation point and start point, there would not be any
difference, and using this method, we will not be able to search in our space. The code is the following:

We save the value of the evaluation (zBest) and the position (x1Best and x2Best). Now we can start
the whole cycle:
4

B. Results and conclusions


We are just using two dimensions, so we can have a view of how it works:

In figure 1, we have a general view of the function in the specific search space, and in figure 2, we
have a top view to visualize how is calculated the best solution.

In conclusion, this method is based more on stochastic processes than deterministic ones, but it works.

III. CODING: POINT 3


Given a sequence of elements: {10,2,3,5,8,1,1,4,6,3}. What happens when this sequence is
probabilistically sampled and generates another sequence of 10, 100, and 1000 elements?

A. Process
First, we need to make a clear idea to do this, and we could do it using pseudocode, which would be
the following:
• Define our main sequence
• Define the length of the other sequences
• Sample the main sequence taking into consideration their numbers and the length of each
sample data
• Show the results

For this exercise, the code is short so that we can show it all in just an image:
5

B. Results and conclusions


The following image is a view of the distribution of the samples for the sequence:

To explain this, we can think that this exercise is a game where we have N opportunities to pick the
numbers of the main sequence, but we can not see what we are taking. Since we are not looking, the
probability that we chose a one or a three is bigger than for the other numbers, and we will never pick
6

a seven or nine because they are not in the main sequence, but all the other numbers have the same
probability of being picked. That is why the larger the number of samples is, the more equal they look,
and we can see it illustrated with the red line.

You might also like