Once Upon an Algorithm
Audiobook & Ebook

Once Upon an Algorithm by Martin Erwig | Free Audiobook

By Martin Erwig

Narrated by Walter Dixon

🎧 10 hours and 48 minutes 📘 Tantor Media 📅 June 12, 2018 🌐 English
🎧 Listen Free on Audible 📖 Read on Kindle

Free 30-day trial · Cancel anytime

About This Audiobook

How Hansel and Gretel, Sherlock Holmes, the movie Groundhog Day, Harry Potter, and other familiar stories illustrate the concepts of computing.

Picture a computer scientist, staring at a screen and clicking away frantically on a keyboard, hacking into a system, or perhaps developing an app. Now delete that picture. In Once Upon an Algorithm, Martin Erwig explains computation as something that takes place beyond electronic computers, and computer science as the study of systematic problem solving. Erwig points out that many daily activities involve problem solving. Getting up in the morning, for example: You get up, take a shower, get dressed, eat breakfast. This simple daily routine solves a recurring problem through a series of well-defined steps. In computer science, such a routine is called an algorithm.

Erwig illustrates a series of concepts in computing with examples from daily life and familiar stories. Hansel and Gretel, for example, execute an algorithm to get home from the forest. The movie Groundhog Day illustrates the problem of unsolvability; Sherlock Holmes manipulates data structures when solving a crime; the magic in Harry Potter’s world is understood through types and abstraction; and Indiana Jones demonstrates the complexity of searching.

Along the way, Erwig also discusses representations and different ways to organize data; “intractable” problems; language, syntax, and ambiguity; control structures, loops, and the halting problem; different forms of recursion; and rules for finding errors in algorithms. This engaging book explains computation accessibly and shows its relevance to daily life. Something to think about next time we execute the algorithm of getting up in the morning.

🎧 Listen Free on Audible

Free 30-day trial · Cancel anytime

Quick Take

  • Narration: Walter Dixon reads Erwig’s playful, erudite text with a professional ease that honors the book’s dual register, accessible to curious non-specialists but intellectually substantive throughout.
  • Themes: Computation as systematic problem-solving, everyday algorithms, the deep structure of thinking
  • Mood: Warm and genuinely delightful, like a brilliant professor who also happens to be a great dinner guest
  • Verdict: A rare computer science book that earns its clever premise: Erwig uses Hansel and Gretel, Sherlock Holmes, and Groundhog Day to illuminate real CS concepts, and it works.

There’s a version of this book that could have been smug. The pitch is right there in the subtitle: how familiar stories illustrate the concepts of computing. Taking fairy tales and beloved films and saying look, this is actually a data structure is the kind of move that can tip easily into the condescension of making things unnecessarily clever. Martin Erwig doesn’t do that. Once Upon an Algorithm is genuinely illuminating, not because the stories are illustrations of concepts but because Erwig demonstrates that the concepts were always already present in the stories, that systematic problem-solving is so fundamental to human thought that our most enduring narratives encode it without meaning to.

I listened to this over two evenings in what became an unexpectedly absorbing sit. Walter Dixon narrates with a warmth and intelligence that suits Erwig’s prose well. Erwig writes like someone who finds this material genuinely wonderful rather than merely important, and Dixon’s reading carries that quality. This is one of the better pairings of text and narrator in the CS popularization space.

The Hansel and Gretel Algorithm and What It Actually Demonstrates

The opening extended example uses Hansel and Gretel’s pebble-marking strategy to introduce the concept of an algorithm as a finite series of well-defined steps that solves a recurring problem. Erwig is precise about what makes something an algorithm rather than a vague procedure: the steps must be unambiguous, the solution must terminate, and the method must work generally rather than just in one specific instance. Gretel’s improvised strategy of using breadcrumbs instead of pebbles on the return journey is then used to illustrate what happens when an algorithm’s assumptions are violated, which the birds helpfully demonstrate by eating the breadcrumbs. It’s elegant, and it teaches the concept with more precision than most textbooks manage.

The Groundhog Day analysis, used to illustrate the problem of unsolvability and the halting problem, is particularly well-handled. Erwig doesn’t oversimplify: he uses the film to gesture at a genuinely deep question in theoretical computer science, namely whether a computation will eventually stop, and does so in a way that doesn’t require the listener to have any prior familiarity with Turing machines or computability theory. The Indiana Jones chapter on search complexity is similarly well-calibrated, using the temple search sequences to distinguish between different search strategies without ever becoming a dry taxonomy of search algorithms.

