Anybody can give me a suggestion about how to make a condition for the binary search to finish searching. Problem4 - problem set 4, please !
" ... such that at the end of your retirement, the absolute value of the amount remaining in your retirement fund is less than epsilon (note that you can overdraw by a small amount). ..."
yes, but when we change the value of Low and High?
ideally you would have zero dollars left - but sometimes trying to get to some absolute/exact number is impossible so we are using the variable epsilon as a tolerance. So at the end of retirement you want zero dollars plus or minus epsilon left - the band of acceptable values is -epsilon to +epsilon. At the end of retirement if the balance is less than -epsilon then you are spending too much. At the end of retirement if the balance is greater than +epsilon then you are spending too little.
Join our real-time social learning platform and learn together with your friends!