Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 19 Online
OpenStudy (anonymous):

ps4d. I have a, b, and c correct, but my d is off after the second decimal place. can anyone figure our why? also I'm not quite understanding what epsilon is. Could someone please help with that too?

OpenStudy (anonymous):

That's easy. Epsilon is the money left in your retirement account at the end of your retirement. In this case it´s close to zero, since you want to spend all your savings and leave nothing to your children (hence epsilon is 0.01). My answer is also off after the second decimal. I don't have an accurate answer but to tell you even the program code states that the value found ought to be close to 1229.95548986

OpenStudy (anonymous):

I understand that it states it can be close, but for a, b, and c my answers were basically the same as the answers given so i thought that d should be that same way. By the way, thanks for the epsilon help

OpenStudy (vaboro):

my answer to ps4d.py test is exactly 1229.95548986

OpenStudy (vaboro):

double_o_seven: give us your code, please, so that we can help

OpenStudy (anonymous):

what was your choice of starting high val and low val, vaboro?

OpenStudy (vaboro):

jomarnavarro: if you mean the findMaxExpenses() function then starting low val is 0 and starting high val is the amount of money saved by the end of the work period or in the start of retirement period this choice of starting values basically means that yearly expenses during retirement period can be anything between 0 and the amount of money saved during work period I use the following variable declarations in my code: expenses_low = 0 expenses_high = retirement_fund The code is at the following URL: http://pastebin.com/sXpw7Y9E

OpenStudy (anonymous):

I ran your code, and it gives exactly the same amount in the template. Mine gives a result a bit off, as I said earlier, but then again, who gets fractions of cents these days. I'd say it's significative enough. by the way, my code can be seen @ http://dpaste.com/550262/ Best Regards, Omar

OpenStudy (anonymous):

Oops, I forgot to post my code. Sorry 'bout that. However, I just got it figured out and I got the same answer as the template so I think I'm good to go. Thanks anyway!

OpenStudy (vaboro):

double_o_seven: I think I was wrong about your sense of humor

OpenStudy (vaboro):

jomarnavarro: what does math.fabs() method do?

OpenStudy (anonymous):

\[\nu \cos^{-1} \]

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!