Algorithms are present in our daily lives with technology. The term, which has its origin in mathematics, characterizes a set of steps that any software needs to perform to reach a result. The concept is very important for programmers, who use strategy as a way to divide problems into steps that can be applied by computers to perform some specific task. In the following, we explain what an algorithm is and give examples of the application of this concept in the user’s routine.
What is an Algorithm?
Algorithms are the basis of the software development process and are part of the tools by which programmers create strategies to fractionate problems into steps and processes that can be translated computationally. In technology, there are examples of all levels of complexity.
A simpler application of an algorithm is the computer startup process: there is software – basically the computational translation of an algorithm – in charge of testing all the components of your computer to see if everything is in order and then looking for the operating system on disk to load it.
In an example like this, the algorithm needs to address strategies in exceptional cases or when not everything works as expected: programmers need to anticipate situations that run out of the pattern, such as when the boot algorithm can’t find an operating system to load. If this possibility is not predicted, your computer does not load the operating system because it has not found it and also does not warn you, locking in a state without any information that can guide the user about what went wrong.
In general, when you approach the idea of an algorithm in the scope that it involves from your computer, video game, and mobile phone to your car systems to large processing tools in the cloud, powerful search algorithms, and increasingly sophisticated artificial intelligence capabilities, we are talking about a logical model of steps that proposes to structure a chain of steps for data to be processed and returned by computers of all kinds to their users.
Examples of what Algorithms do
It may seem exaggerated, but everything your computer does can be translated into algorithms. There are different types of algorithms and some of them are much more complex than others, but in general, all software is a computational interpretation of an algorithm.
Another example is compression. Compressing data means generating versions that accept some level of information loss, or quality to generate smaller files: MP3, for example, is a type of compression used in audio that allows sacrificing a quantity X of information to generate a much smaller file. The same reasoning applies to the JPEG of images or the MP4 of videos.
An MP3 compression algorithm works as follows: it is a type of software that reads all the raw information from a high-quality sound sample to convert it to MP3. In this analysis, the algorithm maps the sound and identifies sound frequencies that are inaudible by the human ear, separates them, and creates a sound file that, without those frequencies that we don’t listen to, ends up much smaller to store on your computer’s disk. The problem is the loss of quality. Although technically inaudible, some guarantee that MP3 sound sounds different from raw quality sound.
The same reasoning applies to more current uses: when you decide to download an MP3 from a YouTube video, you are applying a type of compression algorithm that converts the original information into an MP3 file on your computer.
Other examples of recurrent use of algorithms in your everyday life are encryption, which makes the data you exchange with the Internet protected from the action of invaders; from maps, where your routes in location apps are calculated as efficiently as possible; from Internet routes, where your communication with sites and apps is defined by the ideal routes between servers around the world.
Algorithm and Programming
For a programmer, having notions about algorithms is essential, as it precedes the mastery of a programming language. To know how to use algorithms is to know how to create strategies to fractionate real problems into more abstract instructions that a computer can follow in solving a problem.
To learn to program, much more important than choosing a language or project is to master the deterministic logic of one step at a time behind the algorithms. It is the basis that makes the action of programmers more effective and efficient since once you can divide a problem into steps and convert it into a sequence of steps that the computer can interpret, the task of translating those, chain of steps into a programming language becomes simpler.
How are algorithms used on the Internet?
Algorithms are everywhere when we talk about computers and technology, but the term is quite associated and often appears when the subject is the Internet. There’s Google’s search algorithm, Facebook’s timeline algorithm, Spotify’s algorithm that combines the songs and artists you hear to suggest new unknown tracks, and so on.
The famous “Google algorithm” is a search tool that scans the Internet for results that match the parameters of a search. Google’s technology revolutionized the market because it appeared with the ability to give more weight to pages with more relevant information. When it appeared, in 1999, Google was the only one to do this, while other search engines gave generic results that often didn’t even go near what the user was looking for.
In the case of Facebook, there is an algorithm behind the organization, relevance, and frequency of content that appears on your timeline. Called “EdgeRank” by Facebook, the algorithm decides what you see on your page from several factors ranging from cross-referencing what your friends enjoy and share to calculating what you tend to find most interesting from your habits.
In the Spotify example, there is an algorithm that analyzes the songs and artists you like, establishing a behavior pattern, which is used to suggest similar songs and musicians, but that the user does not know. More than just an exercise in genre association, the Spotify software analyzes the audio signature of each song to search for similar sounds that the user wouldn’t search for. This same type of combination and precise content suggestions are used by Netflix, Amazon Prime, and YouTube.