What Is an Algorithm?

An Algorithm is a step-by-step set of instructions that tells a computer exactly how to solve a problem or complete a task. Think of it like a recipe, but for machines.

Hey Common Folks!

We just learned that a Model is the “finished product” of AI, the thing you actually interact with when you use ChatGPT or get a Netflix recommendation.

But how does a model learn? What’s the actual process that transforms raw data into intelligent predictions?

That’s where Algorithms come in.

You’ve heard this word blamed for everything: why you spent 3 hours on TikTok, why your loan was denied, why you saw that specific ad for sneakers. People whisper it like it’s a mystical force: “The Algorithm did it.”

Let’s demystify this. An algorithm isn’t a sentient being plotting against you. It’s just a set of instructions. That’s it.

The Analogy: The Chef’s Recipe

Think about baking a cake:

  1. The Ingredients (Data): Flour, sugar, eggs, chocolate. Raw stuff that can’t do anything on its own.

  2. The Recipe (Algorithm): The instructions that say: “Mix flour and sugar. Add eggs. Bake at 350 degrees for 30 minutes.”

  3. The Cake (Model): The finished result you actually eat.

In AI:

  • We feed Data (ingredients) into an Algorithm (recipe)

  • The algorithm processes that data, finds patterns, learns

  • It produces a Model (cake) we can use

You interact with the cake, not the recipe. But without the recipe, there’s no cake.

Traditional Algorithms vs. AI Algorithms

Here’s where it gets interesting.

Traditional Software (Rigid):
A calculator follows fixed rules:

  • Input: 2 + 2

  • Rule: Add them

  • Output: 4

The algorithm never changes. It does exactly what it’s told, every time.

Machine Learning (Adaptive):
AI algorithms are designed to change themselves based on data. It’s like a recipe that rewrites itself to make the cake taste better every time you bake it.

The algorithm looks at examples, adjusts its approach, and gradually improves, without a human manually updating the rules.

Three Types of Algorithms You’ll Hear About

1. Decision Trees (The Flowchart)

Imagine playing “20 Questions”:

  • Is it an animal? (Yes)

  • Does it bark? (No)

  • Does it meow? (Yes)

  • Conclusion: It’s a cat.

A Decision Tree splits data into smaller branches based on simple Yes/No questions until it reaches an answer. It’s simple, logical, and easy to explain.

Used for: Loan approvals, medical diagnosis, customer segmentation.

2. Neural Networks (The Brain Mimic)

This is the heavy hitter behind Deep Learning and modern AI.

Imagine a massive web of interconnected switches:

  • Input comes in (a picture of a face)

  • Data passes through layers of these switches

  • Each layer looks for something: edges, shapes, eyes, noses

  • Final layer makes a decision: “This is Alex”

The algorithm learns by adjusting the strength of connections between switches. Stronger connections = more important patterns.

Used for: ChatGPT, image recognition, voice assistants, self-driving cars.

3. Gradient Descent (The Hiker)

This is the algorithm that trains neural networks.

Imagine you’re on a mountain at night, blindfolded, trying to reach the bottom (the best answer):

  • You feel the ground with your foot

  • If it slopes down, you step that way

  • You keep feeling the slope (Gradient) and stepping down (Descent)

  • Eventually, you reach the lowest point

This is how AI learns: it makes a guess, measures how wrong it is, and adjusts to be slightly less wrong next time. Repeat millions of times.

Why Do We “Blame” The Algorithm?

When people say “The Instagram Algorithm,” they mean a specific set of rules designed to maximize your engagement:

  • Input: Your past likes, watch time, shares

  • Algorithm: A formula predicting: “If we show this video of a Golden Retriever, there’s a 90% chance they’ll watch it.”

  • Action: Show the video

It feels like manipulation, but it’s just math predicting your behavior based on your history. The algorithm optimizes for what you click, not what’s good for you.

Common Algorithms in Plain English

  • Linear Regression: Draws a straight line to predict numbers. Used for: house prices, salary predictions.

  • Logistic Regression: Separates things into categories. Used for: spam vs. not spam, pass vs. fail.

  • Decision Trees: Asks yes/no questions to classify. Used for: loan approvals, medical diagnosis.

  • Random Forest: Many decision trees voting together. Used for: more accurate classifications.

  • Neural Networks: Layers of math mimicking brain connections. Used for: images, language, complex patterns.

The Limitations (Keeping It Real)

Algorithms aren’t perfect:

Garbage in, garbage out: An algorithm trained on bad data produces bad results.

Bias amplification: If historical data contains bias, the algorithm learns and repeats that bias.

Not truly “intelligent”: Algorithms follow patterns. They don’t understand meaning or context the way humans do.

Overfitting: Sometimes algorithms memorize training data instead of learning general patterns, then fail on new data.

The Takeaway

An algorithm is just a tool, the “how-to” guide for a computer.

  • It tells the computer how to process data

  • It defines how a model learns and improves

  • It’s math and logic, not magic or conspiracy

Understanding this takes the mystery out of it. When someone blames “the algorithm,” they’re really blaming a set of instructions doing exactly what it was designed to do: optimize for a specific goal.

Coming Up:
Now you know what Models are and how Algorithms train them. But what’s the point of all this learning? In the next edition, we’ll explore Predictive Modeling, how AI uses patterns from the past to predict the future.


AI for Common Folks. Making AI understandable, one concept at a time.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *