What’s an Algorithm? A Look at the Magic Behind Data-Driven Decisions

December 21, 2020 - 7 minutes read

The term “algorithm” in computing is inescapable. Found everywhere, it can mean an artificial intelligence (AI) application used in the cloud, for quantum computing, in self-driving cars, on social media, or a host of other technologies. Like programming languages, algorithms are a set of instructions for a computer. Unlike programming languages which dole out very specific instructions, however, algorithms go much deeper than that; they ask the computer to find the best fit, best probability, or best prediction about a given set of information.

An algorithm gives a computer a set of facts (data) and tells it how to transform it into useful information, like instructions for machines, knowledge for people, or input for another algorithm. Algorithms can work on problems as simple as number sorting or as complex as finding your soulmate. But how do they work? Let’s take a deeper look into the anatomy of an algorithm.

Problem-Solving

At their core, algorithms break down a complex problem (one that isn’t built into a programming language and can’t be readily found in a language’s library) into a multi-step, solvable set of instructions for a computer. Many of these “complex” problems aren’t complex to us (like the number-sorting example), but they’re complex for a computer to understand without breaking it down into easier-to-understand steps. For example, how do you choose what you’re going to wear today?

For most people, it’s not too difficult to find something that looks nice and makes you feel confident and throw it on. Easy, right? Try to think about how a computer would approach this problem. You’d have to write some code on what you’ve worn recently, what fits and doesn’t fit anymore, what event you’re dressing up for or the style you’re going for, and even what shoes you have on hand to match with. Suddenly, the problem becomes more in-depth, with each topic involving multiple layers of decision-making and historical data.

The Inner Workings of an Algorithm

All of the aforementioned aspects (clothes were worn recently, clothes that fit and don’t fit, the style to dress for, and what shoes to match with) are all inputs for an algorithm. An input is a piece of information that will be directly used by the algorithm to make decisions. This information is encoded in the form of data, whether it’s an array of clothes that fit or a number and unit representing the average temperature for the day.

The algorithm then takes this input data and transforms it through a series of steps that involve calculations, comparisons, and decision-making. For the getting dressed example, the transformations would involve using the inputs to make a final decision about what to wear, comparing it against what fits and doesn’t fit, and recalculating the clothing choice accordingly. It might even continuously scrape the web for the most recent fashion trends so that it can develop an outfit for you that’s fashion-forward.

The algorithm then returns an output of the final outfit it has chosen for you — this is akin to the algorithm’s final answer or response. The output is data that has reached the end of its calculations and comparisons. Often, the output is used as input for another algorithm, known as stringing together algorithms. In this way, each algorithm is tackling one step at a time, while the entire ecosystem of connected algorithms works together to solve an overarching question or problem. For example, the final outfit presented might be used to develop a weekly schedule of outfits using another algorithm, which compares each outfit found and arranges them for maximum variety. Output can also mean visual or auditory answers to the problem presented.

How Machine Learning Works

Machine learning is a subset of AI, and it refers to a special category of algorithms that try to learn based on historical data about decision-making. Machine learning is used for prediction, recommendations, and searching for information. For more complex user interfaces, a machine learning algorithm may present a variety of choices that the user can accept or deny.

In our “getting dressed” example, for algorithms that utilize machine learning development principles, this user feedback can be used to inform the next day’s clothing choices. For example, if the algorithm records the user’s feedback for a long-enough time, it can eventually surmise that you don’t really like those black jeans because you never choose an outfit with them and whenever presented with an outfit involving the black jeans, you always reject that choice. It could even monitor your social media to see what outfit components get the most likes and engagement to inform the next outfit it chooses for you.

artificial intelligence app development

Applications for Tomorrow

Machine learning and AI have been used for some seriously cool applications. We recently wrote about how an AI algorithm uses your face to estimate your attractiveness, BMI, gender, and even life expectancy. Another great example is an AI algorithm has been tested using technology developed in Boston. It allows your car to read your emotions while driving and helping you calm down during stressful driving incidents. AI has been ideated to help judges figure out if someone is innocent or guilty, but that has exposed some serious flaws with AI: bias, racism, and sexism.

Although these examples may seem far-fetched, kooky, and even downright crazy, they’re a good glimpse into what the future of algorithms holds. Developers will continue to come up with new ways to apply algorithms, and we’ll see a variety of new ideas in the coming decade that utilizes the basic concept of taking input data and transforming it until it becomes an output.

Tags: , , , , , , , , , , , , , , , , , ,