All About Algorithms

Subscribe
Apple | Spotify | Amazon | iHeart Radio | Player.FM | TuneIn
Castbox | Podurama | Podcast Republic | RSS | Patreon


Podcast Transcript

Whether or not you know it, you use them every day. You were actually trained to use them as a child. Much of the world we live in today is directly or indirectly a result of their use. 

While they are ideally suited for computers, they were actually first developed thousands of years ago. 

Learn more about algorithms, what they are, how they work, and how they impact the world today, on this episode of Everything Everywhere Daily.


An algorithm is actually a very simple concept. An algorithm is nothing more than a set of rules. 

The dictionary definition of an algorithm says it is “A finite set of unambiguous instructions that, given some set of initial conditions, can be performed in a prescribed sequence to achieve a certain goal and that has a recognizable set of end conditions.”

That sounds complicated, if you have ever seen or used a decision-making flow chart, that’s an algorithm. 

An even simpler example of an algorithm that everyone has probably used is a cooking recipe. You take certain ingredients, you combine them in a certain way, you heat them for a set time and temperature, and you get an end result. 

At first glance, an algorithm doesn’t really seem like that big of a deal. Recipes and a set of instructions are hardly world-shattering. 

However, algorithms are a very big deal. 

The first evidence we have algorithms comes from the ancient world. Every ancient culture That had some form of mathematics used algorithms to do basic mathematical operations. The Babylonians, Egyptians, Indians, Chinese, and Greeks all used algorithms.

If you remember back to my episode on prime numbers, the sieve of Eratosthenes was an algorithm that was used to discover prime numbers.  The sieve is pretty simple. Start with 2, remove all numbers which are multiples of 2, which is all of the even numbers. Then go to 3, and remove all multiples of 3. Just keep doing this, and what is left are all prime numbers. 

The world algorithm has a very interesting history. It comes from a 9th-century Persian mathematician named Mu?ammad ibn M?s? al-Khw?rizm?. 

Al-Khw?rizm? has come up in several previous episodes. He was the person who developed Islamic accounting, and he was the person who was responsible for the spread of the Hindu-Arabic system of numbers that we used today. 

Al-Khw?rizm? was so important to the development of early mathematics that I really should an entire episode on him.

Anyway, Al-Khw?rizm?’s book on the subject of using Hindu-Arabic numbers was translated into Latin. The Latinization of his name became Algorizmi. 

At first, the entire Hindu-Arabic decimal number system was known in English as the algorism, however, it eventually became associated with the system of doing arithmetic by aligning digits of the same magnitude. 


This is probably the same system you used to learn how to do addition when you were younger. 

The algorism was an early algorithm. 

This eventually evolved into a term to generally describe any set of mathematical rules. By the 19th century, algorism became “algorithm” in English. 

When you were growing up, you learned how to do addition, subtraction, multiplication, and division using a very rote method with a pencil and paper. You would line up numbers, carry over values, and if you followed all the steps correctly, you wound up with an answer. 

No one probably told you at the time, but you were learning an algorithm. 

There were a handful of mathematical algorithms which were used for things like calculating the digits of pi, but there weren’t a lot of algorithms prior to the development of the digital computer. 

Enough to give it a name, but not enough to make a science out of it.

Computers, it turns out, are really good at executing algorithms. You have a set number of inputs, a finite number of steps, and a definite output.

Even the simplest things you do on a computer will involve some sort of algorithm. 

Let’s take one of the first algorithms you learn when you are learning computer programing: a sorting algorithm. 

Let’s say you have a bunch of words that you want to put into alphabetical order. How do you do it? There are actually many different sorting algorithms, but let’s just assume a very simple one for the sake of illustration.

Take the first two words and compare them to see if they are in alphabetical order. If they are in order, do nothing. If they are not in order, then swap them. Next, move to the second and third words, and do the same thing. Keep doing this, comparing words that are next to each other until you get to the end.

Then start from the beginning and run through all the words again.

Keep doing this until you can go through the entire list of words without swapping anything. The end result will be a list of words in alphabetical order. 

As I said, there are many different sorting algorithms. How do you know which one to use?

What you will normally want to do is to use whatever algorithm is the most efficient, or in other words, the algorithm which can achieve the end result in the fewest number of steps. 

These low-level algorithms are found everywhere in computing. Every computer program is, at some level, just a very complex algorithm. It is simply a set of instructions. 

It isn’t just running computer programs. When you make some sort of request on the internet for a web page, the data is sent from one router to another router to another. There are a mind-bogglingly large number of routes between you and the web page you want to download. 

Determining that route is done via an algorithm. 

Algorithms can be found higher up the food chain as well. In fact, algorithms drive much of the information you get every day. 

