exercise 3.5 monte carlo integration