Solution to problem 3.
Solution to problem 4.