Investing with discrete dynamical systems BRIEF ABSTRACT Comparing various investment plans in which we pay a broker's fee for finding higher interest rates using discrete dynamical systems. GENERAL INFORMATION FileName: MAXSTUFF Full title: Optimization of solutions to discrete dynamical systems. Last Revision Date: 26 May 1996. Developer: Brian J. Winkel, Department of Mathematical Sciences, United States Military Academy, West Point NY 10996 USA. Phone: 914-938-3200. Email: ab3646@usma2.usma.edu. FAX: 914-938-2409. Contact: Brian J. Winkel, Department of Mathematical Sciences, United States Military Academy, West Point NY 10996 USA. Phone: 914-938-3200. Email: ab3646@usma2.usma.edu. FAX: 914-938-2409. Aaron D. Klebanoff, Department of Mathematics, Rose-Hulman Institute of Technology, Terre Haute IN 47803 USA. Phone: 812-877-8151. Email: Aaron.Klebanoff@Rose-Hulman.Edu. FAX: 812-877-3198. Support: The production of this material is supported by the National Science Foundation under Division of Undergraduate Education grant DUE-9352849: Development Site for Complex, Technology-Based Problems in Calculus with Applications in Science and Engineering and the Arvin Foundation of Columbus IN. STATEMENT OF PROBLEM Investment Strategies - first order DDS We go to our investment analyst and she says she has a new investment program. Basically we invest our money in an interest bearing account at the rate of $100 per year with an initial investment of $100. The account pays interest at the end of each year. We plan to invest for 12 years. She says we can pick our annual interest rate(!!) - up to a maximum rate of 20% per year or r = 0.20. There is one caveat. At the end of 12 years if we select annual interest rate r (e.g., r = .05 is 5% annual interest) then we have to pay a penalty of 90,000 r^2. Thus for example if we invest our money at r = .05 then we shall have a penalty of 90,000(.05)^2 or $225.00. She says think of it as a "brokerage fee" for getting the higher rate. (a) Set up a discrete dynamical system to model our money in the bank after year n, a(n), in terms of the undetermined annual interest rate r. (b) Solve the above discrete dynamical system to determine a(n). (c) Let n = 12 years and ascertain (1) lowest interest rate which will give a return of $1,400 after 12 years and (2) the best interest rate you should pick in order to get the highest balance in your account after n = 12 years. (d) What will your brokerage fee be for this rate? Polymer production problem and optimization We have two polymers - A and B. In a given period of time, say 1 sec, 90% of polymer A stays as polymer A and 10% of polymer A transforms to polymer B, while 80% of polymer B stays as polymer B and 20% of polymer B becomes polymer A. Suppose we start with 1 g of each of Material A and Material B. A rule of thumb when combining these particular polymers is this: If we add x g to the initial amount of Material A we need to subtract off x^2 g from the initial amount of Material B. What are the physical restrictions on x? For our initial conditions, how many g of initial material A, x, should we add to 1 g of Material A (and hence subtract off x^2 g from an initial amount of 1 g of Material B) so that we maximize the amount of Material B at time n = 10 sec? What is this maximum value for Material B? You can maximize any function of x by examining its plot and estimating its highest value, perhaps zooming in on its maximum value. OR use first derivative information to detemine optimimum value. Determine the eventual distribution of polymers in ANY solution containing one or the other of Material A or Material B. KEYWORDS Discrete dynamical system,difference equations, objective function, optimization. TEACHER NOTES ISSUES RELATED TO THE PROBLEM Prerequisites Students should know how to solve first order, linear, discrete dynamical systems (difference equations) and systems of such and use this to set up an objective function to optimize revenue. Time allotment - time management These problems can be done in one class hour if students have access to the appropriate technology. We have used them as a course end activity in a discrete dynamical system course which leads into the calculus. Depending on the section, some of the student have studied formal (calculus) optimization methods and others have not. The latter will optimize by plotting. Or this could be a homework assignment requiring about two hours. Expectations One expectation was for students studying discrete dynamical systems to see how solutions can lead to functions to optimize. Future payoffs Students will see the connection between discrete and continuous mathematics. Extensions On the first problem offer up other fee structures and on the second problem offer up other constraints on initial conditions, e.g., B costs 4 times as much as A initially and we only have so much money to purchase initial ingredients. References and Sources Thanks to Garry Lambert for writing up a proposed solution and Bernard Hughes for his contributions. Both are colleagues at USMA who worked on these problems during the Fall 1995 to prepare them for a course end activity. Any number of books on discrete dynamical systems. POSSIBLE SOLUTION(S) SOLUTION (Investment Strategies - first order DDS): The DDS will be: a(n+1) = (1+r) a(n) + 100, a(0) = 100. The solution for this DDS is: a(n) = (100 r + 100)/r (1 + r)^n - 100/r This solution can be found in any text on discrete dynamical systems. It can be built from a conjectured form: a(n) = c (1+r)^n + b, where c and be are constants to be determined from the nohomogeneous term 100 and the given initial condition a(0) = 100. After 12 years at interest rate r we shall have t(r) dollars in our account where: t(r) = (100 r + 100)/r (1 + r)^12 - 100/r - 9000 r^2, the last term being the brokerage fee for obtaining interest rate r. t[r_] = (100 r + 100)/r (1 + r)^12 - 100/r - 90000 r^2; We plot this amount as a function of r. Plot[t[r],{r,.00001,.2}] -Graphics- We seek the lowest interest rate which will give a return of $1,400 after 12 years. FindRoot[t[r]==1400,{r,.01}] {r -> 0.0144317} Thus, if we go for the interest rate of 1.44% we shall be able to attain $1,400 after 12 years with the penalty and interest in effect. We note that we could obtain $1,400 after 12 years with another interest rate - higher though. This is due to the fact that while we earn more interest we shall have to pay a higher brokerage fee. We determine the best r to maximize t(r) by determining where the derivative of the t(r) function is 0, but students could zoom in on the function t(r). sol = FindRoot[t'[r]==0,{r,.1}] {r -> 0.075543} This is the amount we will receive after 12 years. receive = t[r]/.sol[[1]] 1574.31 And this is our fee. fee = 90000 r^2/.sol[[1]] 513.607 By the way, this amount is what we would receive from a straight annual interest of r = 0.03128 or 3.128% if there were no brokerage fee. FindRoot[(100 r + 100)/r (1 + r)^12 - 100/r == receive,{r,.03}] {r -> 0.0312829} SOLUTION (Polymer production problem, leading to system of first order, linear discrete dynamical systems, and optimization): We enter the matrix of coefficients for the transition from Material A to Material B and back again. A = {{.9,.2},{.1,.8}} {{0.9, 0.2}, {0.1, 0.8}} MatrixForm[A] 0.9 0.2 0.1 0.8 We compute the eigenvalues and the corresponding eigenvectors. s = Eigensystem[A] {{1., 0.7}, {{0.894427, 0.447214}, {-0.707107, 0.707107}}} We write the solution in terms of the eigenvalues, the eigenvectors, and the constants c1 and c2. (The s[[i]][[j]] terms go to the ith list in s and take the jth value offered, so for example s[[2]][[1]] is 0.894427.) sol[n_] = c1 s[[1]][[1]]^n s[[2]][[1]] + c2 s[[1]][[2]]^n s[[2]][[2]] n n {0.894427 1. c1 - 0.707107 0.7 c2, n n 0.447214 1. c1 + 0.707107 0.7 c2} We set our initial conditions with the unkown x. a0 = {1 + x,1-x^2} 2 {1 + x, 1 - x } We solve for the constants c1 and c2 - obtaining them in terms of the variable x. This part will not permit just plugging and chugging to get the coefficients, indeed, the inverse of the coefficient matrix is probably best, but then it has to be multiplied by the initial vector (1 + x, 1 - x^2). t = Simplify[Solve[sol[0]==a0,{c1,c2}]] 2 {{c1 -> 1.49071 + 0.745356 x - 0.745356 x , 2 c2 -> 0.471405 - 0.471405 x - 0.942809 x }} We write out our amounts as a vector h(n) - being the amount of (Material A, Material B) at time n in terms of the variable x. h[n_] = sol[n]/.t[[1]] n {-0.707107 0.7 (0.471405 - 0.471405 x - 2 n 0.942809 x ) + 0.894427 1. 2 (1.49071 + 0.745356 x - 0.745356 x ), n 0.707107 0.7 (0.471405 - 0.471405 x - 2 n 0.942809 x ) + 0.447214 1. 2 (1.49071 + 0.745356 x - 0.745356 x )} We compute the amount of material A and matrial B at time n = 10, still as a function of x. p[x_] = Simplify[h[10]] 2 {1.32392 + 0.676083 x - 0.647835 x , 2 0.676083 + 0.323917 x - 0.352165 x } We plot both - the thin line is Material A and the thick line is material B. Plot[{p[x][[1]],p[x][[2]]},{x,0,1}, PlotStyle->{Thickness[.01], Thickness[.02]}, AxesLabel->{"x","A - thin, B - thick"}, PlotRange->{0,2}] -Graphics- We determine the maximum value of the SECOND coordinate function (material B) by zooming in around x = 0.5. Plot[p[x][[2]],{x,.45,.55}, AxesLabel->{"x","B"}] -Graphics- We determine the maximum value of the SECOND coordinate function (material B) by zooming in around x = 0.46. Plot[p[x][[2]],{x,.44,.48}, AxesLabel->{"x","B"}] -Graphics- We determine the maximum value of the SECOND coordinate function (material B) by zooming in around x = 0.46. Plot[p[x][[2]],{x,.455,.465}, AxesLabel->{"x","B"}] -Graphics- And hence we get a maximum value of about 0.7506 g of B when we originally add x = 0.46 g of A to our initial amount of 1 g of A and remove x^2 = 0.46^2 = .2116 g of B from our initial amount of 1 g of B. h[10][[2]]/.{x->.46} 0.750566 Or we could determine the maximum value of the SECOND coordinate function (material B) by differentiating w.r.t. x and setting the derivative equal to 0 to solve for x. s2 = Solve[D[p[x][[2]],x]==0,x] {{x -> 0.459894}} And finally we determine the actual maximum amount of material B at time n = 10 when we take x = .4599 g more than 1 g of A as initial condition. h[10][[2]]/.s2[[1]] 0.750566 We plot the amount of material B in the case x = .4599. hs[n_] = h[n]/.s2[[1]] n n {-0.0390332 0.7 + 1.49893 1. , n n 0.0390332 0.7 + 0.749464 1. } We see that Material B is headed for 0.7495 g as a long term amount. {hs[5][[2]],hs[10][[2]],hs[20][[2]]} {0.756024, 0.750566, 0.749495} ListPlot[Table[{n,hs[n][[2]]},{n,1,20}], PlotStyle->{PointSize[.03]}, PlotRange->{0,1}] -Graphics- ISSUES IN SOLUTION These are problems in which setting up discrete dynamical systems to model investment and chemical reaction processes lead to an optimization situation. Students need to see that these type of problems do not fall into one category and may take several steps and added strategies to arrive at a conclusion.