Solutions to problems 6,7 also, as in hw1 pdf file