I wanted to tell you about this relationship that exists between the mathematics that we can start studying in 4º of ESO and a concept that is so close and used every day, such as Internet searches. I love writing these articles because I can approach my students to very complicated concepts based on the theories or practices that we are currently giving in class, in this way it makes them see and understand the usefulness of the **math in real life**.

Algebra and discrete mathematics allow to combine tangible concepts of the real world with computational computation. Computers operate with rules that are algorithms, which are created thanks to the laws of discrete mathematics (*boolean algebra, matrices, graphs, trees*, ...).

The discrete mathematics allows, among other things, to extrapolate everyday problems to the mathematical language that, in turn, is what the computer understands.

Mathematics is a fundamental pillar for computer science. Directly applicable in such important areas as computer security, error checking, statistics, graphic design, compression, network optimization, search and sorting algorithms, engineering, robotics, geotechnics, fluid mechanics, among others.

In this case we will highlight one of the many computer disciplines that directly use algebra, **Internet search engines**

To explain the relationship that we can find between Internet search engines and mathematics, we have to focus on a concept of Discrete Mathematics known as Graph, as *my goal of this article is that it can be taken to the classroom*, I do not want to integrate concepts that escape the subject of a school, we really want the students to understand the idea and its application to the real project.

### What is a Grafo?

A graph G is a mathematical structure consisting of an ordered pair of sets of vertices and another of edges (V, E).

**A vertex**is each of the objects that the graph represents.**An edge**is the union or relationship that exists between two vertices. It's an unordered pair, so V_{1}V_{2 }it's the same as V_{2}V_{1}

A graph is defined as G = (V, E) where:

- V is the set of
V = {V 1 , V 2 , V 3 , V 4 ... V n }*vertices* - E is the set of
E = {V 1 V 2 , V 1 V 3 , V 2 V 3 ... V n V m }*edges*

We define how ** adjacent vertices** two vertices joined by an edge.

We define **fireplace** as a succession of edges V_{1}V_{2}, V_{2}V_{3}, V_{3}V_{4} which represents a succession of vertices

Now that we know that it is a Graph, we are going to try to explain how this "drawing" of vertices and edges has been so relevant in something so important today. Algorithms as famous as the **Google PageRank are born of this theory**.

There are many types of graphs but we will only focus on one of them to explain the Search Engines, the "Oriented Graphs".

What is an Oriented Grapho?

An Oriented Graph or Dígrafo D = (V, A) is formed by a set of vertices V and a set of arcs A that join ordered pairs of elements of V.

In a oriented graph, the edges are called arcs, and are represented by arrows that indicate the direction of them.

The application of these concepts exposed to the network of web pages that we know today is totally direct. In this case the nodes are the web pages and the links between them are the hyperlinks that direct the user from one page to another.

Due to the characteristics of web pages, the link between pages necessarily has a defined orientation since it starts from the page *x* and goes to the page *y*. Consequently the graph is oriented. Furthermore, when considering the totality of existing links on a page to any other set of pages, the weighting corresponding to each link can easily be assigned.

The most common form, whose justification will be made in the following subsection, is to do it in an equitable manner, although nothing prevents there being cases in which there are other factors that affect the weights, and therefore these are not equal.

Having presented the usefulness of graph theory to represent the network of web pages, now it is necessary to investigate the actions of the person who is going through this set of pages to find what they want.

When you start looking for something in the web pages, you must necessarily start with a page. In case you do not find what you want there you can try your luck choosing a new page at random or select some of the hyperlinks present in the current page. But to be introduced to the search engines consider the case in which the individual chooses the links in a random way.

In this case, being on a certain page the choice of any of the links depends on the number of existing links. By modeling the search as a ** random walk** The probability of choosing any of the links is the same for each one of them.

Considering the network of web pages as a Graph and the search in it as a random phenomenon, the reason why we work with equal weights for the links is justified.

It is important to clarify that both the reasoning and the method presented are only valid for "normal" situations, where all the pages are interlinked and can be represented by strongly connected graphs. For those cases in which this does not happen, the algorithm has correction formulas that allow its correct operation.

Two common drawbacks are:

**Pages without exit links**(hanging pages), corresponding to connected graphs.**Presence of detached components**, that is, groups of pages that are not related to each other and that nevertheless are relevant to each other.

In the following article I will try to deepen more in the weights of the graphs that is where the meaning of the algorithm really is, but I believe that with this first article I have managed to reach my goal, which is how to always look for real projects and give them their meaning in the classroom through the subjects. In this way when students see an Oriented Grapho or directly they are spoken of Algebra or Discrete Mathematics a part of their head will go to seekers like *Google, Yahoo, Bing*, etc ... and not to look for information, **if not to understand the operation of your engine**.