What is an Algorithm? Explain Like I’m Five

by Chris Von Wilpert, BBusMan • Last updated November 21, 2023

Expert Verified by Leandro Langeani, BBA

First-Person Perspective: We buy, test and review software products based on a 3-step rating methodology and first-hand experienceIf you buy through our links, we may get a commission. Read our rating methodology and how we make money.

What is an algorithm?

Imagine you're a robot chef trying to bake the perfect cake. An algorithm is like your secret recipe that guides you step-by-step, making sure all ingredients are mixed in the right order and baked at the perfect temperature. These magical formulas help solve problems or complete tasks not just for baking cakes, but also for finding directions, organizing playlists, and even teaching computers how to paint masterpieces... So next time you enjoy a slice of delicious digital cake or marvel at an AI-created artwork, remember it's all thanks to those fantastic algorithms working behind the scenes!

Algorithm fast facts

  • Algorithms are like recipes for computers, directing them through a sequence of steps to process data and solve problems.

  • The term "algorithm" originates from the mathematician Al-Khwarizmi, who is also considered the father of algebra.

  • Social media algorithms personalize user experiences by curating content based on individual behaviors and preferences.

  • Major social media platforms, such as Facebook, TikTok, and X.com, use complex algorithms to determine what content is shown to users, affecting our daily information diet.

  • Algorithms also have the potential to create filter bubbles and be used for manipulation through targeted content and disinformation campaigns.

What is an algorithm in simple terms?

In the digital world, algorithms are like recipes guiding computers through a series of steps to cook up solutions. They're behind many everyday tasks, from optimizing search results to suggesting that catchy song you can't get out of your head. 

According to Cambridge University Press, Alan Turing introduced the concept of "computable functions" in 1936 — a breakthrough that laid the foundation for modern-day algorithms.

These problem-solving recipes come in various flavors. Take Greedy algorithms: they pick what seems best at each step and hope it leads to an optimal solution. Then there's Dynamic Programming, which is breaking down complex problems into bite-sized pieces and solving them while remembering past results (talk about learning from experience). And let's not forget machine learning — these use neural networks inspired by human intelligence to learn patterns and make predictions.

Algorithms have transformed industries across science and tech since their inception. For instance, Google relies on sophisticated search algorithms for speedy information retrieval or AI applications like deepfakes, which have the potential of altering our perception of reality itself.

What is an example of an algorithm?

Algorithms are the foundation of computer science, simplifying problem-solving by guiding computers through step-by-step processes. They help us make sense of complex computing concepts and improve efficiency. In simpler terms, algorithms act as blueprints that show how computers work and solve problems.

Take graph theory, for example — a branch of mathematics focused on networks made up of connected points (nodes) joined by lines (edges). Algorithms play a vital role in solving graph-related challenges like finding the shortest path between nodes or identifying cycles within the network. Dijkstra's algorithm is one such method. It determines the shortest distance from one node to all others in a weighted graph while keeping time usage low.

Sorting algorithms are another good example. These methods organize data elements based on specific criteria like numerical value or alphabetical order. There are many sorting techniques with different efficiencies depending on factors such as input size and distribution. QuickSort is an effective approach that picks a 'pivot' element and organizes items around it so smaller values come first. This process repeats until everything is sorted.

These examples show how theoretical ideas form the basis for practical applications: they provide insights into computational obstacles while inspiring new ways to address real-world issues across various fields.

A backdrop of code snippets representing the complex algorithms. Photograph: Navégalo.

What does an algorithm look like?

Algorithms are essential tools in computer science, helping us break down complex problems into manageable steps. They can be represented in various forms such as pseudocode, flowcharts, or actual programming code. Pseudocode is particularly popular because it uses plain language and simple syntax to outline the algorithm's logic without being tied to a specific programming language.

