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

can anyone help me to understand the concept behind problem set 1

OpenStudy (e.mccormick):

For which year of 6.000?

OpenStudy (anonymous):

2010

OpenStudy (anonymous):

sorry its 2011

OpenStudy (anonymous):

Is this the one about debt payoff?

OpenStudy (anonymous):

yeah

OpenStudy (anonymous):

I think they want you to do using an estimation technique but I used an exact method because I have a business background. The formula for finding a payment amount in order to pay off a debt in n periods is: pmt = round((bal * per)/(1-(1+per) ** -n),2)

OpenStudy (anonymous):

Where per is the periodic interest rate (APR / 12)

OpenStudy (anonymous):

from your business background would you elaborate calculation of minimum interest rate please coz i have no biz background

OpenStudy (anonymous):

Sure. The concept behind that formula is that each month you are paying interest on your new balance which includes added interest from last period and subtracts your payment. So, for simplicity sake let's take a 12% APR which works out to 1% per month (this is your periodic rate). If I borrow $100 at 12% interest compounded monthly (hence dividing the APR by 12) I would accrue $1 in interest the first month which is 1% of $100. But next month I would owe 1% of $101 because of capitalized interest. 1% of $101 is $1.01 which is then added to the third month balance, etc... Specifically, in the equation when you take 1 + per you are adding the interest to the balance. Had I just said bal * per I would end up with just the interest but I want the total amount of balance and interest. Then by taking that (1+per) to the nth power I am accounting for the increasing balance month to month as opposed to simple interest which is accrued only once in a period (i.e. 12% of $100 with simple interest works out to be merely $12 at year's end.)

OpenStudy (anonymous):

And to further facilitate understanding here is my very short and simple code that does exactly what the PMT function would do in Excel. def payoff(bal,apr,n): per = apr / n pmt = round((bal * per)/(1-(1+per) ** -n),2) print "Payment needed to pay off debt in",n,"months:",pmt

OpenStudy (anonymous):

this might be silly but i need the anxa: what is a credit card? i have no biz background as i said earlier and this moght be my 1st step to understanding ps1

OpenStudy (anonymous):

Are you asking what a credit card is?

OpenStudy (anonymous):

yep

OpenStudy (anonymous):

It is a debt with a financing company where a line of credit is issued that you promise to pay back, typically with interest.

OpenStudy (anonymous):

so when doing calculations involving credit card what do you have to keep in mind

OpenStudy (anonymous):

Total balance outstanding (due), Annual Percentage Rate (APR), and number of periods to pay off the debt. If the interest were compounded weekly the periodic interest rate would be APR / 52 and n would be 52.

OpenStudy (anonymous):

and the methods of tackling this problem are similar with those of commercial arithmetics

OpenStudy (anonymous):

Absolutely. It's all math. Financial math gets tricky but it is still arithmetic.

OpenStudy (anonymous):

thanks a lot. do you hv a problem like the one in ps1 that we can go through?

OpenStudy (anonymous):

I did a bit of a take on PS2. I saw what they wanted and made it something a little cooler that I could see myself reusing. I created an amortization calculator that indicates how much money you would owe on a debt after any given number of periods with specified interest rate and specified payment. I will attach the file and then we can discuss. Just let me know what questions you have. I added a few things in there to facilitate my testing, for example I have the entire thing on a loop that asks if you want to do it again so I don't need to keep rerunning the program.

OpenStudy (anonymous):

thanks a lot coz with your help I have tackled problem 1(paying the minimum) and will send you my code as soon as I finish debugging it

OpenStudy (anonymous):

this is my code for problem 1,if you find any errors or anything out of the topic please notify me

OpenStudy (anonymous):

That looks great. My two recommendations would be to add a round statement to you outputs so that it cuts it at two decimals and then perhaps for easy readability add a print "" statement at the bottom of each loop to separate the data visually.

OpenStudy (anonymous):

thanks

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!