Exercise 5
Cost Funtion