Where the Metaphors Hold and Where They Reach

Not every narrative-concept pairing works equally well. The Harry Potter chapters on types and abstraction are probably the most strained. Types and type systems are genuinely subtle concepts, and the connection to magical constraints in Rowling’s world is interesting but requires Erwig to do more explanatory work than the other chapters, where the connection feels more natural. Listeners who don’t already have some intuition about what typing means in programming contexts may find these sections less satisfying than the earlier chapters.

Erwig also covers representations and data organization, recursion, control structures, and rules for error-finding in algorithms. The recursion coverage is strong and uses familiar examples to demonstrate how a function that calls itself differs from an infinite loop. The error-finding chapter is perhaps the most practically useful for listeners who are actually learning to program, because the framework Erwig provides for locating errors systematically rather than randomly is transferable to real debugging practice.

Who Gains the Most from Ten Hours with Erwig

At 4.5 stars across 110 ratings, this is a title with genuine listener satisfaction behind it. The positive reviews describe it as breaking down algorithms in precise and clear language and as showing the relevance of CS concepts to everyday life. Both descriptions are accurate. The audience that benefits most is exactly who you’d expect: curious non-specialists, people considering a career change into software or data fields who want conceptual grounding before committing to a coding bootcamp, liberal arts students approaching computer science for the first time, and experienced professionals in adjacent fields who have always wanted a clearer mental model of what programmers are actually doing.

Listeners with existing CS backgrounds will find this more pleasurable than instructive, which is fine. Erwig isn’t writing for people who already know what a hash table is. But the precision of his definitions means that even experienced developers will occasionally notice him pinning down a concept more carefully than they habitually do, which has its own quiet satisfaction.

Frequently Asked Questions

Does Once Upon an Algorithm require any prior programming experience, or is it genuinely accessible to non-technical listeners?

It genuinely requires no prior programming knowledge. Erwig is careful to define every CS concept from first principles using the narrative examples before introducing any technical terminology. Listeners with no computing background consistently report finding the book clear and engaging. The challenge, if any, comes from the later chapters on more abstract concepts like types and unsolvability, which are harder to grasp intuitively regardless of background.

Is the Groundhog Day chapter actually a useful explanation of the halting problem, or is it just a clever hook?

It’s a genuinely useful conceptual bridge. Erwig uses the film’s premise of a day that cannot end to introduce the idea that some computational processes cannot be proven to terminate, which is the intuition behind the halting problem. He doesn’t derive the full formal proof, but he gives the listener enough to understand why the question matters and why it’s not trivially resolvable.

How does Walter Dixon’s narration handle the more technical passages compared to the narrative sections?

Dixon maintains an even warmth throughout that keeps the technical passages from feeling like lectures. His pace adjusts naturally between the storytelling sections and the concept-building sections, and the result is a listening experience that doesn’t require you to shift mental gears as sharply as you might expect from a book that moves between fairy tales and theoretical computer science.

Does the book cover modern computing topics like machine learning or artificial intelligence?

No. Erwig’s focus is on foundational computer science concepts: algorithms, data structures, recursion, control flow, and computational complexity. Machine learning and AI are outside the scope. This is a book about how computing works as a mode of systematic thinking, not about any specific contemporary application of that thinking.

Ready to listen?

🎧 Listen to Once Upon an Algorithm for free

Free 30-day trial · Cancel anytime

What Listeners Are Saying

★★★★★

Great explanation for beginners

I'm new to learning about computer science and this books is great in breaking down what an algorithm is and how it works. The language of the book is precise and clear, which was really helpful in defining the parts of the algorithm.

– Amazon Customer
★★★★★

An extraordinary book

Possibly one of the best books that I have ever read that shows the relevance of computer science concepts to everyday life and immortal fairy tales .

– R. Naidu
★★★★★

Perfect condition

Movie references were great – I'll be doing an Amazon search!

– ss44smith
★★★★☆

Computer Science student enjoyed this book but parts of it were inconsistent and confusing.

I've been trying to learn computer programming recently and realized that I needed a good understanding of the computer science fundamentals. So I was drawn to buy this book because I appreciate good storytelling. Furthermore, the fundamentals of computer science explained in story form??? Sign me up! I was pretty…

– JStef
★★★★★

Love it

If i read this book earlier, i believe i face less problem doing my phd. Highly recommended not only for non ITs but also to those doing CS.

– Whoisme

Start Listening: Once Upon an Algorithm


Free 30-day trial · Cancel anytime

Alexandra Reed

Written by Alexandra Reed

Founder & Literary Critic