Interest Made Simple with Arrays

Similar documents
3.1 Simple Interest. Definition: I = Prt I = interest earned P = principal ( amount invested) r = interest rate (as a decimal) t = time

4: Single Cash Flows and Equivalence

Appendix A Financial Calculations

Chapter 3 Mathematics of Finance

Financial Maths: Interest

Section 5.1 Simple and Compound Interest

Sequences, Series, and Limits; the Economics of Finance

MTH6154 Financial Mathematics I Interest Rates and Present Value Analysis

Before How can lines on a graph show the effect of interest rates on savings accounts?

Unit 9 Financial Mathematics: Borrowing Money. Chapter 10 in Text

Unit 9 Financial Mathematics: Borrowing Money. Chapter 10 in Text

Year 10 General Maths Unit 2

Introduction to the Hewlett-Packard (HP) 10B Calculator and Review of Mortgage Finance Calculations

MTH302- Business Mathematics

Actuarial Society of India

Finance 197. Simple One-time Interest

ELEMENTS OF MATRIX MATHEMATICS

6.1 Simple Interest page 243

Mathematics for Economists

Nominal and Effective Interest Rates

3: Balance Equations

3. Time value of money. We will review some tools for discounting cash flows.

Year 10 GENERAL MATHEMATICS

The three formulas we use most commonly involving compounding interest n times a year are

3. Time value of money

2.6.3 Interest Rate 68 ESTOLA: PRINCIPLES OF QUANTITATIVE MICROECONOMICS

A MATRIX APPROACH TO SUPPORT DEPARTMENT RECIPROCAL COST ALLOCATIONS

Activity 1.1 Compound Interest and Accumulated Value

Economic Simulations for Risk Analysis

MTH6154 Financial Mathematics I Interest Rates and Present Value Analysis

Day 3 Simple vs Compound Interest.notebook April 07, Simple Interest is money paid or earned on the. The Principal is the

Copyright 2016 by the UBC Real Estate Division

Lesson Exponential Models & Logarithms

The Theory of Interest

Maximum Likelihood Estimation

These terms are the same whether you are the borrower or the lender, but I describe the words by thinking about borrowing the money.

Unit 8 - Math Review. Section 8: Real Estate Math Review. Reading Assignments (please note which version of the text you are using)

TIME VALUE OF MONEY. Lecture Notes Week 4. Dr Wan Ahmad Wan Omar

Chapter 14 : Statistical Inference 1. Note : Here the 4-th and 5-th editions of the text have different chapters, but the material is the same.

Options. An Undergraduate Introduction to Financial Mathematics. J. Robert Buchanan. J. Robert Buchanan Options

Part 2. Finite Mathematics. Chapter 3 Mathematics of Finance Chapter 4 System of Linear Equations; Matrices

Applications of Exponential Functions Group Activity 7 Business Project Week #10

4: SINGLE-PERIOD MARKET MODELS

ExcelBasics.pdf. Here is the URL for a very good website about Excel basics including the material covered in this primer.

Survey of Math Chapter 21: Savings Models Handout Page 1

My Notes CONNECT TO HISTORY

Chapter 9, Mathematics of Finance from Applied Finite Mathematics by Rupinder Sekhon was developed by OpenStax College, licensed by Rice University,

Simple and Compound Interest

The Theory of Interest

Assignment 3 Solutions

Our Own Problems and Solutions to Accompany Topic 11

Mathematics of Finance

INTRODUCTION AND OVERVIEW

Sample Investment Device CD (Certificate of Deposit) Savings Account Bonds Loans for: Car House Start a business

Economics 135. Bond Pricing and Interest Rates. Professor Kevin D. Salyer. UC Davis. Fall 2009

7-4. Compound Interest. Vocabulary. Interest Compounded Annually. Lesson. Mental Math

Interest Compounded Annually. Table 3.27 Interest Computed Annually

Unit 9: Borrowing Money

m

