finish the exercise 1 of machine learning in coursera