Exercises from Understanding Computation book (by Tom Stuart)