Jacob: The illustrative worksheet shows the values of the simulation parameters in the upper left section (Cells D5:F10). Is this for documentation?

Financial Mathematics

JWPR Design-Sample April 16, :38 Char Count= 0 PART. One. Quantitative Analysis COPYRIGHTED MATERIAL

The Time Value. The importance of money flows from it being a link between the present and the future. John Maynard Keynes

Key Terms: exponential function, exponential equation, compound interest, future value, present value, compound amount, continuous compounding.

CHAPTER 3. Compound Interest

SAMPLE. Financial arithmetic

21.1 Arithmetic Growth and Simple Interest

A Note on Capital Budgeting: Treating a Replacement Project as Two Mutually Exclusive Projects

Simple Interest: Interest earned on the original investment amount only. I = Prt

Math116Chap10MathOfMoneyPart2Done.notebook March 01, 2012

Journal of College Teaching & Learning February 2007 Volume 4, Number 2 ABSTRACT

Texas Instruments 83 Plus and 84 Plus Calculator

THE UNIVERSITY OF TEXAS AT AUSTIN Department of Information, Risk, and Operations Management

Introductory Financial Mathematics DSC1630

Theory of the rate of return

The Theory of Interest

13.3. Annual Percentage Rate (APR) and the Rule of 78

Chapter 21: Savings Models Lesson Plan

CHAPTER 4. The Time Value of Money. Chapter Synopsis

Introduction. Deriving the ADF For An Ordinary Annuity

SAMPLE. MODULE 4 Applications of financial mathematics

7.7 Technology: Amortization Tables and Spreadsheets

TD Canada Trust GIC and Term Deposit Product and Rate Information

Finding the Sum of Consecutive Terms of a Sequence

Finance 100 Problem Set 6 Futures (Alternative Solutions)

Further Mathematics 2016 Core: RECURSION AND FINANCIAL MODELLING Chapter 6 Interest and depreciation

Computing interest and composition of functions:

TIME VALUE OF MONEY. Charles I. Welty

Math 1130 Exam 2 Review SHORT ANSWER. Write the word or phrase that best completes each statement or answers the question.

Arithmetic. Mathematics Help Sheet. The University of Sydney Business School

APPM 2360 Project 1. Due: Friday October 6 BEFORE 5 P.M.

Multi-state transition models with actuarial applications c

LESSON 2 INTEREST FORMULAS AND THEIR APPLICATIONS. Overview of Interest Formulas and Their Applications. Symbols Used in Engineering Economy

FINANCE FOR EVERYONE SPREADSHEETS

Analyzing Loans. cbalance ~ a Payment ($)

SUMMARY STATISTICS EXAMPLES AND ACTIVITIES

In terms of covariance the Markowitz portfolio optimisation problem is:

CHAPTER 2 TIME VALUE OF MONEY

Interest Rates and Self-Sufficiency NOMINAL, EFFECTIVE AND REAL INTEREST RATES

Chapter 6 Analyzing Accumulated Change: Integrals in Action

Transcription:

