Algorithms in Five Levels


Algorithms in Five Levels

Corey
Alright, Anna, today we're tackling algorithms, and I think a great place to start is just watching how a computer science professor explains them to a kid. He asks a child what a computer is, and she says it's like a rectangle you can type on. Then he breaks down the CPU as the brain and RAM as memory where programs live while you're using them.

Anna
That's really accessible. And then he asks if she knows what an algorithm is. She says it's a list of instructions, which is spot-on. So he turns it into a game: he pretends to be a robot and has her give step-by-step instructions to make a peanut butter sandwich. The key lesson is precision — when she says 'grab the bread,' he grabs all of it. You have to be exact.

Corey
Exactly. And that ties into why algorithms matter in the real world — searching on Google, following a recipe, even a bedtime routine. Everything is an algorithm if you think about it. Now, when he moves to a teenager, he brings up alphabetized contacts on a phone. Why do they bother sorting them? Because searching randomly takes forever. That's where different algorithms come in.

Anna
Right, the teen initially suggests flipping through the phone book one page at a time — that's linear search. Then they try going two pages at a time, but that's risky because you might skip over the name. So they land on the smartest method: open to the middle, check if your name is left or right, and tear the problem in half. That's binary search, and it's way faster — only about 10 steps for 1,000 pages.

Corey
And that's the divide-and-conquer approach. The professor even mentions recursion, where an algorithm calls itself on smaller and smaller pieces. Then he talks to a college student who's studied computer science. She brings up bubble sort, which focuses on local problems — swapping adjacent numbers if they're out of order, and repeating until everything's sorted. It's simple but not the most efficient.

Anna
Yeah, and from sorting they move to search engines and social media. The student mentions TikTok's For You page and recommendations based on what you like. The professor points out that at that scale, you can't hard-code every rule — you need machine learning, like neural networks, that learn from your behavior to predict what you'll want to see.

Corey
Right, and that leads into the PhD student level. She studies robot learning and talks about how algorithms are about efficiency and connecting threads. For game playing, there's a difference between classical algorithms like A* search — which just explores all possibilities — and learned agents like AlphaGo that improve with more data. The core idea is similar: data goes in, and an objective function tells you what to optimize for.

Anna
She also brings up deepfakes and how algorithms can learn your voice and appearance from lots of data. And she predicts algorithms will just keep integrating further into daily life — from train routing to your phone — but there's a downside: companies might see us as just wallets with eyes. The professor later echoes that concern.

Corey
Now the expert level — Chris Wiggins from Columbia and the New York Times. He defines a data scientist's job as developing and deploying algorithms as data products, which means not just the math but also software engineering and organizational integration. And he connects AI to data science: a chatbot is a special case of generative AI, which uses large language models, which is a subset of machine learning.

Anna
He says we're still in the 'alchemy' phase — we build these huge models that work amazingly, but we don't fully understand why deep neural networks generalize so well. Is that a problem? He says it has risks, but there's precedent in science where things work before we understand them. And he makes a great point: you don't need to know organic chemistry to drive a car, so you don't need to know every algorithm detail to use tools like ChatGPT.

Corey
But he doesn't dismiss fundamentals. He notes that many optimization algorithms were used for years before people realized the proof was wrong — yet they still worked. So understanding fundamentals is loosely coupled to progress. And for anyone worried that AI will make computer science obsolete, he says no — training and fine-tuning LLMs are themselves algorithms. The field is just evolving, not disappearing.

Anna
So the big takeaway is that algorithms range from the simplest step-by-step instructions to the most advanced machine learning models. And whether you're a kid making a sandwich or a PhD designing a robot, the core idea is the same: a systematic way to solve a problem. The only difference is complexity and the need for efficiency.

Corey
Exactly. And as the professor says at the end, every algorithm you learn brings the most advanced ones closer. So it's not about knowing everything upfront — it's about building up, one step at a time. And that, in itself, is an algorithm for learning.

Ask anything
We've read this whole study set, so questions about it get the best answers.