Family Encyclopedia >> Electronics

What does an algorithm look like?

We know Facebook, Google, and Amazon have algorithms that give us updates, search results, and product recommendations, but what does that actually mean? What is an Algorithm? Can you write one? What would it look like if you did? Since they run so many aspects of our daily lives, it's important to have a basic idea of ​​exactly what's going on under the hood – and it really isn't as daunting as it often seems. P> ContentsInformal definition:algorithms are just recipesMore formally:algorithms are clear and unambiguous formulasEveryday algorithmsEverything is an algorithm

Informal definition:algorithms are just recipes

At its core, an algorithm is simply a well-defined set of steps that you can follow, usually taking a few inputs and producing a different set of outputs. A cupcake recipe can be an algorithm. The same goes for directions to a friend's house, reading sheet music, or the process of looking up a word in a dictionary. Raymond Queneau even printed a book of ten sonnets with verses that can be seamlessly mixed and matched to create 100,000,000,000 original poems. How these algorithms are implemented varies widely, but you don't need to know any programming languages ​​to understand the basic logic behind them. For example, the following is an algorithm for giving simple walking directions.

What does an algorithm look like?

One algorithm you probably use every day is Google's PageRank algorithm, which looks at hundreds of factors about a web page, runs them through its formula, and assigns it a score. The search results you see in response to your search term are a direct result of this score. It works so well because it follows a set of clearly defined rules that tell it what to look for, what to ignore, and what to do with the information it finds.

To visualize a very simple search process, here is a linear search algorithm that searches for the number 3 in a list of numbers.

list =[1, 3, 5]

  1. Check each item in the list.
  2. As soon as one of the elements is equal to three, flip its position.
  3. If three is not in the list, return "Three is not in the list!" »

After these steps, the computer will look at the first number, which is one. Since it is not equal to three, it goes on and checks the next number. Since this number is three, it returns something like "Number three is the second item in the list".

In Python code, a linear sorting algorithm would look like the following image.

What does an algorithm look like?

What does an algorithm look like?

All the code does is take a list of numbers, look at each item in the list, and check if it matches the search term. If nothing happens, it just returns "False". It's an extremely simple algorithm, but whether it's one line of code or a million, every existing algorithm works on the same basic principle:take information, process it according to some logic. preset and get results.

Everyday algorithms

Most of the algorithms that run our daily lives are not open source. We don't know exactly how Google determines which search results to display or how Facebook aggregates your News Feed, but we can still see the results of those calculations. Nonetheless, they are important, and we have a pretty good idea of ​​the basic logic behind them.

What does an algorithm look like?

  • Google PageRank works by examining the number and quality of links leading to and from a webpage, although there are a large number of secret criteria that are constantly updated to improve results and prevent anyone from playing with the system.
  • Facebook News Feed measures the strength of your relationship with people and groups based on your activity, then uses these and other factors to generate your newsfeed.
  • Amazon and Netflix use recommendation algorithms that look at user data, determine the things each user might want, and show the user those things.
  • The UPS ORION System is a huge (over 1000 pages!), but it can calculate the most efficient route for any delivery while also considering all sorts of real-time data and operational parameters, like requested delivery windows.
  • Artificial Intelligence Applications like self-driving cars, facial recognition, natural language processing, predictive analytics, and many more rely on algorithms that can take visual, audio, or digital data into account, understand what's going on, and return appropriate results.
  • Advertisement algorithms are everywhere. While humans are the ones delivering the ads you see, it's an algorithm that ultimately decides if you're the right audience.

Everything is an algorithm

Once you know what an algorithm looks like, you can't stop noticing them. They are not just in our technology, because, after all, they are in our brains. Everything we do is the result of receiving input, processing it, and producing output. Most of these processes are stored in a constantly rearranging black box, but they are there, behind the scenes, to help us move around, understand language, and make decisions about things. Humans are equipped to understand algorithms on an instinctual level, so even though computer algorithms are written in indecipherable math and code, they can all be translated into terms we understand.

Image Credit:Mandelbrot Game Image, Websites Interconnected to Illustrate PageRank, CTP TheoryOfComputation Linear Search, Shell Sorting Algorithm Color Bars