For example, consider an algorithm for finding the largest number in a list of numbers. The pseudocode representation would involve initializing a variable with the first element of the list and then iterating through each subsequent number while comparing it to this initial value. If any number is found to be larger than our current maximum value during iteration, we update that max value accordingly until we reach the end of our list.

This step-by-step approach highlights how algorithms function as systematic guides for computers when solving problems or performing tasks efficiently. By breaking down processes into clear instructions that can be translated into different programming languages or visualized using flowcharts, algorithms enable developers and programmers alike to better understand complex computational concepts while also optimizing their solutions across diverse domains.

How do you write a simple algorithm?

Writing a simple algorithm begins with understanding the problem you want to solve or the task you aim to accomplish. Clearly defining your objective is crucial, as it sets the foundation for your algorithm's structure and logic. Once you have identified the problem, determine what information is required as input and what results are expected as output. This step ensures that your algorithm has well-defined boundaries and can effectively process data.

Next, break down tasks into smaller steps by decomposing your main goal into a series of manageable subtasks that can be performed sequentially or in parallel. This approach simplifies complex problems while making them more digestible for both humans and computers alike. With these smaller tasks defined, write step-by-step instructions using clear language (or pseudocode) so that others (or yourself) can easily understand and implement them later in an actual programming language.

Finally, test your algorithm with various examples to ensure its correctness under different conditions before translating it into code within a specific programming environment. Running through diverse test cases helps identify potential flaws or areas where optimization may be needed. This process should include edge cases — situations that involve extreme or unusual input values that push the boundaries of your algorithm's logic.

What is an algorithm in social media?

An algorithm in social media refers to the set of rules and calculations used by social media platforms to determine what content is displayed to users, how it's ranked, and when it appears on their feeds. These algorithms analyze various factors such as user preferences, interactions, connections with other users, and the type of content being shared.

Social media algorithms aim to provide a personalized experience for each user by showing them relevant and engaging content based on their interests and behavior. For example, if you frequently like or comment on posts related to travel or photography, the algorithm may prioritize similar content in your feed.

These algorithms are constantly evolving as they learn from user data over time. They adapt not only based on individual actions but also broader trends across the platform. Social media companies continually update their algorithms to improve user satisfaction while keeping people engaged with their platforms for longer periods — which ultimately drives advertising revenue.

Do all social media use algorithms?

Most major social media platforms use algorithms to curate and personalize content for their users. These algorithms help deliver a more engaging experience by showing relevant posts, ads, and recommendations based on user preferences, behavior, and interactions.

Examples of popular social media platforms that use algorithms include Facebook, Instagram, X.com, LinkedIn, YouTube, TikTok, among others. Each platform has its unique algorithm designed to optimize user engagement within the context of its specific features and target audience.

However, not all smaller or niche social media platforms may rely heavily on complex algorithms. Some might use simpler methods for displaying content like chronological order or basic filtering options based on categories or tags. As these platforms grow in size and complexity though they often adopt more sophisticated algorithmic approaches to improve user experience and boost revenue.

A conceptual representation of the father of algebra, Al-Khwarizmi, illustrating the historical roots of algorithms that continue to shape our digital world today. Photograph: Kay Suhaimi via Iluminasi.

Who invented algorithms?

The concept of algorithms dates back to ancient times, but the term "algorithm" is derived from the name of Persian mathematician Al-Khwarizmi (c. 780 – c. 850). He wrote a book called "Al-Kitab al-mukhtasar fi hisab al-jabr wa'l-muqabala" which translates to "The Compendious Book on Calculation by Completion and Balancing" — this book introduced systematic methods for solving linear and quadratic equations, laying the groundwork for modern algebra.

However, it's important to note that algorithms have been developed throughout history by various scholars across different cultures. For example, Euclid's algorithm for finding the greatest common divisor was documented around 300 BCE in ancient Greece.

In the modern computer science context, Alan Turing is often considered one of the founding figures in formalizing concepts related to algorithms and computation with his work on Turing machines during the early-to-mid-20th century.

How do I control my social media algorithm?

