Mathematica worksheet for question 1