# ------------------------------------------------------------------ # Math 1225 Laboratory Assignment #2 January 27, 1999 # Treibergs # ------------------------------------------------------------------ # Compound Interest - - Another application of exponential growth # Suppose that you invest an amount P at time T=0 into an account that bears simple interest at # an interest rate R. Then at the end of the year, your account will hold an amount P*(1 + R). # At the end of T years it will hold P*(1+R)^T. If the interest is compounded N times a year, # then after the first year you will have P*(1+R/N)^N after T years P*(1+R/N)^(N*T). # To generate a table of the value of our investment, we will use one of MAPLE's programming # instructions, the DO-loop. For example to make a list of squares and cubes of the first six odd # integers. > for k from 1 by 2 to 11 do; k,k^2,k^3; od; # The DO-loop tells MAPLE to execute the statements between "do;" and "od;" for different # values of dummy variable k. MAPLE supports other looping instructions. To make a table of # interest, suppose that $100 is invested at 5%, 10% interest and you wish to see the # differences in your account after three years for compounding 2,4,6,8,10 and 12 times a year. > for N from 2 by 2 to 12 do;N,100*(1+0.05/N)^(N*3),100*(1+0.1/N)^(N*3);od; # If the number of compounding periods is taken to infinity we get continuous compounding. # MAPLE can do some limits, for example (x=infinity means x -> infinity) > limit(100*(1+0.05/x)^(x*3),x=infinity); > limit(100*(1+0.1/x)^(x*3),x=infinity); # Which turn out to equal > 100*exp(0.05*3),100*exp(0.1*3); > # Note that these numbers are close to monthly (N=12) compounding. We can simplify the limit # to a limit for the exponential function. Using the continuity we have that # limit( P*(1+R/N)^(N*T), N=infinity) = P * limit( (1 + R/N)^(N/R), N=infinity)^(R*T). # This limit turns out to be = P * e^(R*T) as we now explore. The key is the middle part # limit( (1+R/N)^(N/R), N=infinity); # If we let h = R/N then h -> 0 as N -> infinity. MAPLE knows the answer. > limit( (1+h)^(1/h), h=0); # We can see the limiting take place. If we set h = 1/k and let k increase. # > for k from 1 to 8 do;k,evalf((1+1/k)^k);od; # # THE NEARSIGHTED COW PROBLEM - A CALCULUS CLASSIC # In this section we use MAPLE to solve the problem 385[44] and 390[45] from section 7.6 # and 7.7. A cow is standing in a pasture x feet from a billboard on a vertical wall. The cow's # eye is 5.4' above the ground and the 5' billboard starts 8' above the ground. Find the vertical # visibility angle subtended by the billboard for general x. Find the visibility angle for # x=12.9. Then find the distance where the visibility angle is maximum. Plot the angle as a # function of x. # First, we let x denote the horizontal distance of the cow from the billboard (instead of b as in # diagram 8). Let c1 denote the height of the bottom of the billboard above the eye (in this case # c1=8'-5.4'=2.6') and c2 denote the height of the billboard. Then the visibility angle of the # billboard (Problem 3a) is > c1:=2.6;c2:=5;theta:= x->arctan((c1+c2)/x)-arctan(c1/x); # The angle when x=12.9' is (in radians!) > theta(12.9); # For problem 390[45], c1=2, c2=10. Thus > c1:=2;c2:=10; # Thus the angle function is > theta(x); # Differentiate, set equal to zero and solve > diff(theta(x),x); > q:=solve(%=0,x); # There are two roots. The second one, called q[2], is positive. We calculate the corresponding # angle. > maxpt:=[evalf(q[2]),evalf(theta(q[2]))]; # People were asking how to superimpose two plots of different colors. We end by plotting the # function theta(x) and plotting a point at the maximum. > P1:=plot(theta(x),x=0..10,color=navy): > P2:=plot([maxpt],x=0..10,color=red,style=point,symbol=circle): > plots[display]({P1,P2}); # PROBLEMS FOR LAB 2. # 1. Make tables which show the value of a $1 investment at the end of T years, where T = # 1,2,3,...,10 for various accounts for which interest is compounded biannually, monthly and # continuously for both interest rates of 6% and 12%. Compare the various accounts. # 2. Make a table that shows the limit tendency of f(h) = (1 + h)^(1/h) as h -> 0. Set h = # 2^(-k) and print out k, f(2^(-k)), and the error f(2^(-k))-exp(1) for k=1..10. # Use MAPLE'S limit instructio to find the limit of f(2^(-z)) as z->infinity. # 3a. Derive the expression for theta, the vertical angle subtended by the billboard in terms of # x,c1,c2. # b. Suppose that the cow's eye is 5.4' above the ground and the 5' billboard starts 8' above the # ground. Find the distance x that has the maximum visibility angle of the billboard. What is # the maximal angle? # c. Plot the visibility angle against the distance x and label the maximum point. > Pa:=plot([[0,0],[5,2],[5,0],[0,0],[5,5],[5,2]],axes=none): > Pb:=plot([2*cos(t),2*sin(t),t=0.4..0.8],title=`Nearsighted Cow Problem`): > Pc:=plots[textplot]({[2.3,1.5,`theta`],[5.4,1,`c1`],[5.4,3.5,`c2`], [2.6, -0.2,`x`]}): > plots[display]({Pa,Pb,Pc},scaling=constrained);