Homework 2 -- Solutions

The assignment:

The solutions: