Do problem 6 in Python(2, using numpy).