Module 1 · Lesson 4

Lesson 4 · Algorithms

Writing steps precise enough that someone else gets the same result.

An algorithm is a sequence of steps that reliably produces a result. The difficulty is precision: humans fill gaps with assumed context automatically, and computers do not. Teaching algorithms is largely teaching students to notice their own assumptions.

Learning objectives

  • Write an algorithm precise enough for another person to follow exactly
  • Identify assumed steps and unstated context in your own instructions
  • Test an algorithm by executing it literally
  • Recognize that multiple correct algorithms can exist for one problem

Three properties of a working algorithm

  1. Unambiguous — every step means exactly one thing to the person following it.
  2. Ordered — the sequence matters and is stated explicitly.
  3. Finite — it ends, and it is clear when it has ended.

Lesson resources