The goal of this activity is to use the Bisection Method or Newton’s Method to determine the interest rate (to within an error of 0.0001) being charged in order to purchase this refrigerator. Assume that the interest rate is compounded monthly. For simplicity, ignore any taxes or the $15 promotion. How much would you have to pay to Rent-A-Center in the form of interest? Discuss how the Rent-a-Center payment plan would compare with simply saving$95.30 per month until you can afford to buy the same refrigerator.

1

In [1]:

import numpy as np import matplotlib.pyplot as plt

2

In [2]:

def bisection(a,b,f,err): #This is the code for the bisection method. c = (a+b)/2 while c - a > err: if f(c) == 0: return c elif f(a)*f(c) > 0: a = c else: b = c c = (a+b)/2 return c

3

In [3]:

x =np.linspace(1,2,1000) #We are graphing our compound interest formulaa to get a sense of our boundards a and b for our bisection code. y = 787.5*(1+x/12)**19 - ((-95.3*12)/x)*(1-(1+x/12)**19) plt.plot(x,y) plt.show()

4

In [4]:

def f(x): #We are defining the function to which the bisection code will run on. return 787.5*(1+x/12)**19 - ((-95.3*12)/x)*(1-(1+x/12)**19)

5

In [5]:

bisection(1,2,f,0.0001) #Interest Rate.

6

1.22222900390625

It would appear in every persons best interest to buy the refrigerator one time, then to pay the monthly layaway cost. If you can't buy it one time but have about 100 bucks to part with every month then the layaway is a good idea. The layaway cost about double the original price.

7

8

In [ ]:

9

In [ ]:

10

In [ ]:

11