Complexity Theory (when problems are hard)

Three cliffs, drawn side by side: a cost that calls smaller copies of itself, a cost that’s cheap almost every time and expensive once in a while, and a cliff nobody has ever found a way around.
Before you start. You already know how to read a cost off a line of code - count the loops, and see whether doubling the input doubles the work (Complexity & Big-O). This lesson is the three cases where that trick alone isn’t enough: a job that calls smaller copies of itself, a job that’s fast almost every time and slow once in a while, and a job nobody has ever managed to speed up at all.