COMPUTERS AND ACTUARIAL SCIENCE by S. BENJAMIN INTRODUCTION THE purpose of this article is to explore the application of com- puters to actuarial science. It is frankly a propaganda attempt to counterbalance the emphasis on data-processing applications which there has been in the past. I think that this emphasis has been an unfortunate mistake. Computers can be regarded as glorified desk calculators or high- speed punched-card machinery but this misses the real potential of the qualitative difference between computers and earlier machinery. This potential can only be realized when we learn to look at jobs 'computer-wise'. There is only one way to learn this and that is to learn how to programme and then to get down to some hard detail. Programming is to computers as probability is to actuarial science; without it there can be no understanding of any value, and only by acquiring some manipulative skill in the practice of its rules and logic can any of its implications be explored. The examination of our own scientific problems by computer methods would reveal the widest possible range of techniques, and would yield a broad basis of 'know-how' within the context of which most data-processing problems would appear as a simple, and often tedious, special branch. In fact this point can be taken further; the striking use of computers in data-processing comes from the introduction of a scientific programmed control at the centre of the processing system. As an example, most applications of computers which are given the title 'stock control' are really only 'stock recording'. Often, the greatest saving comes from programming into the recording system a continuous statistical analysis which controls the buying and allocation of stock. In practice there is a further disadvantage in starting with data- processing problems because it tends to lead to the ' appreciation 7 ASS 17 94 S. BENJAMIN course' attitude and a superficial interest in the 'hardware', e.g. the speed of the magnetic tape or the punched-card reader. This would be analogous to the early actuaries trying to develop their science by listening to talks on how to lick one's thumb in order to turn over the pages of a ledger more quickly. To continue the analogy, an examination of the 'software', i.e. programming facilities and methods, would be equivalent to specifying the content and layout of commutation columns in early times. This article is an attempt to influence the direction in which actuarial effort in the field of computers is applied in the near future. It is in fact likely to be out of date, one way or another, within a year or two. Just over a year ago the first full-blooded computer programming course designed for actuaries was held— by the Students' Society. Thirty 'students', almost all Fellows, attended the course. Its effect was approximately to double the number of actuaries in this country who knew how to programme. A study group has now been set up and a second year's primary course is in progress at the time of writing. It would be fair to assume that before very long a sizeable proportion of the profession will have a good working knowledge of computers. If this broad basis of 'know-how' is developed we shall reach the stage where almost all actuarial discussion will be influenced, directly or indirectly, by computer techniques. In some fields close to actuarial work, both administrative and scientific, this has already happened. The growth of the techniques of building mathematical models to explore subjects which, before the war, would have been considered most un-mathematical, has gone hand-in-hand with the growth of the computer field. Life as- surance is probably the oldest mathematical model of them all— for no man knows when he is going to die—but it would be un- warranted to assume that this model will stand the test of time future, as well as the test of time past. In the light—or dark—of these opinions, the following pages examine some specific examples of problems which could be tackled almost immediately. In themselves these examples will not interest everyone but they do illustrate computer techniques. In view of what has been said above the first part is devoted to COMPUTERS AND ACTUARIAL SCIENCE 95 a 'potted' programming course. It could be called an 'apprecia- tion course'—but it is to be hoped that some appreciation courses are more equal than others. It is based on lectures given in the past and attempts to give a fair idea of how calculating jobs, as opposed to data-processing jobs, are tackled on a computer. It is commonly accepted that any programming course must be based on an existing machine or programming scheme. The programming scheme used here is one of the autocodes commonly used on Ferranti computers, and my apologies are due to Ferranti for the way in which the following pages make the autocode seem extremely limited in its facilities. It is, however, an extremely easy scheme to teach and, unlike some of the other autocodes, it is elementary enough not to hide the basic principles of programming any machine. It would be possible to describe the later examples in terms which avoided reference to specific machines or codes, but my own personal experience is that whilst this is excellent for people who are familiar with programming it is quite useless to others. Two warnings should be given. First, the' potted' programming course really is potted; all 'ifs' and 'buts' have been omitted even within the limited area it covers. Secondly, where costs are given in one or two places, they are for illustrative purposes only. Generally speaking costs are similar as between one manufacturer and another for machines of comparable power. The next section takes programming a step further by looking at a specific type of job, namely straightforward valuation calcula- tions, and indicates how to specify a language in which this class of work can be expressed simply in terms which 'the machine' could understand. ' The machine', of course, is really a translating programme lying inside the machine and a very brief indication is given of how such a translation programme can be worked. The major part of the rest of the article is devoted to applying a technique which is especially suited to computers to two actuarial problems. The technique is 'simulation' and the two problems are: (a) a traditional reversions problem which is too complicated to handle by straightforward methods; and (b) the non-traditional problems of certain types of life reinsurance which are, however, coming into wider use. This includes an examination of group 7-2 96 S. BENJAMIN life assurance premiums with rebate, and data for an actual scheme are used to calculate premiums on various bases. Part of (b) was set as the final 'practical' on the Students Society Pro- gramming Course. The 'examination paper' at the end is intended to peep at a few miscellaneous subjects. Unsatisfactory model solutions are available on request. MICROSECONDS AND ALL THAT A computer may be regarded as a set of boxes. These boxes may contain (a) numbers, or (b) instructions. (a) Numbers There are two types of boxes which can hold numbers. (i) n-boxes These can hold only integers, positive, or negative. They are numbered for reference purposes nO, n , n , .... 1 2 (ii) v-boxes These can hold any type of number, positive, negative, integer, fraction or mixed (integer and fraction), e.g. -10.2 +0.0003456 -1000. For reference purposes these boxes are numbered v0, v1, v2, . . . The numbers held in the v-boxes are held in fact as two numbers in one box. Every number is expressed in a standard form a x 106, where 0.1 \a\ < 1, and a and b are both held in the one v-box, e.g. -10.2 = -.102 x l02 is held as -.102, + 2; + •0003456 = .3456 x 10-3 is held as +.3456, -3; -1000 = -.1 x 104 is held as — •1, 4. This is known as floating point working. COMPUTERS AND ACTUARIAL SCIENCE 97 The standardized fraction is held to about 9 decimal places; the exponent may take values in the range ± 80, That is numbers in the range 10-80 to 1080 can be held. Obviously during most arithmetical working rounding errors will occur. There are operations of a counting nature which occur peculiarly in computer programming and for these operations the n-boxes are usually used because there need be no fear of rounding. There is a further very important use for them, known as modification, which will be explained later. Numbers in n-boxes can lie in the range ± 8000 approximately. (b) Instructions We shall be describing the exact form of the instructions shortly. Typical instructions are: (i) Read in the next number punched on the paper tape which is lying in the second paper-tape reader and place it in box v20. (ii) Write, i.e. punch, the number in box v19 on to the paper- tape in the output punch—from where we can pass it straight through an automatic typewriter to type up the number punched. (iii) Add the number in box v16 to the number in box v\7 and put the result in box v18. The instructions lie one in each box and the computer normally obeys them one after another. The sequence of operations The sequence of events when a programme is run is important for an understanding of the way a job must be organized. There usually comes a stage in the middle of a programming course when the students suddenly decide that nothing makes any sense at all. This is usually because they have forgotten the sequence of events, which is as follows: (1) Punch the instructions on to paper tape; this forms the 'programme tape'. (2) Punch the data on to paper tape; this forms the 'data tape' (e.g. it might be a set of q). x 98 S. BENJAMIN (3) Place the beginning of the programme tape under the reading-head of the paper-tape reader and throw the switch marked 'START'. (4) The programme tape now starts magically to unroll and pass under the reading head. The instructions are read off the paper tape and laid into the instruction boxes one after another. At this stage they are merely stored; they are not obeyed. (5) At the end of the programme tape you will have punched something which looks like an instruction but differs slightly in form. It is a ' directive' and not an instruction. All the time that the instructions are being read in, the computer examines them to make sure they are instructions and not directives. A typical directive says: ' now start to obey my programme—which is now stored—and start at instruction numbered 8'. (6) As soon as the computer notices that it is dealing with a directive it does not store that directive but obeys it. This causes it to start obeying the stored instructions in sequence. (7) It is a good idea to make the last instruction 'STOP', other- wise the computer will carry on and obey the rubbish left in further instruction boxes by the last man on the machine. (The last man always leaves rubbish—carefully designed to give you the maximum trouble.) Also if, say, your first instruction is 'Read in a number from the data tape', and this is to be from the same paper-tape reader as was just used to input programme, you will find yourself trying to change tapes within microseconds— an unrewarding exercise which can be avoided by making the first instruction 'STOP', 'STOP' really means 'pause until I throw the switch marked 'RUN' and then carry on with the next in- struction'. The next instruction can be the 'read' instruction. Paper-tape format Most readers will be very familiar with punched cards, less so with paper tape. The characters available are the alphabet, the numerals, and some special characters. Each character is represented by a set of holes across the width of the tape (a stripe) and the characters follow one another closely along the length of the tape. COMPUTERS AND ACTUARIAL SCIENCE 99 The special characters include ( ) . , + — X / * -> = * > > The character set varies from manufacturer to manufacturer and one of the reasons why one programming code may look wildly different from another is merely due to the differences in the character sets used (cf. the different printing sets on punched card tabulators, some more limited than others). There are other characters which have a special purpose. The data on the paper-tape can be printed by passing the tape back through the automatic typewriter. Hence there must be something on the tape to cause operations like 'return the carriage', 'roll up another line' and 'leave a space'. These operations are obtained by having special characters (i.e. 'stripes' of holes across the width of the paper tape, in the same way as for any other character). There are, on the keyboard, keys marked A, B, etc.; 0, 1, 2, etc.; and also 'Sp' (space), 'CR' (carriage return), 'LF' (line-feed); and these are used when punching the paper tape. In fact the characters are printed on a separate wide roll of paper at the same time as they are punched, i.e. a simultaneous 'hard-copy' is pro- duced, and the punching can be checked from this. Thus, CR LF + 1 • 2 Sp Sp - 0 • 1 CR LF 2 will produce _0.1 +1.2 2 Numbers on the paper tape must be separated by CR, LF or Sp, and the computer uses this fact to determine when one number finishes and another begins. The instructions General Format Instructions are mostly of the type vO = vl+v2. This means, take the numbers from boxes vl and v2, add them together and put the result in box vO. 100 S. BENJAMIN The format is that of an equation but strictly the meaning is that the result of the operation is to be left in the left-hand side. Thus ©0 = ©0+©l means take the numbers in boxes ©0 and ©1, add them together and put the result in box ©0. As a result ©0 will be changed; ©1 will remain unchanged. Arithmetic instructions Arithmetic instructions may take any of the following forms: v0 = ±v1, v2 = ±v10 ±v18, v3 = ±vllxv19, v17 = ±v25/v279. At most two v's may appear on the right-hand side. Because of this limitation we cannot write ©0 = ©l+©2+©3 + ©4. We could do this by v0 = vl+v2, v0 = v0+v3, v0 = v0+v4. Similar instructions are available for the n-boxes. Since these contain only integers there is a special instruction n1 = v2*v3, which leaves the remainder of n2/n3 in «1. Numbers may be written in the instruction on the right-hand side instead of v's or w's, e.g. v10 = -3/v8, n1l = n1l+ 2. (The last example will increase the number in n\ 1 by 2.) When writing programme it is of supreme importance to keep to the rules of permitted formats. (Personally, I find that the fewer the number of different formats allowed the easier it is to write programme; the restrictions are an advantage. One of the COMPUTERS AND ACTUARIAL SCIENCE IOI difficulties in using highly sophisticated programming languages is that the format rules seem so loose—or complicated—that impermissible instructions are written all too easily. These languages do, however, have other advantages.) For present purposes, however, we need not give a complete list of formats for this particular programming 'language'. Input and output Input Numbers may be read in by instructions of the type ©33 = TAPE. This will read in the next number on the data-tape under the reading-head of the paper-tape reader and place it in box ©33. ©33 = TAPE 5 will read in the next 5 numbers and place them in boxes v33, v34, v35, v36 and v37 respectively. Another useful 'read' instruction is, for example, v10 = TAPE*.. This will read in numbers until a special marker (the letter 'L') is encountered on the paper tape. Also the numbers are counted as they are read in and the number of numbers read is left in the box n0. The numbers are placed in boxes v10, v11, v12 onwards. Similarly, TAPEB, TAPEB 6, TAPEB* refer to the second paper-tape reader. Output Numbers may be punched (printed) by an instruction of the type PRINT V15, 3085, or PRINT ©15, 4103. This causes ©15 to be printed. The number at the end of the instruction is a code giving the printing style required. In the first digit 3 means 'print on a new line', 4 means 'leave one space and print on the same line, i.e. do not roll the carriage up'. The IO2 S. BENJAMIN next two digits (08 or 10 in the above examples) are twice the number of places to be printed before the decimal point; I have no idea why the doubling is required—perhaps the original designer has been laughing ever since. The last digit (5 or 3 above) gives the number of places after the decimal point. (No doubling is required here.) Non-significant zeros at the beginning are replaced by spaces. There is rounding in the last digit. Thus, if vO contains -123456999, and vl contains 11.3599901, and v2 contains 345.000002, the instructions PRINT vO, 3064, PRINT v1, 4064, PRINT v2, 3064. (That is all specifying 3 places before and 4 places after the point) will output •1235 11.3600, 345.0000, i.e. there will be proper column alignment. If the number is too large for the printing style, the output will do its best, viz. the number will be output in the form requested followed by a decimal exponent, e.g. if vO contains 12345.6789, the instruction PRINT vO, 3042 (i.e. 2 before and 2 after the decimal point) will output 12.35 3, meaning 12.35 x 10s. This will show up on the printed page rather sharply because the layout will be disturbed. Presumably if your programme gives you a number larger than any you anticipated you would like to have your attention drawn to the fact.
Description: