Solution to assignment 1 problem 5.