Let’s take for example a search engine like Google. You type in a search term and Google will quickly come back with a list of websites that, in theory, should answer your question. 

There might be an astounding number of web pages that could possibly be a result of that search term. How does Google determine what results to show and in what order?

Google has an incredibly complicated algorithm that, according to their public statements, has over 200 variables that they look at. 

Google was founded based on an academic paper written by its founders Larry Page and Sergey Brin. Their idea was that each web page on the internet could be given a rank based primarily on the number of links pointing to that page. They thought of a link as a type of vote. If someone linked to a page, then the person making the link was in a way vouching for the page they were linking to.

The core idea that they had was in and of itself sound. 

However, they soon discovered a massive problem. If everyone knew what the inputs were for the algorithm, it was possible to optimize your website such that it would rank high in Google searches.

For example, about 20 years ago, one of the major parts of the Google algorithm was looking at the number of times a keyword was used on a page. Let’s say you were searching for “used cars in Chicago”. 

Well, all a page had to do to rank high was to simply put “used cars in Chicago” over and over and over at the bottom of the page. Some sites would hide it by making the text the same color as the background. 

The value of ranking high for certain keywords is enormous, and as such, optimizing web pages for search engines has become a multi-billion dollar industry. 

It has become a constant game of cat and mouse with Google constantly updating and tweaking their algorithm, and companies trying to figure out what will make them rank higher. 

Algorithms have become vitally important to the functioning of social media sites. 

Every social media site has something known as a feed. Everyone has a feed which is unique to them based on the people, groups, and brands that you follow. 

In the first iteration of most social media sites, the feed was nothing more than a reverse chronology of the posts made by the people you followed. That’s it. It was an algorithm, but it was an extremely simply one. 

Over time, however, the algorithm became much more complex. The algorithm shifted from seeing everything which was published by the people you followed, to a filtered feed based on an algorithm. 

The algorithm would determine what it thought you might be most interested in seeing based on how much interaction the post received. 

In theory, the way I described it, the algorithm sounds rather innocuous. Who wouldn’t want to see content which was customized just for them. 

However, the adoption of an algorithm based system had serious unintended consequences. 

The algorithm served as a feedback loop. If you liked something, you saw more of it, which increased the odds you’d like that, reenforcing the algorithm sending you even more of the same type of content. 

It created a bubble where the algorithm would only show you what it assumes you want to see. 

I went to my nieces house recently and she had the Netflix menu up on her TV. What she was shown was totally different from what I saw when I used Netflix. I had no idea that most of the programs she was offered even existed. 

Some of the programs she was shown were ones that I would watch, but that is hard to do when you don’t even know they exist.

It was all due to the Netflix algorithm. 

Similarly, there was a recent documentary on people who think the Earth is flat called Behind the Curve. In it they attended a flat Earth convention and asked people how became to believe that the Earth was flat. 

Almost every person said it started with a YouTube video. 

YouTube didn’t have any nefarious plan to try to get people to think that the Earth was flat. Nor did most of the people at the Flat Earth convention go searching for information on the Flat Earth. 

They were led to these videos, bit by bit, from the YouTube algorithm. 

Despite being in the 21st century with all the information in the world at our fingertips, there are more people today who think the Earth is flat than there were 20 years ago. This is mostly due to the unintended consequences of an algorithm.

When I was in high school, I spent an inordinate amount of time in the library of the local college. I’d go and randomly read books, magazines, and academic journals. 

If you ever wondered how I wound up hosting a podcast like this, in large part it started back then when I was able to wander around reading things without everything being filtered through an algorithm. 

In fact, one of the reasons behind the creation of this show was to give everyone who listens a chance to be exposed to topics they might otherwise never be exposed to because internet algorithms would never show it to them. 

It is about the opposite of an algorithm: serendipity. 

Algorithms are a part of everyone’s life nowadays. You can’t really avoid it, and it isn’t necessarily a bad thing. The vast majority of them are innocuous. 

However, algorithms also have a downside. They can wall you off from information by feeding you what they think you want to hear. 

The way around it is to just have a spot in your life for a little bit of randomness and serendipity. 


 

The executive producer is Darcy Adams.

The associate producers are Thor Thomsen and Peter Bennett.

Today’s review comes from listener James Veverka over at Apple Podcasts in the United States. He writes: 

More than binge-worthy I absolutely love this podcast. It is so thoughtfully written. I have found myself listening for hours

Thanks, James! Please let me know when you’ve joined the completionist club. I’ll get you the keys to the clubhouse and show you the secret handshake.

Remember, if you leave a review over at Podchaser until the end of April, and there are only a few days left, they will make a donation to help feed Ukrainian refugees, which will be matched by several other podcast companies.