Interest Made Simple with Arrays York University, Toronto rlwbrown@yorku.ca 1. Introduction 1.0 A Better Financial Calculator Students of the mathematics of finance seem to be comfortable using calculators to evaluate formulas or numerical expressions. They are typically much less comfortable writing programs in BASIC (or C or Java etc.) even in situations where the calculator solution is tedious and a short program would do the job efficiently. Spreadsheet models, with an emphasis on formulas as opposed to programs, are quite a reasonable and intuitive tool. But spreadsheet formulas seem to be about cells rather than money, time, and interest rates. The ideal tool would be a better calculator. APL and J can be used in calculator mode and therefore should be marketable to students as advanced calculators ideally suited to financial mathematics. This is especially true now that APL and J can be run on a variety of palm-sized computers. This paper presents a few ideas on how students might use J in the mathematics of finance. The emphasis is on using J as a calculator that has lots of memory and can store and compute with arrays. Therefore data will be entered and expressions evaluated but no programs will be presented in the classroom. (However, two utility programs and a few names for J primitives will be used as noted in the next subsection.) 1.1 J Definitions Used in what Follows The J examples below are presented in the plain Courier font. Certain definitions are assumed and these are displayed in Courier italics. The definitions of these italicized functions are given in the Appendix at the end of the paper. In particular, frequent use is made of a dollar format function Df to display numbers in dollar currency format. When dates are part of the input data, the dayno function can be used to compute a day number. All examples in this paper (except for Example 7, which uses the sparse arrays of J version 4.04) can be done with versions of J going back (at least) to J FreeWare, version 3.02. 2. Simple Interest Made Simple 2.0 Scalar Simple Interest Simple interest is commonly used for short intervals of time, typically less than one year. When the time interval is given in days, it is converted to years by dividing by 365. If P is the principal amount of a loan over a time interval t at annual simple interest rate r then the simple interest I payable and the accumulated loan S (principal plus simple interest) are I = Prt and S = P(1+rt) Example 1: A man borrows $7000 for six weeks at 8% simple interest per annum. How much does he repay at the end of six weeks? P =: 7000 r =: 0.08 t =: 6*7%365 Df S =: P*(1+r*t) $7064.44 Example 2: A man borrows $7000 and pays it back at the end of 6 weeks with a single payment of $7165. What annual rate of simple interest r was charged? Interest Made Simple

A P =: 7000 t =: 6*7%365 S =: 7165 r =: ((S%P)-1)%t r 0.2048469 In A, the equation S = P(1+rt) is solved by hand for r to get r = ((S/P)-1)/t and then J is used to do the arithmetic. B P =: 7000 t =: 6*7%365 r =: arg S =: P const*(1 const + r*t const) Df S 0.08 NB. Re-solve Example 1 $7064.44 S^:_1(7165) NB. Solve Example 2 0.2048469 In B, a function S is defined depending on an argument r (and using constants P, 1, and t) such that both Example 1 and Example 2 (its inverse problem) can be solved using S and S-inverse. Although this was a trivial example of an inverse problem, a similar method can be used for more difficult inverse problems. The above are scalar calculations. Arrays can be used in a trivial way to do a list of scalar calculations: Example 3: On a certain day, a bank has 4 loans due as follows: $3000 at 9% for 41 days, $7500 at 8.5% for 87 days, $6000 at 8.7% for 6 weeks, and $19000 at 8.8% for 5 months. Find the four amounts due on that day. P =: 3000 7500 6000 19000 r =: 9 8.5 8.7 8.8 %100 t =: (41 87%365),(6*7%365),(5%12) Df S =: P*(1+r*t) $3030.33 $7651.95 $6060.07 $19696.70 Arrays can be used in a non-trivial way when a loan is repaid with a series of payments. 2.1 Partial Payments: the Merchants Rule When a loan, made at a simple interest rate, is paid off with a series of partial payments, one way to calculate the interest is the Merchants Rule. In this method, payments are deducted from the principal and, after each payment is made, interest is charged on the reduced principal. Such a problem can be solved with arrays by using the inner (matrix) product (x =: +/. * ). Example 4: Mary borrows $10000 at 9% simple interest. She plans to make weekly payments for 26 weeks. Her first 25 payments will all be $400 with the following exceptions. Her first five payments will be half that amount. She will miss her 6 th and 7 th payments. Her last 4 payments will be increased by 50% (to $600). What will be her final 26 th payment? pmt =: 400 P =: pr-pmt*py r =: 0.09 pd =: 7*i.26 NB. payment days t =: (last pd)-pd rt =: r*t%365 Df S =: P x (1 + rt) $1285.83 A

