The Input: Raw Materials

Every algorithm starts with something to work on. This is the **Input**, or the "raw materials." It can be a list of numbers to sort, a photo to analyze, or millions of customer data points.

The Process: A Step-by-Step Recipe

This is the algorithm itself. To make it concrete, let's use the analogy of a recipe.

Analogy: The PB&J Algorithm

An algorithm is simply a step-by-step set of instructions for completing a task.

Ingredients (The Data)

  • 2 Slices of Bread
  • Peanut Butter & Jelly

Instructions (The Algorithm)

  1. Lay two slices of bread flat on a surface.

  2. Spread peanut butter evenly on one slice.

  3. Spread jelly evenly on the other slice.

  4. Place the two slices together, spreads facing inward.

The Translation: From Recipe to Code

Computers follow the same logic, but their "recipe" is written in code.

// This is a simplified algorithm in pseudocode
function make_sandwich(bread1, bread2, pb, jelly) {
    spread(bread1, pb);
    spread(bread2, jelly);
    return combine(bread1, bread2);
}

The Output: The Finished Product

After the process is complete, you get the **Output**. It's the sorted list, the tag on the photo, or the movie recommendation. The input has been transformed into a useful result.

The Critical Difference: Simple vs. AI Algorithms

A Simple (Deterministic) Algorithm

Think of a calculator. Its algorithm for addition is fixed. It follows the exact same steps every time and will always give the same output for the same input. It is reliable but cannot learn or adapt.

🧠A Learning (AI) Algorithm

Think of a Netflix recommender. Its algorithm is designed to **learn from data**. Its "rules" change and adapt based on your viewing history. This ability to modify its own process is the key difference that defines AI.

The Foundation of AI

Understanding this distinction--between rigid, rule-following algorithms and adaptive, learning algorithms--is the single most important step to understanding what makes Artificial Intelligence so revolutionary.

← Back to AI Glossary

Next: How AI Learns with Backpropagation →