This document summarizes an algorithm writing technique using invariants inspired by Professor Dijkstra's style of proving and deriving algorithms. It explains what invariants and predicates are, and how to use Hoare triples to prove correctness of while loops. An example is provided to derive an algorithm to calculate 2^n using an invariant. Exercises are provided to practice deriving algorithms for various problems like calculating sums, finding maximums, sorting arrays, and more using invariants.