B pmt =: 400 P =: pr-pmt*py r =: 0.09*(<:/&i.)/26 25 pd =: 7*i.26 t =: (}.pd) - (}:pd) rt =: r x t%365 Df S =: P x (1 + rt) $1285.83 Remark: In A, the time array t is a vector of time intervals from each payment time to the final payment time and the interest rate r is a scalar. In B, the time array t is a vector of time intervals between successive payments and the interest rate r is 0.09 times a matrix of 1's and 0's which is used to apply the interest rate and add up the time intervals. Although B is more complicated than A, it has an advantage that will appear in subsection 3.2: it can be modified slightly to yield the Declining Balance Method instead of the Merchants Rule. For an inverse problem on the same data, the unknown payment becomes an argument of a function. Example 5: Suppose in example 4, Mary wants to increase the size of her normal payment from $400 to a value so that her final payment is reduced to zero. What should her normal payment be? pmt =: arg r =: 0.09 pd =: 7*i.26 NB. payment days t =: (last pd)-pd rt =: r*t%365 S1 =: (pr x 1+rt)const S2 =: (py x 1+rt)const S =: S1 - pmt*s2 Df S 400 NB. Re-solve Example 4 $1265.83 Df S^:_1(0) NB. Solve Example 5 $456.24 2.2 The Declining Balance Method Another common method for handling partial payments in simple interest problems is the declining balance method. When a payment is made, the loan balance is recalculated to include the simple interest since the previous payment. Because this interest is added to the balance of the loan on which future interest is calculated, the interest is in fact compounded. Because this method involves compound interest, consideration of it is delayed to subsection 3.2. 2.3 Demand Loans A demand loan has simple interest deducted automatically from the borrower's account each month. Partial payments may be made at any time and the interest rate is floating and may change at any time. Thus there are given three vectors of dates: the payment dates, the interest payment dates, and the dates at which the interest rate changes. In the solution to the following example, the formula S = P(1+rt) has P and r as vectors and t as a rank-3 array of time intervals and its (i,j,k)-entry is the amount of time that payment i has before interest payment date j at the interest rate k. Each time interval has a start time and an end time so the array t is computed as a difference of end times minus start times. Unlike the previous examples in which multiplication was commutative, the matrix product here requires a specific order of factors: S = P(1+tr) Example 6: Jason borrowed $1800 from his bank on a demand loan on August 15, 1999. Interest on the loan, calculated on the unpaid balance, is charged to his account on the 1 st of each month. Jason made a Interest Made Simple

payment of $400 on September 18, a payment of $500 on October 9, a payment of $600 on November 13, and repaid the balance on December 18. The rate of interest on the loan on August 15 was 9% per annum. The rate changed to 9.5% on September 24 and to 9.8% on November 21. Calculate the interest payments on the first of each month and the final balance on December 18. NB. input data NB. payments, payment dates P =: 1800 _400 _500 _600 pdt =: 15 8 1999;18 9 1999 pdt =: >pdt,9 10 1999;13 11 1999 NB. rates, rate start dates r =: 0.09 0.095 0.098 rdt=:>15 8 1999;24 9 1999;21 11 1999 NB. interest payment dates idt =: 1 9 1999;1 10 1999;1 11 1999 idt =: >idt,1 12 1999;18 12 1999 NB. end of data input; now compute pd =: dayno pdt rd =: dayno rdt id =: dayno idt sd =: pd>./id<./rd NB. starts ed =: pd>./id<./}.rd,_ NB. ends t =: (ed-sd)%365 NB. times Df I =: P x t x r $7.55 $19.71 $28.02 $32.26 $33.63 NB. These are cumulative interest NB. payments. The actual payments NB. on the 1st of each month and on NB. December 18 can be found with NB. summation backscan inverse: Df +/\^:_1 I $7.55 $12.17 $8.30 $4.24 $1.37 NB. Final balance Dec. 18 is: Df (+/P) + 1.37 $301.37 Remark 1: The above calculation is normally done as a tedious sequence of scalar applications of the simple interest formula. These scalar calculations can be mimicked in a spreadsheet model; but the model is tricky to write and not too easy to change for each new demand loan situation. The code above is general to cover any given demand loan data. Remark 2: Note the use of infinity in the computation of the end-days array ed. Given the starting times rd of the interest rates, to get the ends of the interest intervals ed drop the first start date and append an infinite date as the end date of the final interest rate. Thus even in the pragmatic world of simple interest calculations, infinity plays a practical role! Remark 3: Arrays of rank (dimension) greater than two are usually avoided in applied mathematics (by reformulating in terms of matrices) except in areas, such as elasticity or general relativity, that use tensors. So the solution to Example 6 could be viewed as an example of the use of a time-interval tensor in simple interest! 2.4 Demand Loans and Sparse Arrays In the case of a portfolio of demand loans to a list of customers, the difficulty is that the customers need not make their loans and payments at the same time, nor make the same number of payments. One approach would be to use nested (boxed) arrays. Each customer's payments would be a boxed vector as an element of a nested array. The dates of the payments would have to be handled in a similar way and the code above would have to be modified accordingly. Another approach is to use the sparse array facility available in J 4.04. Let each row represent a customer. Let each column represent a day. There might be 365 columns to cover 1 year. Or there might be 3650 columns to cover 10 years or even 36500 columns for 100 years. Most of the array will be zeros so

