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.
Contents
- What's in This Book
- Two Questions
- Problem Set 1
- Lab 0: Talking to the Machine
- Lab 1: Counting Steps
- The Greedy Idea
- Problem Set 2
- Lab 2: The Cost of Confidence
- The Procedure That Calls Itself
- Problem Set 3
- Lab 3: The Visible Staircase
- Recursion That Remembers
- Problem Set 4
- Lab 4: The Notebook
- Maps, Mazes, and Networks
- Problem Set 5
- Lab 5: Dots and Lines
- Interlude: The Other Exponential
- Order, and Its Price
- Problem Set 6
- Lab 6: Counted and Clocked
- The Algorithm That Flips Coins
- Problem Set 7
- Lab 7: The Honest Die
- Learning as an Algorithm
- Problem Set 8
- Lab 8: Downhill
- Building the Learner
- Problem Set 9
- Lab 9: The Engine
- Epilogue: The Edge of the Map
- 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.
- Lab 00 · Talking to the Machine download .ipynb · open in Colab
- Lab 01 · Counting Steps download .ipynb · open in Colab
- Lab 02 · The Cost of Confidence download .ipynb · open in Colab
- Lab 03 · The Visible Staircase download .ipynb · open in Colab
- Lab 04 · The Notebook download .ipynb · open in Colab
- Lab 05 · Dots and Lines download .ipynb · open in Colab
- Lab 06 · Counted and Clocked download .ipynb · open in Colab
- Lab 07 · The Honest Die download .ipynb · open in Colab
- Lab 08 · Downhill download .ipynb · open in Colab
- Lab 09 · The Engine download .ipynb · open in Colab