The Secret Rules Of Modern Living: Algorithms

From ancient to present, algorithms has been a indispensable part of our lives.

euclid_gcd1.gif
Retrieved from dynamicgeometry.com

The oldest algorithm is Euclidean Algorithm, which is used to calculated the greatest common divisor of two integers. Here is a picture illustrating how it works, which I will talk more about later.

The Secret Rules of Modern Living: Algorithms is a documentary produced by BBC, which introduces algorithm from past to now.

In this documentary, there are many more complex and interesting algorithms. Here, I chose seven of them to introduce algorithm in detail.

Euclidean Algorithm

As explained in the introduction, the Euclidean Algorithm is used to calculate the greatest common divisor of two integers. To visualize the mechanism behind the algorithm, we should look at the picture shown above. The two sides of the rectangle are the two integers that we are going to use to find the greatest common divisor. To begin, we use the shorter side as the side of a square in the rectangle. Then we took out the square, and do the same thing to the remaining rectangle. Eventually, the remaining rectangle can be perfectly divided to several squares, and the side of the square will be the greatest common divisor. This looks magical, but the basic principle is that the common divisor of the smaller number and the difference of two numbers is the same with the initial common divisor.

Through the lens of this old algorithm, let’s learn more about modern algorithms which are more complex and interesting.

Google Page Rank Algorithm

The google page rank algorithm is the first incarnation of the Google search engine, which is also the algorithm that made Google stood out.

The basic idea of this algorithm is that pages are ranked according to the inbound links that one has. Suppose that page C has its link on page T. The benefit that C can get from being linked by T depends on the rank of T and the total number of the links on T. (Reference: efactory) Also, there are also other factors that affect the ranking, which are just little complex.

This algorithm make it possible for users to find the most related and highly rated sites that may save a lot of time and efforts. With the development in computer technology, this algorithm can reduce human work as well as improve the efficiency of information searching.

Sorting Algorithm

Sorting algorithms are primarily used to line up a list of values from small to large (or from large to small.) The three basic algorithms that I am going to talk about are bubble sort,  select sort, and insert sort.

WX20170307-211614@2x
Bubble Sort. Pic from visualgo.net

Bubble Sort

Bubble sort is the simplest method of sorting. However, it is usually considered as the slowest for a large amount of value. Suppose that there is a series of values, bubble sort compares the first two values and switch them if the second value is less than the first one. Then, we do the same thing to the second and third value, so on and so forth.

Select Sort

In this sorting method, the data set is scanned, and the smallest value is found at first, and this value switched with the first value of the set. Then, in the second scan, the first value is fixed. The smallest value of the remaining values is then selected and switched with the second value of the whole set. This required time for this sorting method is usually predictable, but it is not very efficient.

Insert Sort

This sorting algorithm selects each value one by one, while comparing it with the all values before it. Then, the value selected is inserted in the right place – between a smaller one and a larger one.

Stable Marriage Algorithm

The stable marriage algorithm is a matching algorithm which match people who like each other. Now, over one-third of marriages are started online.

Suppose there are four girls and four boys each has his or her best choice to the fourth choice. Firstly, we just put the put the girls next to their first choice. Then, if there are more than one girls choosing one boy, the girl who has the highest ranking in the boy’s viewpoint is reserved, and others are then put next to their second choice. Eventually, they are all paired up.

I think this algorithm is extremely beautiful since it basically creates the most stable relationships. Moreover, it can also be used in other fields, such as organ donation matching.

Shortest Route Algorithm

In many real life situations, people need to find the shortest route to go though several places. For example, a postman wants to deliver all the mails to different places in the shortest time, but when there are too many places, it is very hard to find the shortest route.

To create an algorithm to achieve this goal, people tried hard but failed. Clay mathematics institute once offers 1 million dollar for whoever can find an efficient algorithm to solve this problem, or prove that none exist. The result was, mathematicians proved that the algorithm for this shortest route problem do not exist.

WX20170307-211743@2x
Using radar to record bumble bee’s routes. Retrieved from the documentary.

However, although we cannot find the most efficient way, there are some ways we can just find an adequate method. For example, some researcher found that when bees collect honey, their routes are quite efficient. They made models for the bees routing rule.

From this example, we can see that there is not always a solution for every problem. Algorithm is not the perfect tool, but it is useful enough and it indeed improves efficiency.

Heathrow Sequencing Algorithm

WX20170307-211317@2x
Retrieved from the documentary.

This sequencing algorithm is named after the Heathrow airport. It controls the departing time and route of all aircrafts in the airport. Since medium aircraft cannot depart next to a large aircraft because of the strong wind caused by the large turbine. Also, there is the problem of efficiency. Therefore, controlling the departure of airplanes is an extremely difficult task for human as there are too many factors. But machines can do calculations easily, as long as we tell them the rules.

This algorithm not only improves efficiency, but also save lives by preventing human mistakes. The high reliability of machines enable people to do something that seem dangerous or impossible in the past.

Machine Learning

WX20170307-211437@2x
Retrieved from the documentary.

Machine learning algorithms can develop themselves and learn from data.

For example, an algorithm can display people’s body movement in pixels of colors in real time. Different body parts are marked to different colors respectively. This algorithm is called decision tree, which ask twenty questions that help judge what body part it observed. The more examples it observe, the more accurate it is, the more questions it will ask – it writes questions by itself and make itself more accurate.

Machine learning algorithms are more flexible, having potentials to improve, even to a extent that people cannot predict. They relieve human from analyzing tons of data and looking for the clue.


To conclude, algorithms are steadily improving from past to now, from making human work easier to transcending the ability of human. I believe the algorithm, especially artificial intelligence which is based on machine learning, will bring human to great, unimaginable possibilities in the future.

Leave a comment

Website Built with WordPress.com.

Up ↑