What is an algorithm even??

The goal of this article is to make the word “algorithm” less scary for everyday people. The word has been bandied around in a (justifiably) negative context for the past several years, but the negative association we have with the word “algorithm” closes us off from the possibility of using them to reduce our mental load, facilitate the delegation of everyday tasks, or cultivate a more diverse generation of technologists.

What is an algorithm? An algorithm is a step-by-step set of instructions to accomplish a task.

Think of it like a recipe. When you bake cookies, you follow specific steps in a particular order: mix ingredients, form dough balls, bake at a certain temperature for a set time. That's essentially an algorithm!

Algorithms are everywhere in our daily lives:

  • The navigation app that finds the fastest route to your destination
  • The way social media decides which posts to show in your feed
  • How your phone sorts your contacts alphabetically
  • The method your washing machine uses to cycle through different wash phases

What makes algorithms powerful is that they can be repeated reliably to get consistent results. Once someone figures out an efficient way to solve a problem, that solution can be turned into an algorithm and used over and over.

In computing, algorithms are the brains behind everything from simple calculations to complex artificial intelligence. They're written as code, but the core idea remains the same: follow these steps, in this order, to accomplish this goal.

So next time you hear someone mention an algorithm, just remember it's simply a recipe for solving a particular problem!

Now let's examine an algorithm that you most likely have been doing without you knowing that it's an algorithm: binary search

Binary Search: Like Finding a Chapter in a Book

Imagine you're looking for Chapter 17 in a thick book with 40 chapters. Here's how binary search works:

Instead of flipping through every single page from the beginning (which would take forever), you'd probably open the book somewhere in the middle, right?

Let's say you open to Chapter 20:

  • You see you've gone too far (Chapter 20 is after Chapter 17)
  • So you know Chapter 17 must be somewhere in the first half of the book
  • You can completely ignore the second half of the book now!

Next, you open to the middle of that first half, maybe landing on Chapter 10:

  • You see you haven't gone far enough (Chapter 10 is before Chapter 17)
  • So Chapter 17 must be somewhere between Chapters 10 and 20
  • You can now ignore everything before Chapter 10

You open to the middle of that remaining section, maybe Chapter 15:

  • Still not far enough!
  • So Chapter 17 must be between Chapters 15 and 20

One more flip to around Chapter 17 and... found it!

That's binary search in a nutshell - each time you check, you eliminate half of the remaining possibilities. It's super efficient because even with thousands of chapters, you'd find your target in just a handful of checks.

This is why phone books and dictionaries work so efficiently - we instinctively use binary search without even thinking about it!

Why Efficiency Matters: Doing Less Work

Here's the thing about computers and efficiency (and maybe this even applies to humans):

We can't magically make the individual steps faster (that's up to hardware engineers), but we can absolutely take fewer steps to solve a problem.

Think about our chapter-finding example:

  • The slow way (linear search): checking every chapter in order from 1 to 40 could take up to 40 checks
  • The smart way (binary search): dividing the book in half each time finds the chapter in just 6 checks or fewer

That's a huge difference! And it gets even more dramatic with larger numbers. If you had 1 million chapters, linear search might take a million steps, while binary search would find your chapter in about 20 steps.

This Applies to Real Life Too

This "do less work" principle is super practical in everyday situations:

  • Grocery shopping: Organizing your list by store layout means you won't backtrack through aisles (saving steps)
  • Cooking: Prepping all ingredients before starting means you're not scrambling while something burns (saving time)
  • Packing for travel: Using a checklist prevents the need to unpack and repack when you forget something (saving effort)

The Real Magic

The best part is that this principle becomes more valuable as problems get bigger:

  • Finding a book in a small bookshelf? Any method works fine.
  • Finding a book in a massive library? An efficient system makes the difference between seconds and hours.

This is why companies like Google and Amazon obsess over algorithm efficiency. When you're handling billions of searches or packages, even tiny improvements in efficiency create enormous real-world benefits.

So whether it's in computing or daily life, the question isn't "How can I go faster?" but rather "How can I do less unnecessary work?"

Next steps

Now that you know what an algorithm is, in the next blog post, we'll discuss what we talk about when we say The Algorithm.

Previous
Previous

What People Mean When They Say "The Algorithm"

Next
Next

Less Litter