memory use will not be a concern unless the actual payment data set is large. One advantage of this approach is that the payment date information is already contained in the payment array: its column determines the date of any payment. The example below, has two loan customers; but the same formulas work for any number of customers. Example 7: The bank that made the loan to Jason (see example 6 above) also has Iris as a demand loan customer. Iris borrowed $9000 on August 3 of 1999 and made payments of $1000 on the following dates: August 24, 1999, September 11, 1999, October 3, 1999, October 23, 1999, November 16, 1999 and December 12, 1999. Find the 1 st -of-the-month interest payments of Iris and Jason for September 1 through December 1. NB. input data NB. Iris payments, payment dates IP =: 9000,6#_1000 Idt =: 3 8 1999;24 8 1999;11 9 1999 Idt =: Idt,3 10 1999;23 10 1999 Idt =: >Idt,16 11 1999;12 12 1999 NB. Jason payments, payment dates JP =: 1800 _400 _500 _600 Jdt =: 15 8 1999;18 9 1999 Jdt =: >Jdt,9 10 1999;13 11 1999 NB. rates, rate dates r =: 0.09 0.095 0.098 rdt=:>15 8 1999;24 9 1999;21 11 1999 NB. interest payment dates idt =: 1 9 1999;1 10 1999 idt =: >idt,1 11 1999;1 12 1999 NB. end of data input NB. Compute Iris, Jason daynumbers Id =: (dayno Idt) - dayno 1 1 1999 Jd =: (dayno Jdt) - dayno 1 1 1999 NB. create sparse array of 0 s P =: 1 $. 2 365 NB. Insert Iris payment P =: IP(<"1(0,.Id))}P NB. Insert Jason payments P =: JP(<"1(1,.Jd))}P NB. all days are payment days pd =: i.{:$p rd =: (dayno rdt) - dayno 1 1 1999 id =: (dayno idt) - dayno 1 1 1999 sd =: pd>./id<./rd NB. starts ed =: pd>./id<./}.rd,_ NB. ends t =: (ed-sd)%365 NB. times Df $.^:_1 I=:P x t x r $35.75 $90.67 $137.26 $172.73 $7.55 $19.71 $28.02 $32.26 NB. Above are cumulative interest pmts NB. Sept 1 to Jan 1, 2000. Df +/\^:_1 "1 $.^:_1 I $35.75 $54.92 $46.59 $35.47 $7.55 $12.17 $8.30 $4.24 Remark 1: The dollar format function Df does not work on sparse arrays so $.^:_1has been used to convert the sparse array I to the non-sparse form. Remark 2: Once you have decided to use a sparse array to hold the payment data for the loan customers then you might want to do the above calculation in a rather different way. The payment data is recorded on a daily basis (every day is a payment day but on most days the payment happens to be zero) so there is really no need to calculate time intervals. Just calculate the daily interest every day to get cumulative inter- Interest Made Simple