While you cannot directly control social media algorithms, you can influence them by adjusting your behavior and preferences on the platform. Here are some tips to help tailor your social media experience:

  1. Engage with content: Like, comment, share, or save posts that interest you. The more you interact with specific types of content or users, the more likely the algorithm will prioritize similar content on your feed.
  2. Follow relevant accounts: Be selective about who you follow and engage with their posts regularly so that the algorithm recognizes your interests and displays more related content.
  3. Adjust settings: Many platforms offer options to customize how your feed is displayed (e.g., chronological order) or allow for muting/unfollowing certain accounts without unfriending them.
  4. Use built-in features: Some platforms have "See First" (Facebook) or "Turn on Post Notifications" (Instagram) features that let users prioritize updates from specific accounts they don't want to miss out on.
  5. Curate lists/groups/collections: Organize followed accounts into lists (X.com), groups (Facebook), or collections (Pinterest). This helps manage what type of content appears in different sections of a user's profile/feed based on their current interests/preferences.
  6. Report irrelevant content: If you come across ads or posts that don't interest you, use the platform's reporting feature to provide feedback. This helps train algorithms to better understand your preferences and avoid showing similar content in the future.
  7. Explore new interests: Occasionally engage with different topics, hashtags, or accounts outside of your usual interests. Diversifying your engagement signals can broaden recommendations and help you discover new content while influencing the algorithm to show a more varied feed.

Remember it takes time for changes made above to reflect noticeable differences in feeds as algorithms adapt dynamically over time based on interactions and patterns.

An illustration of the complex algorithms social media platforms use in the background to curate and tailor user experience. Photograph: Carly Hill via SproutSocial.

How do algorithms affect our daily lives?

Algorithms play a significant role in shaping our daily lives, often working behind the scenes to provide personalized and efficient experiences. One of the most common ways we interact with algorithms is through online search engines like Google. These powerful tools use complex algorithms to sift through vast amounts of data and deliver relevant results when we seek information on various topics.

Social media platforms also rely heavily on algorithms to curate content that’s tailored for each user based on their preferences, interactions, and connections. 

This personalization influences what we see every day — from posts shared by friends, followed pages, to targeted ads that match our interests. Similarly, entertainment streaming services such as Netflix or Spotify employ machine learning algorithms that analyze viewing/listening habits to recommend movies/shows/music customized to individual tastes.

Beyond these familiar examples, there are many other areas where algorithms impact our lives: navigation apps like Google Maps optimize travel routes considering factors such as distance and traffic conditions. Financial services use data-driven models for credit scoring systems or robo-advisors offering investment advice. Healthcare professionals benefit from diagnostic tools powered by AI pattern recognition techniques analyzing patient records/images. Even smart home devices autonomously adapt settings based on learned behaviors/preferences over time using IoT-enabled appliances (like thermostats).

How can algorithms be used for manipulation?

Algorithms can be used for manipulation in various ways, as they have the power to influence what information is presented to users and how it's prioritized. One example is filter bubbles created by personalization algorithms on social media platforms or search engines. These bubbles limit exposure to diverse perspectives and reinforce biases by only showing content that aligns with users' existing beliefs.

Another form of algorithmic manipulation involves disinformation campaigns, where malicious actors exploit algorithms using fake accounts or bots to amplify misleading information or propaganda. By artificially boosting engagement metrics like likes, shares, comments, or retweets, these actors make false narratives appear more popular than they actually are, swaying public opinion and promoting misinformation.

Advertisers may also use sophisticated algorithms for hyper-targeted advertising based on user data such as browsing history and demographics. This approach allows them to serve potentially manipulative ads (e.g., political campaigns exploiting voter sentiment) tailored for each individual user's interests and vulnerabilities, influencing behavior/decision-making processes.

Make Your First $100K Per Month

Learn how to leverage a blog + smart AI to make $100k per month. Includes examples, illustrations, and step-by-step instructions.

>