Problem set 4 for theoretical computer science course from Udacity