est amounts for each customer and each day and then select the actual interest payment days from this and take differences. Overall, this approach requires about the same amount of J code as the above approach. 3. Compound Interest Made Simple 3.0 A Traditional Approach Compound interest is usually specified as a nominal annual rate compounded a certain number of times per year. For example, 12% compounded monthly is 1% per month so one dollar grows over one year by a factor of (1.01) 12 = 1.126825. If the loan interval is a whole multiple of the interest conversion period (one month in the previous example) then formulas for accumulated loans, and for the accumulation (or present value) of sequences of payments can be readily developed. In APL and J there are concise expressions for these formulas and that partially accounts for the great success that APL has enjoyed over the years in the actuarial profession. Example 8: Igor borrows $30000 at 12% compounded quarterly for the first four years and 12.5% compounded quarterly thereafter. He makes quarterly payments of $1000 for 3 years followed by quarterly payments of $2000 for 3 more years. What is his balance owing one quarter-year after his last payment? If he pays this balance, how much interest has he paid? P =: 30000,(12#_1000),12#_2000 i =: ((16#0.12),9#0.125)%4 Df P x */\. 1+i NB. balance $12973.34 Df P x _1+*/\. 1+i NB. interest $18973.34 Examples like the previous one show students the power of J (or APL) in mathematics of investment and should be ample justification for acquiring, studying, and using J (or APL). However, such examples are already well known to the APL community and hence to most readers of this paper. Therefore, this paper will explore some of the less well known aspects of compound interest and will show how certain feature of J are well adapted to these kinds of calculations. 3.1 Compound to Simple Interest Consider a loan at simple interest of 0.05 for the first year, 0.07 for the second year, and 0.08 for the third year. The simple interest rate for the three-year period is the sum of these rates, 0.05+0.07+0.08 = 0.20, and each dollar borrowed must be repaid with $1.20 at the end of three years. If the same rates were used but interest were compounded annually, then each dollar would be repaid with (1.05)(1.07)(1.08) = $1.21338 and the interest rate for the three year period is 0.21338. The compound sum of the rates 0.05, 0.07, 0.08 is 0.21338 and this can be related to ordinary sum as follows: add 1, take logs, take the sum, take inverse log, and subtract 1. In other words, let laug(x) = log(1+x). (Thus laug is the log of augmented x.) Then: compound sum = laug -1 sum laug The relation between simple interest and compound interest can be expressed very concisely in J. The compound sum above is thought of as sum under laug. The under conjunction &. can be used to apply any function (such as sum) under another function such as laug as shown in the following example. J automatically computes laug -1. Example 9: In Example 8 above, compute the balance remaining if the interest rate had been simple interest. Then use laug to convert the calculation to compound interest. P =: 30000,(12#_1000),12#_2000 i =: ((16#0.12),9#0.125)%4 Df P x 1+(+/\.) i NB. simple $5182.50 Df P x 1+(+/\. &. laug) i NB. comp. $12973.34

Example 10: A mutual fund has annual growth for the years 1999, 1998,..., 1995 of 18%, 16%, -12%, 7%, -8% respectively. What were the average compound rates of growth over the last year, last two years,..., last 5 years. i =: 18 16 _12 7 _8 am =: +/ % # NB. arithmetic mean 100*am &. laug \ i%100 18 16.9957 6.39982 6.54955 3.46628 3.2 The Declining Balance Method Now that compound interest has been studied, it is time to return to the declining balance method. This method is very commonly used for loans with partial payments made over short intervals of time with simple interest used to compute the new balance after each payment is made. Since the interest is included in the new balance, the method usually results in higher interest charges than if the Merchants Rule were used. The key change in the J code is to replace a matrix product (x =: +/. * ) with a new matrix product (xl =: +/&.laug. * ) so that the summation is done under laug. Example 11: Redo Example 4 with the Declining Balance Method. (modified solution B) pmt =: 400 P =: pr-pmt*py r =: 0.09*(<:/&i.)/26 25 pd =: 7*i.26 t =: (}.pd) - (}:pd) xl =: +/&.laug. * NB. New product rt =: r xl t%365 Df S =: P x (1 + rt) $1293.21 Remark: The Merchants Rule and the Declining Balance Method are usually presented as two rather distinct methods of doing partial payments problems with simple interest. The calculations are done in quite different ways. The spreadsheet models are very different. But the above approach with J shows the surprisingly close relation between the methods. Roughly speaking, the Declining Balance Method is the Merchants Rule under laug. 3.3 Pure Compound Interest The Declining Balance Method, when used in simple interest situations, involves a mixture of simple and compound interest methods. Another approach to partial payments over short time intervals is to use pure compound interest. Historically, this was not practical because compound interest accumulation factors were looked up in tables and the tables could not possibly have been complete enough to have all possible fractional times. Hence simple interest, which is far easier to calculate manually, was used for fractions of an interest period. Now that computers are used for these calculations, there is no computational reason to avoid the fractional exponents that are required in compound interest calculations. However, as the next example reminds us, there is a penalty to pay for using compound interest: the convexity of the graph of the compound interest accumulation function implies that for time intervals less than one interest period, the compound interest is less than the simple interest. Therefore, a company charging compound interest for short time intervals will be charging less interest than if they use simple interest. Example 12: Do Example 4 again using compound interest on every time interval. NB. Use A slightly modified pmt =: 400 P =: pr-pmt*py Interest Made Simple

r =: 0.09 pd =: 7*i.26 NB. payment days t =: (last pd)-pd Df S =: P x (1+(*&(t%365))&.laug r) $1280.69 4. Discussion This paper has shown how a computer running J can be used as a powerful calculator to solve a variety of problems in mathematics of finance. The language features of J enable us to express the solutions to complex problems in concise language that is formula-oriented rather than program-oriented. That will be attractive to students who find calculators to be more user-friendly than programming languages. Also, this paper has exhibited a relationship between simple interest and compound interest that, while perhaps widely known, is not widely reported in textbooks. Perhaps that is partially because the relationship is awkward to express in natural language or in mathematical notation. Perhaps it is partially because the relationship is not seen to be of practical use. J allows a natural way of expressing this relationship, which leads to practical applications of it. To fully appreciate the examples in this paper, the reader should do each example by hand using traditional actuarial methods and a financial calculator and then do each example on a spreadsheet. You should find that the J approach is more convenient and (if you are comfortable with J, with arrays, and with the relation between compound and simple interest) more conceptual than the traditional or spreadsheet approaches. Bibliography PETR ZIMA, ROBERT L. BROWN, Mathematics of Finance, McGraw-Hill Ryerson Limited, 4 th edition, 1993. J FreeWare is available at: ftp://archive.uwaterloo.ca/languages/j J version 4.04 is available at: http://www.jsoftware.com Appendix The following J functions are used above. last =: {: NB. last item arg =: ] NB. argument const =: "_ NB. constant function x =: +/. * NB. matrix product laug =: ^. @: >: NB. log of aug NB. Dollar formatter for arrays f2 =: (' '&,)"1@(0.2&":) j =: '.0123456789' ns =: (}:<}.)@(e.&j,0:) Df =: ((1:+j.@ns)#!.'$'])"1@f2 NB. Day number for any post-1601 date dayno =: 3 : 0 "1 ('d';'m';'y') =. y. dn =. 365*dy =. (y-1601) dn =. dn+(-/<.dy%4 100 400) ly =. -/0=4 100 400 y md =. 28+(3,ly,3 2 3 2 3 3 2 3 2 3) dn+(+/(m-1){.md)+d )