The Library · free to read

A First Taste of Algorithms

The Computing & Machine Learning Foundation

An algorithm is just a recipe a computer follows, one step at a time. This book builds that idea up from scratch — how to count the steps a method takes (and why that suddenly matters when the numbers get big), how puzzles made of dots and lines get solved, how a little randomness can actually help, and how a program can roll “downhill” to find the best answer. By the end you've met the first simple programs that learn from examples. Nothing is taken on faith; every idea is something you can run and watch happen.

Start reading → PDF EPUB

32chapters
94pages
56kwords

Contents

  1. What's in This Book
  2. Two Questions
  3. Problem Set 1
  4. Lab 0: Talking to the Machine
  5. Lab 1: Counting Steps
  6. The Greedy Idea
  7. Problem Set 2
  8. Lab 2: The Cost of Confidence
  9. The Procedure That Calls Itself
  10. Problem Set 3
  11. Lab 3: The Visible Staircase
  12. Recursion That Remembers
  13. Problem Set 4
  14. Lab 4: The Notebook
  15. Maps, Mazes, and Networks
  16. Problem Set 5
  17. Lab 5: Dots and Lines
  18. Interlude: The Other Exponential
  19. Order, and Its Price
  20. Problem Set 6
  21. Lab 6: Counted and Clocked
  22. The Algorithm That Flips Coins
  23. Problem Set 7
  24. Lab 7: The Honest Die
  25. Learning as an Algorithm
  26. Problem Set 8
  27. Lab 8: Downhill
  28. Building the Learner
  29. Problem Set 9
  30. Lab 9: The Engine
  31. Epilogue: The Edge of the Map
  32. Going Deeper

Interactive labs

10 labs to work through alongside the chapters. Each one downloads from this site; "open in Colab" runs it in your browser with a free Google sign-in, nothing to install.

  1. Lab 00 · Talking to the Machine download .ipynb · open in Colab
  2. Lab 01 · Counting Steps download .ipynb · open in Colab
  3. Lab 02 · The Cost of Confidence download .ipynb · open in Colab
  4. Lab 03 · The Visible Staircase download .ipynb · open in Colab
  5. Lab 04 · The Notebook download .ipynb · open in Colab
  6. Lab 05 · Dots and Lines download .ipynb · open in Colab
  7. Lab 06 · Counted and Clocked download .ipynb · open in Colab
  8. Lab 07 · The Honest Die download .ipynb · open in Colab
  9. Lab 08 · Downhill download .ipynb · open in Colab
  10. Lab 09 · The Engine download .ipynb · open in Colab