Theory of Computation Homework 3