Regarding PS1 solution for bisection search, I think the answer is more complex than it should be. Monthly payments can only be measured in cents. But here, it calculates monthly payments with numerous numbers after decimal. Once the "optimal" monthly payment is found, it manually rounds it and have to redo all the calculation with the rounded value which is a waste of time. Why not rounding the value of monthly payments at the start of the loop since it can only be in cents ? See http://dpaste.com/hold/1323860/ for my code.

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

well, what do you think the banks do? do you think they round in the intermediate steps of a string of calculations or do you think the only round the final answer? what do you think is mathematically correct ? how much time is being wasted? is your solution really-really slow? how many iterations does it take? are you getting a correct answer? with initial balance of 1000 and interest of .1 i get a minimum payment of $87.19 you get a minimum payment of $87.91 think i'll go have a burger

You lost me somewhere. I posted the official solution at dpaste : http://dpaste.com/1324320/ With an initial balance of 1000 and interest of 0.1 : 1) With the official solution, i find a minimal payment of $87.92 and a balance of -$0.05 2) With my code, i find a minimal payment of $87.92 and a balance of -$0.05 I dont really see how you get $87.19 ? I also double-checked my answers for test cases. I get the same minimal payment, but have a $0.01 difference on the final balance ($0.11 instead of $0.1 in case 1, and $0.11 instead of $0.12 in case 2). For your info, this difference is down to the fact that the solution actually rounds everything before doing calculation (and more precisely, rounding the interest value before substracting it to the balance, line 39). If you get rid of this round() and just round the final answers (wich seems more logical), you find a final balance identical to my solution ($0.11 and $0.11). From a theoretical and mathematical point of view, I dont see any differences between my solution and the official one. Thats why I posted.

mine calculates a lower pmt because it subtracts the payment before adding interest - i am making my payment at the beginning of the month. but does any of that really matter in the context of the lesson? what is the purpose of this problem set? what computational ideas are we supposed to learn?

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.