JSS 17 (2) (1963) 93-153
COMPUTERS AND ACTUARIAL SCIENCE
by
S. BENJAMIN
INTRODUCTION
T H E purpose of this article is to explore the application of computers 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 highspeed 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 dataprocessing problems because it tends to lead to the ' appreciation
7
ASS 17
S. BENJAMIN
94
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 assurance is probably the oldest mathematical model of them all—
for no man knows when he is going to die—but it would be unwarranted 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 'appreciation 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 calculations, 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
S. BENJAMIN
96
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 Programming 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, n1, n2, . . . .
(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
e.g.
\a\ < 1, and a and b are both held in the one v-box,
-10.2 = -.102 x l02
+ •0003456 = .3456 x 10
is held as
is held as
-.102, + 2;
+.3456, - 3 ;
-1000 = -.1 x 104
is held as
— •1, 4.
-3
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 papertape 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 qx).
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', otherwise 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 instruction'. 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), ' L F ' (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 produced, and the punching can be checked from this.
Thus,
CR LF + 1 • 2 Sp Sp - 0 • 1 CR LF 2
_0.1
will produce
+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.
S. BENJAMIN
100
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 = ± v 1 ,
v2 = ±v10 ±v18,
v3 =
v17 =
±vllxv19,
±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 = v l + v 2 ,
v0 = v 0 + v 3 ,
v0 = v 0 + v 4 .
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,
v10 = -3/v8,
e.g.
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
PRINT V15, 3085,
type
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.
COMPUTERS AND ACTUARIAL SCIENCE
IO3
Example. We can now try a real programme. Let us add twc
numbers together. (I gave up using this as a set demonstratior
because it always went wrong.) The steps are as follows:
(1) Punch our programme tape which looks like this
STOP
vO = TAPE 2
vO = vO+vl
PRINT
vO,
3021
STOP
(->0)
(We discuss this below.)
(2) Punch the two numbers, say 1.1 and 2.2 to give us our
data tape.
(3) Go to the machine. Place our programme tape under the
reading head. Throw the START switch. Our programme is read
in instruction by instruction and stored in consecutive instructionboxes.
(4) At the end of the programme tape the machine finds
(
0).
The innocuous-looking left-hand bracket ' ( ' makes this a directive,
i.e. the machine stops storing instructions and obeys
0.
Jumping ahead in our explanation, this means go and obey the
first instruction of my (stored) programme.
(5) The first instruction to be obeyed is STOP. This allows us
time to place our data tape (all two numbers) under the reading
head.
(6) We throw the switch marked 'RUN' and the computer carries
on to the next instruction which is
v0 = TAPE 2,
i.e. read in two numbers and place them in v0 and v\ respectively.
(7) The next instruction
v0 = v0+vl
adds the two numbers together and leaves the answer in v0.
104
S. BENJAMIN
(8) The next instruction punches the number in vO on to paper
tape in such a way that when printed the number will appear on
a new line, and will have one place before and one place after the
decimal point.
(9) The last instruction is STOP.
With luck the output will be 3.3.
Functions
Various special functions are available. Typical instructions are
almost self-explanatory:
vO = LOG v\
v2 = EXP v3
v1 = INT v2 (integer part)
v2 = FRAC v3 (fractional part)
etc.
Labels and jumps
So far we have hardly done anything very exciting (except get
the correct answer 3.3 to our example). The idea of organizing
input and output from inside the machine is perhaps novel.
The real power of computer programming and its generality
will only become apparent after we have introduced some other
types of instructions.
So far we have said that instructions are obeyed one after
another in strict sequence. This sequence can be broken as follows:
First, any instruction may be numbered or' labelled' for reference
purposes, e.g.
2) v0 = vl+v2.
This gives the 'label' ' 2 ' to the instruction
vO = v\+v2
in our programme.
The labels do not have to be in order; any convenient numbering
may be used provided the same label is not used for more than one
instruction—the computer will not even store a programme which
contains this fault. Also in our example the use of the label 2
does not imply that this is the second instruction in our programme.
COMPUTERS AND ACTUARIAL SCIENCE
I05
(Label ' 0 ' is however reserved for the first instruction, by
convention.)
Second, an instruction of the type
->2
will cause the computer to jump to the instruction labelled 2.
Thus in the following part programme
vO = vl+v2,
-+2
v4 = v5 x v6,
2) v7 = v8+v9,
vl = v2.
the instruction v4 = v5 x v6 would be jumped over and not
obeyed.
Jumps may be backwards, e.g.
4) v1 = v2+v3,
-•4,
would cause this pair of instructions to be obeyed repeatedly,
i.e. the machine would go round and round a tight loop for ever.
This instruction is called an 'unconditional jump' and the above
examples do not make much sense as they stand. (The latter
example of perpetual 'looping' does however often occur in practice
by error, and many a programmer has happily watched the machine
being very busy doing nothing useful in a perpetual loop because
of faulty programme.)
Another type of jump instruction is the 'conditional jump'.
A typical conditional jump is
-> 2, v8 > 7.
This reads: Go to instruction labelled 2 if the number in box ©8
is greater than 7, otherwise carry on with the following instruction
in the usual manner. Other typical conditional jumps are
-> 5, n1 3,
->• 5, n1 = n2,
- • 6 , 8 v3
(there is no character < or < on the keyboard).
I06
S. BENJAMIN
Example. v\ and v2 each contains a number. Place the larger
of the two in vO and square it. The following programme will do
this:
Notes
vO = vl
-*• 1, vl > v2
v0 = v2
1) vO = vO x vO
Copy vl to vO anyway
Go to instruction labelled 1 if vl contains the
larger, otherwise carry on in sequence
Copy v2 to vO (and over-write vl); this will
only be obeyed if the previous conditional
jump did not jump
Square v0, result in vO.
Note that if vl = v2, the result will be (v 2)2 which in this example
make no difference.
The following programme will also do the job but is not as neat:
Notes
-*• 2, v2 > vl
vO = vl
••1.
2)
vO = v2,
1)
vO = v0 x vO.
Unconditional jump required here
The flow-chart of this would be as follows:
?v2 > vl
no.
v0 = vl
.yes
2)
v0 = v2
1) v0 = v0Xv0
A pretty problem which usually appears in programming courses
is:
vl contains either 2 or 3; whichever it is, place the other in vO.
Solution:
vO = 5 - v l .
Counting and loops
Consider the problem: given a in vl, form 1 + a5 in vO—using
repeated multiplication, not logarithms.
COMPUTERS AND ACTUARIAL SCIENCE
IO7
The programme may be written:
v0
v0
v0
v0
v0
v0
v0
Notes
Starting value
v0 = 1 x a
v0 = a x a
v0 = a2 x a
v0 = a 3' x a
v0 = a4 x a
v0 = l + a5
= 1
= v0 x v1
= v0 x vl
= v0 x vl
= v0 x vl
= v0 x vl
= 1+v0
This is clearly not the only way, or even the best, but it illustrates
a repetitive pattern; the instruction
v0 =
v0Xv1
appears five times. It is, however, possible to write the instruction
only once but make the computer obey it five times provided we
make use of the 'jump' facility (jumping back in fact) and do the
counting for the computer in our own programme. It is here that
the n-boxes come into their own; they can be used to hold integers
for counting purposes and we need have no fear of rounding errors.
Consider the following:
vO= 1,
1) v0 = v 0 x v l ,
-•1.
This nearly does the job; the trouble is it goes on for ever. Consider the following, where we use the box nl to count:
n\ =
v0 =
1) v0 =
n1 =
-+1,
vO =
0
1
vO x vl
n1 + 1
v1 4= 5
1+vO
Notes
Clear the counter
Starting value
ar+1 = arxa
Add 1 to counter
Go back if counter 4= 5
vO = 1 +a5
The conditional jump causes the required jump back to the basic
instruction
vO = v0 x vl
and the counter is stepped up each time round, taking successively
108
S. BENJAMIN
the values 1 after the basic instruction has been obeyed once,
2 after twice, . . . , 5 after five times; but now nl = 5 and the jump
->1
is not obeyed; the computer goes on to the last instruction,
i.e. it 'falls out at the bottom of the loop'.
Modification
Consider the problem, given a1 in v1, a2 in v2, ..., a5 in v5,
form 1 + a 1 a 2 a 3 a 4 a 5 in vO.
Again we shall start by writing a simple programme:
Notes
vO = 1
vO = vO x vl
Starting value
vO = 1 x a1
vO = a t x a 2
vO = v0Xv2
vO = v0 x v3
vO = v 0 x v 4
vO =
a1a2xa3
vO = a 1 a i a 3 x a l
vO = a 1 a 1 a 3 a l x a
v0 ==1+a
vO
l+a^a^a^aia^
1a2a3a4a5
vO = v0xv5
vO = 1+v0
This programme is clearly very similar to the one used to introduce counting and loops, with one subtle difference; at successive
instructions we require to step along the boxes v\.. .v5. The way
in which we rewrote the former example, using a counter, would
also be suitable in this case if somehow we could cause the basic
working instruction to work like this, vO = vO x v (1 then 2 then 3
then 4 then 5). We need a facility to allow us to alter the box
number written into an instruction. This facility is available;
we are allowed to refer to boxes as, for example,
vn1,
v(8+n3).
If a box is referred to in this general way, when the instruction is
obeyed the computer will substitute the current value of the n-box
used, for example,
if nl = 5 at that point of time, vn1 is taken as v5,
if n3 = - 2 at that point of time, v(8+n3) is taken as v6.
COMPUTERS AND ACTUARIAL SCIENCE
109
Now consider the following programme, which is almost
identical to the one developed before:
1)
n\ = 0
vO = 1
vO = vO x v ( l + n l )
n\ = n\ +1
-> 1, nl = 5
vO = 1+vO
Notes
Clear the counter
Starting value
vO = v0 X an
Add 1 to counter
Go back if counter = 5
vO = l + a 1 a 2 a 3 a 4 a 5
If we follow the programme through we find the desired effect is
now achieved. The first time instruction labelled 1 is obeyed
«1 = 0 and the instruction is read as
vO = v 0 x v l .
After the first jump back (by which time n1 has been increased
to 1) the instruction is read as
v0 = v0 x v2, etc.
Hence the instruction is 'modified'. This process is known as
' modification'. Notice that box n1 is being used in a dual capacity,
as a counter and as a modifier.
It is from the use of jumps, counters and modifiers that computer programming derives its generality. The power of these
machines derives from the generality of the programmes and the
speed of operating on the instructions; the first is a property of
the programmer, the second of the machine, but this distinction is
often not as clear-cut as it has been made to sound here.
In principle we have now covered most of programming. However, the following examples may help to demonstrate the significance of some of the facilities.
Example A
Read in a table of qx where the youngest age is 20 and the oldest
100, into boxes v120.. .v200. The table is terminated by the
special warning character L.
Solution. The use of the marker L means that we can use the
TAPE* instruction. The programme is
v120 = TAPE*
8
Notes
After this «0 will equal 81.
ASS
17
110
S. BENJAMIN
Example B
As above, but there is no L at the end of the tape.
Solution. We must now use a counter modifier. There are several
ways of doing this, e.g.
n\ = 20
1) v(100+nl) = TAPE
n1 = n 1 + 1
-»• 1, 100 > n1
Notes
Opening value of counter-modifier
Read one number
Increase counter-modifier
Conditional jump; the last jump back will
take place with n\ = 100.
Next instruction
Example C
This illustrates a more general way of inputting a table. A table
of qx has two numbers punched at the head of it, the youngest age
and the oldest age. At the end of the tape an L is punched. Write
an input routine which reads the qx into the w-boxes in such a way
that qx lies in v(100+x:). Also incorporate a simple check on the
number of qx read in.
Solution
v(100+nl) = TAPE*
Notes
Read 2 numbers; hence nl = youngest age,
n2 = oldest age.
Read numbers (i.e. qx) into boxes v(100 +
youngest age), v(100 + next age), etc., until
L is reached. At this point nO = number
numbers read in by the instruction
nO = nO+nl
n0 = nO-n2
-> 1, n0 = 1
/Check that nO = oldest age —youngest
age + 1
Go to 1 if all O.K. otherwise see below
nl = TAPE 2
TEXT
HARD LUCK, YOUR INPUT IS WRONG
1) Next instruction
Note, TEXT is an instruction to the computer to print out the
message on the following line (which itself is not, of course, an
instruction—at least, not to the computer!).
COMPUTERS AND ACTUARIAL SCIENCE
III
Example D
Given a table of qx stored so that qx lies in v(100+*) read in an
age from the paper tape input and print out the corresponding
value of qx.
Solution
Notes
n\
= TAPE
PRINT V(100 +n1), 3005
n\
= age x
Print qx on a new line with no places before
and 5 places after the decimal point
Note. This process is called' table look-up'—for obvious reasons.
Clearly this is important in actuarial work. What is less obvious is
that most 'data processing' is merely a process of table look-up.
Example E
As above, but do it for a series of ages. These ages are punched
on the input tape and end with a negative number—a dummy
age—which is to act as an end-marker.
2)
n1
= TAPE
- • 1 , 0 > n1
PRINT V(100 + nl), 3005
1)
Notes
n\ = age
[Jump if end, otherwise print and then
-j return to read next age
->2
Next instruction
Example F
A table of qx for males is stored so that qx lies in v(100+x).
The corresponding table for females is stored so that qx lies in
v(200+x). The data tape contains groups of four numbers which
are the data for the members of a scheme.
The first number is the member's scheme number.
The second number is the member's sex; male = 1, female = 2.
The third number is the member's age.
The fourth number is the member's sum assured.
The end of the scheme is denoted by a dummy member
containing four — l's.
Find the expected claim for males and females separately.
8-2
S. BENJAMIN
112
Solution
Flow-chart: clear two boxes for Σ,Sqm,Σ Sqf say v1 and v2.
Read a member's data
? data = - 1
Yes/\No
Print totals
Put n10 (say) = 100 x sex
Lookup v(n10 +age), i.e. qx
Form sum assured x qx
Add Sqx into v(sex), i.e. v1 or v2
i
Programme:
2)
1)
v1 = 0
v2 = 0
n\ = TAPE 3
Notes
Clear for ΣSqm
Clear for ΣSqf
n\ = member's number (not used)
n2 = sex (1 or 2)
n3 = age
vO = TAPE
vO = S
1, nl = — 1
nl0 = 100 x «2
n10 = n10 + «3
Jump if end
100 x sex
100 x sex + age is the number of the v-box
which contains qx
Put Sqx in vO
Add Sqx, into v(sex), i.e. required total
Go back for next member
Note: these instructions will only be reached
when the fifth instruction, -> 1, nl = — 1
finds a negative'member'
vO = vO x vnlO
vn2 = vn2 + vO
->• 2
PRINT v1, style
PRINT v2, style
STOP
Modified jumps
We are allowed to write a more general type of jump instruction,
e.g.
->n1,
->n2, v3 > 0,
which will be interpreted according to the current value of the
n-box. Thus
if nl = 21, ->nl
is interpreted as ->21
if n2 = 30, -» n2, v3 > 0 is interpreted as -- 30, v3 > 0.
If we have forgotten to set the n-box beforehand to the value we
require, the computer will gaily use the malevolent rubbish left
there by the last man on the machine.
COMPUTERS AND ACTUARIAL SCIENCE
"3
The main use for this facility is explained in the next section,
dealing with subroutines. However, the following example of a
simple data-processing job illustrates a common requirement in
this type of work.
Example G
The data-tape is the same as that of example F except that a
fifth number, a code, is included with each member. This code
can take values 10, 13 and 16 only. According to the value of the
code do the following (rather useless) things:
If code = 10, subtract 2 from the age, and print the member's
(new) data.
If code = 1 3 , double the sum assured, and print the member's
(new) data.
If code = 16, merely print the member's data.
Solution. We use the trick of labelling the first of the group of
instructions which deals with the case 'code = 10' with a 10;
similarly for 13 and 16.
Programme:
1)
Ml = TAPE 3
vO = TAPE
n4 = TAPE
18, nl = - 1
-»-n4
10) n3 = n 3 - 2
-•16
Notes
n1 — member's no., til = sex, «3 = age
vO = sum assured
n4 = code
-> 18 if end of tape, otherwise
Go to instruction labelled with code value
Subtract 2 from age and go to 16
13) v0 = 2 x v0
16
[Double sum assured and go to 16
16)
PRINT Nl, style
PRINT N2, style
PRINT N3, style
PRINT vO, style
PRINT N4, style
Print
->1
18)
STOP
Go to read next member if not end, otherwise
Stop
Note. The 16 after vO = 2 x v0 is unnecessary; the computer
would automatically run on to the next instruction which in this
case is label 16.
S. BENJAMIN
114
Subroutines
Most programmes of any length (say six instructions) are
written from the middle outwards. It is in fact a little awe-inspiring
to watch a very experienced programmer tackle a new problem
by starting at the beginning and working steadily through.
Fortunately there is a technique available which allows a problem
to be broken down into logical parts; each part can be programmed
separately and the parts can be joined together later. Each part,
consisting of a group of instructions, is called a 'subroutine';
these subroutines are then linked together by other instructions
which may also do further work between the subroutines. A subroutine is nothing more than a convenient group of instructions.
Example. Write a group of instructions to do the following job:
given Nx lies in v(100+x),x == 10, . . . ,99, form ax in vO; assume
that * is given in n\ and t in n2. Do not destroy n1 and n2.
Programme:
n3 =
vO =
v1 =
v0 =
nl+n2
v(100 + nl)-v(100 + n3)
v(100 + nl)-v(101+nl)
v0/v1
Notes
x+ t
Nx — Nx+t in vO
Dx = Nx-Nx+1
in vl
dx.ji in vO
Note. n3 and v1 have also been used.
Now it is very common when writing a programme to find that
we wish to use a subroutine again and again. Thus if we call the
above group of instructions 'subroutine A' a full actuarial programme might look like this.
Notes
Introductory instructions (say)
Subroutine A
Other instructions (say)
Subroutine A
Totalling instructions (say)
STOP
COMPUTERS AND ACTUARIAL SCIENCE
115
We can avoid writing the subroutine into the programme more
than once by two simple but neat tricks.
(1) Take the subroutine out and put it say at the end of the
programme. By giving a label, say 10, to the first instruction of
the subroutine we can reach it any time with a jump instruction
10. At this stage the programme would look like this:
Notes
—
Introductory instructions
-> 10
Go to subroutine A
—
Other instructions
10
Go to subroutine A
—
Totalling instructions
STOP
End of ' master' programme
10) n3 = nl+n2
v0 = v(100 + nl)-v(100 + n3)
vl = v(100 + nl)-v(101+nl)
v0 = v0/vl
Subroutine A with the first
instruction labelled 10
(2) Clearly this programme is incomplete; we jump successfully
to the subroutine the first time but we never return. We need a
' link' back to the main programme. In fact we need a jump-back
instruction at the end of the subroutine. However, the second time
we use the subroutine we need to jump back to a different point
from the first time, i.e. we need a variable jump. The modified
jump, e.g.
-^n10,
will do just this job provided we arrange that each time we want
to use the subroutine (a) we label the instruction we want to come
back to, and (b) we set n10 equal to this label before we jump to
the subroutine.
The programme now looks like this:
—
Notes
Introductory instructions as before
n6
S. BENTAMIN
nlO = 1
1)
10
—
—
—
—
nl0 = 2
- 10
2)2)'
Notes
Set (link) value of «10 equal to the
label of the return point
Go to subroutine.
Other instructions with the first
instruction labelled; this label was
the value to which n10 was set for
return purposes.
Set new (link) value of nl0
Go to subroutine.
Totalling
instructions with the
Totalling instructions
first instruction labelled
End
End
STOP
10) n3
n3 == n1+n2
nl+n2
vO
+nnl)-v(100
vO = v(100 +
l ) - v ( 1 0 0 + n3)
Subroutine
Subroutine A with first instrucinstrucv1 =
= v(100 +
1)-v(101 +
nl) > tion labelled
v1
+ nnl)-v(101
+ vl)
labelled 10 and return
return link
vO = v0/v1
v0/v1
added, i.e. -> n10.
10.
n10
->n10
Library subroutines
It is common in programming to have available a library of
useful, general purpose subroutines; indeed programming would
be extremely laborious without this facility for using the previous
work of other people and oneself. A library is usually used
without worrying about the inner workings of the subroutine
itself. However, it is essential that a full specification of the subroutine be given if it is to be used properly by others—and even
oneself after all the cunning tricks used have been forgotten.
For the above subroutine the programme would be:
10) n3 = n l + n 2
vO = v(100 + n1)-v(100 + n3)
v1 = v(100 + nl)-v(101+nl)
vO = v0/v1
-•nlO
The specification would read as follows:
Title
Form single-life annuity.
Process
Forms ax.^ from table of Nx.
Storage
Uses «1, n2, n3, nl0, n0, v1, v100-v199; label 10.
COMPUTERS AND ACTUARIAL SCIENCE
Use
117
The subroutine uses a table of Nx stored inv100-v199
so that Nx lies in v(100+X).
x must be set in n\ and t in n2 before entry.
n\ and n2 are not destroyed.
dx:J\ is left in vO on exit.
v1 is used during the calculation.
The link is set in n10.
The subroutine is entered by -> 10.
Notes. There is no check against using ages above 99; Dx is
formed from Nx — Nx+1 hence the maximum value of x +t is 98.
(As usual the specification requires more space than the programme
itself.)
Directives
We described a 'directive' at the beginning as something which
appeared on the programme tape and looked like an instruction
but was not. The only example given so far has been
(-*0).
The first thing that happens to a programme is that it is merely
read into the machine and stored in successive instruction boxes.
In practice it is necessary and convenient to interrupt this process
and get the machine to do other things. Thus we do not want it
to keep reading and storing programme tape for ever. The
directive ( -> 0), distinguished by the left-hand bracket, says ' stop
reading and storing programme and obey me now', i.e. jump to
the first instruction. This is the way we cause the machine to
start obeying stored programme. If we wished to start at instruction labelled 8 then the directive ( -> 8) would do the job.
There is usually, in any programming scheme, a list of directives
and they need not look like instructions. The warning character L
which is used with the TAPE* instruction is an example. However,
their various uses are difficult to explain within the context of
autocode.
How it is done
It is hoped that the reader who had no knowledge of programming
before will have gained a fair idea from the preceding sections of
how its basic rules work.
n8
S. BENJAMIN
The main criticism of the explanation given is that we have
tended to talk from time to time as if the computer did quite
complicated things, such as inspect the programme tape whilst
reading it to see if a directive was coming. The computer itself,
in spite of its mass of expensive electronics cannot do anything
as sophisticated as read a tape with intelligence. There has to be
a programme already in the machine to do the reading. This has
to be a well-written general purpose reading and preparing programme. Throwing the START switch in fact calls in this basic
reading programme which then starts to read in the characters on
your programme tape, using the directives to jump to different
parts of itself, analysing the sequence of characters as it reads
them, assembling your instructions and laying them into instruction boxes in the way the engineers demand. This basic programme
is so important that quite often the engineers arrange that it
cannot be over-written by mistake.
The basic programme is put in by the engineers.
Compilers and interpreters
The symbols, and the rules by which you are allowed to put
them together, constitute a programming 'language'. The autocode used here to describe programming is one such language.
The language of the machine itself is a compromise between the
demands of the programmers and the engineers who design it, and
price. It is invariably in a highly coded form which is not immediately intelligible and the instructions are more basic but more
general than those of autocode. The arithmetical instructions are
usually included, but even there the operations of multiplication
and division may not be given and may have to be programmed
by sub-routines. There would certainly be no TAPE* instructions,
but there would be facilities for shifting separate characters around
inside the boxes. To write programmes in machine language is
tedious in the extreme, and as programmers in general became
more and more fed up with it they started to design and write
more and more useful basic reading and assembling programmes,
which would read programmes written in different and more
simple 'languages' and convert them into machine language or
COMPUTERS AND ACTUARIAL SCIENCE
119
interpret them for the user. The rules of these languages (and
there are several of them) must be very closely observed by the
user, although a good designer will incorporate checks in his
interpreting programme to see that his conventions are obeyed.
Thus in autocode you can write
v(l + nl),
but you cannot write
v(nl +1).
The interpreting programme, written in machine language, reads
in the characters of your autocode programme one at a time and
examines them. It will accept the v, and will accept a left-hand
bracket immediately following, but it will not accept the character n
to follow; on finding the n it will jump to a part of itself which
prints out rude messages.
There are two main ways in which these interpreting programmes
can work.
(1) They can read your symbols and convert them into machine
language. Then the machine language translation of your programme
is obeyed by the machine. This translating programme is known
as a 'compiler'.
(2) They can read your symbols and merely lay them in the
store more or less as they stand. The interpreting programme can
then pick up groups of symbols representing your instructions
and interpret them as they stand without translating them directly
into equivalent machine instructions.
There are advantages and disadvantages to both methods. The
disadvantage of a compiler becomes apparent when something
goes wrong with your programme, because it may be, and usually
is, quite difficult to relate the translation to your original instructions, and in general the art of writing compilers is not yet advanced enough to dispose of this difficulty. An 'interpreter' on
the other hand is, at any one time, carrying out the operations
required by one autocode instruction and it is usually easy to find
out which.
The advantage of a compiler is that the translated programme is
then carried out at full speed. With an interpreter, on the other
I2O
S. BENJAMIN
hand, the whole process of interpreting is carried out afresh with
each autocode instruction. Thus to add 100 numbers together
MI
= 1
1) vO = vO+vnl
nl = nl + 1
1, 100 > nl
the loop of three instructions is obeyed 99 times. An interpreter
would thus have to process the same three instructions 99 times.
Furthermore, the interpreter must, of course, be in the machine
all the time, taking up space. The compiler, once it has carried
out its translation, can be removed, or overwritten.
The autocode used in these notes is in fact run on one machine
by compiling, and on another by interpreting. The language itself
remains unchanged.
TOWARDS AN ACTUARIAL AUTOCODE
There is no reason why we should not have an actuarial autocode, and the following notes are intended to indicate briefly the
way in which a possible language could be explored with a view
to laying down a full specification.
Let us write our interpreting programme in autocode. This has
the disadvantage that we shall be restricted to numeric characters
and it is also likely to be slow in operation, but for present purposes
this does not matter.
Consider a typical set of valuation instructions as we hand them
to our clerical staff:
Age 11-70:
(1) = sum assured,
(2) = Ax,
(3)(l)x(2).
In computer terms these mean:
(1) Read in a column of 60 numbers; they will be treated as
sums assured running from age 11 to age 70.
COMPUTERS AND ACTUARIAL SCIENCE
121
(2) Read in a column of 60 numbers; they will be treated as
single premiums running from age 11 to age 70.
(3) Form a third column of numbers by multiplying corresponding numbers in columns (1) and (2).
Hence our interpreting programme must be able to carry out
operations of this form, preferably allocating the boxes itself, and
certainly 'remembering' how the boxes have been allocated. In
order to do this the interpreting programme must have some
instructions to obey, and a format for the instructions must be
designed. Furthermore, any coding we decide upon must be
purely numerical. A typical actuarial autocode instruction could
take the following shape, e.g.
a
b
c d
e
f
00 3 1 2 11 70
i.e. it consists of 6 numbers a.../ in a line. These will be used as
follows:
(c) This is the number of one of the columns to be operated on.
(d) This is the number of the other column to be operated on.
(b) This is the number of the resulting column.
(e) This is the first age in the columns.
(f) This is the last age in the columns.
(a) This is to be interpreted as a function according to a given
code e.g.
00 means add
i.e. (b) = (c) + (d)
01 means subtract
(b) = (c) — (<d)
02 means multiply
(b) = (c) x (d)
03 means divide
(b) = {c)l(d)
Other functions with appropriate formats will be needed to read
and write, e.g.
20
4
means 'read in the next column from paper tape; we shall refer
to it in future as column (4); the tape is headed with the first and
last age from which the range is to be picked up automatically'.
Also perhaps
21
4
g
could mean 'print out column (4) in style g'.
122
S. BENJAMIN
The interpreting programme will read these instructions by a
method such as this:
n1 = TAPE
-•nl
i.e. it will read the function number and jump to the instruction
with the same label number. The interpreting programme will
be written in the form of subroutines covering the operations
required by each function. Provided the first instruction of each
subroutine is labelled appropriately the function will be 'obeyed'.
So far this is similar to the special autocodes which are widely
available for calculations with matrices. It is, however, usually
awkward in these schemes to start at any age other than zero.
Also the simple list of functions 00 to 03 given above will have to
be extended to carry out the operations on columns peculiar to
actuarial work.
One organizational feature of value can be suggested at the
outset. Frequently used commutation columns could be held on
a library tape for common use. These could be given numbers
over 1000 and a printed reference list made available to all users.
It would be part of the job of the autocode to inspect the programme,
note the column numbers over 1000, pick them off the library tape
and lay them into the machine ready for use.
We shall want the autocode to arrange its own space inside the
machine. Techniques for writing programmes which organize
the internal storage of the machine have been developed very
considerably over the last few years. Unfortunately, the compilerwriters, who are so adept at communicating with the machines,
are singularly inept at explaining their methods.
Basically, however, it is necessary to set up a dictionary in which
to place entries referring to the whereabouts of the data. To
allocate boxes inside the machine to the columns we need a
dictionary, each entry of which contains at least four items. These
would be: (i) column number, (ii) first age, (iii) last age, (iv) the
number of the v-box in which the first number in the column is
held.
These entries must be formed, by programme, whenever a
new column is read in, or whenever a new column is formed by
COMPUTERS AND ACTUARIAL SCIENCE
123
arithmetic on existing columns. A moment's thought will show
that items (i), (ii) and (iii) will always be available at this stage.
Since the length of a column is
last age - first age + 1
we can always find the position of the next empty w-box, which
will be item (iv) for the next column introduced.
This dictionary, however, itself occupies space, so we need a
dictionary of the dictionary. At least two entries are required in
this:
(a) the number of the next v-box which is free to receive the
next dictionary entry (this must be stepped up by 4 each
time), and
(b) the number of the next v-box which is free to receive a
column. This is useful but not absolutely necessary.
Generally a sophisticated autocode will be using dictionaries of
dictionaries to a considerable depth.
Good programmers would require approximately one to three
man-years of effort to get a really useful actuarial autocode into
operation. The profession has been 'exposed' for, say, 8000 manyears to date?
MONTE CARLO METHODS
Consider the following problem. In a throw of two dice, what is
the probability that the sum of the two is 7?
A simple application of probability theory gives the answer 1/6.
We could of course experiment with two real dice and throw
them repeatedly. We could also simulate this experiment without
the dice if we had a table of random numbers. By taking a table of
random digits and ignoring the digits 0, 7, 8, 9 we could treat pairs
of consecutive digits as if they were the result of a throw. By
counting the number of times a pair added up to 7 out of a large
number of pairs we could approximate to the answer required.
A knowledge of statistical theory—admittedly more than sufficient
to answer this problem in the first place—would also enable us
to estimate a confidence interval for the result.
S. BENJAMIN
124
The method of simulating a probability situation by using
random numbers is known as the Monte Carlo method. The
method has been successfully applied to non-probabilistic problems, but we shall be concerned with actuarial applications where
probability is involved, and the situation to be analysed is too
complicated for traditional methods.
Most useful applications of the Monte Carlo method require
the speed of a computer in order to carry out the simulation a large
number of times in a usefully short period of time. Its strength
lies in the fact that it is a numerical method but this is also its
weakness; it may fail to give any general insight into the problem.
Let us consider a few simple actuarial examples. In the above
example the appropriate way to use the random numbers was
obvious; sometimes it is less so.
Given a table of lx find the value of e50 say. We shall use the
fact that the probability of dying aged 50 +t last birthday is
Hence if we take a fraction/at random in the interval (0, 1) the
probability that
is the probability of death at age 50 +t last birthday.
The following process will estimate e50:
Use the table of random digits as groups of say five consecutive
digits with a decimal point assumed at the beginning of each
group, e.g. .12345, .09876, etc. These will be our random fractions
f', f"t etc. Form f'l50, then search down the lx table until some
l50+t.( is found such that f'l50 lies between l50+t and l50+t+1, i-e.
l
50+1 ^ f ' l 5 0
>
l
50+l+1
Then this value of t, say t', is our first estimate of e50. Repeat the
process with «, to obtain t" and so on. The average value of
t', t", ..., etc. from a large number of repeats will give an estimate
ofcjo-
Suppose we wish to estimate a50. We proceed as before and use
125
COMPUTERS AND ACTUARIAL SCIENCE
interpolation (first order, or higher) to find l50+t+e, where e is a
fraction of a year, such that
We then take
as our first estimate of a50. Our final estimate of a50 will be the
average of a large number of annuities-certain formed in this way.
In the above examples we have implicitly assumed that the
random numbers are uniformly distributed in the relevant range.
This is important and the regular users of Monte Carlo techniques
devote a great deal of effort into justifying the randomness, the
uniform spread, the independence, the lack of cycling, etc., etc.,
in the numbers they use. We shall not consider this subject here.
Unfortunately digital computers cannot be programmed to
produce random numbers in the way that a special purpose
electronic machine such as ERNIE will do, and much ingenuity has
been devoted to developing essentially arithmetic methods of
producing sequences of numbers which are sufficiently random.
On a computer it is considerably more convenient from the point
of view of storage and speed to use one of these methods rather
than to try to store a prepared book of random numbers.
As an example of such a method, consider the process
xn+1 = remainder (8x n /ll).
Taking x0 as 10 say, we have the sequence 10, 3, 2, 5,7, 1, 8, 9, 6,
4, and the cycle repeats. If fractions inside the range (0, 1) are
required then each of these can be divided by 11.
However, some experimentation soon shows that the constants
must be chosen quite carefully, in order to avoid short cycles,
monotonic increasing or decreasing values, going to zero and
staying there, etc., etc.
The following is a standard subroutine for generating pseudorandom numbers taken from the library of a well-known computer:
The method is given by the congruence
xn+1 = kxn(mod. 2 3 1 -l),
where xn+1 is the smallest positive integer satisfying the congruence, and
k = 455, 470, 314 = 1313 (mod.2 3 1 -l).
9
ASS 17
S. BENJAMIN
126
is an arbitrary starting number, preferably a positive integer
of the order of 109 but less than 231 — 1. The sequence is repeated
after 2 3 1 - 2 = 2,147,483,646 steps.
A random fraction can be obtained by dividing xn by 231 — 1.
' Clearly' this method is likely to produce a sequence of usefully
random numbers, depending on the idea that the constant multiplier
and divisor at each stage are prime to each other, and the remainder—which is used as the random number—must be less
than the divisor.
This method cannot be used with floating point numbers because rounding errors will not hold the required integers to
sufficient accuracy. (If the n-boxes had sufficient capacity one
could use them.)
A method of producing pseudo-random fractions in autocode,
developed for my own purposes, is as follows:
(1) start with a fraction which is pretty horrible—e.g. the
fractional part of A/2;
(2) multiply it by 10 repeatedly until it is greater than 1000;
the v-box is now holding a number with 4 places before the
decimal point and 5 after;
(3) take its square root (leaving 2 places before the point and
7 after);
(4) take the fractional part of this as the next random fraction
and go back to (2).
x0
The programme looks like this:
vO = SQRT 2
vO = FRAC vO
is set early on in the programme. The subroutine to generate a
pseudo-random fraction is
1) vO = vO x 10
-» 1, 1000 > vO
vO = SQRT v0
vO = FRAC V 0
->nl
127
COMPUTERS AND ACTUARIAL SCIENCE
and it is entered by setting the link nl and then jumping to label 1.
On exit the fraction is found in vO.
A few simple tests on the first thousand fractions generated by
this method showed them to be adequate, but the method is
definitely not recommended for examination purposes. It is also
rather slow.
A problem in reversions
Before proceeding to our main example we shall treat briefly
a particular problem which is a simple extension of the examples
given above; it is a familiar actuarial problem in reversions based
closely on a real case.
A fund is to be divided between six life tenants and a reversioner.
The size of the fund, the age and sex of each life tenant are known.
The basis is to be a(55) f and m mortality, 3£% net interest.
Income from the fund is to be taken as 8 times the capital value.
The terms of the will give priority to two particular life tenants
A and B whilst they are alive. Briefly A is to receive ,£306.25 per
annum (£500 per annum net of tax) as a first charge on the
income of the fund, then B is to receive £306.25 per annum and
the remainder is to be shared equally between all the remaining
surviving life tenants, including A and B. If at any stage there is
insufficient income these priorities must still be observed. At
each death the fund is to pay estate duty. The rate of duty from
the standard Estate Duty Table is based on the sum of
(i) a proportion of the fund which equals the proportion of
total fund income which was being received by that life
tenant immediately before her death, and
(ii) her other estate ('free estate').
If, however, her 'free estate' is less than £10,000 it is not added
in. (The 'free estate' of each life tenant is known.) The amount
of estate duty is found by applying the rate to the above proportion
of the fund. It is required to find the value of each life tenant's
interest, the value of the reversion and, as a check, the value of the
total estate duty paid.
This problem virtually defies treatment by traditional methods.
9-2
128
S. BENJAMIN
A brief description of its treatment by the Monte Carlo technique
is as follows:
Let the life tenants be A, B, C, D, E, and F. Let their ages be
a, b, c, d, e, f. Take six random fractions and, as explained above,
apply them to la, lb, ..., lf to find the times to death, including
fractions of a year by interpolation in the lx tables (m or f). Let
these survival times be ta, tb, . . . , tf. Sort them into ascending
order, say tlt t2, . • •, t6, remembering which relates to which life
tenant. The operation of the fund in this particular case may
now be followed through in detail, sharing the income according
to the rules, levying estate duty at each particular death and leaving
a final reversion. The values of the income to each survivor
between successive deaths may be found by using factors
The values of estate duty at successive deaths require the factors
and the value of the reversion is found by using v*». Repeat this
whole process a large number of times and find the average of
each of the required values. The ratios between these averages
may be used to express the answer in terms of relative proportions.
This problem was programmed in Autocode. Unfortunately it
has been run only on a machine which operates this Autocode
rather slowly, and each simulation took nearly 2 minutes (about
2000 three-address floating-point instructions obeyed from a
written programme of 450 instructions). At the end of ten simulations the results shown in Table 1 were produced.
From inspection of the coefficients of variation one would
expect 1000 simulations to give the required relative proportions
to a sufficient degree of accuracy for practical purposes. (It is
already clear that a great deal of estate duty is involved.) The
most powerful machine in existence today, the Atlas at Manchester
University, would carry out 1000 simulations in approximately
5 seconds at a nominal cost (without handling charges) of £1.
There is not much difficulty in programming this problem,
although the programme is long enough to require careful recording of which numbers lie in which box, etc. Perhaps the only
COMPUTERS AND ACTUARIAL SCIENCE
129
Table 1
Size of fund =£ 50,000.
Initial income = £1,720.07 p.a.
(1)
Average value of:
Income to A
(ii) Income to B
(hi) Income to C
(iv) Income to D
Income to E
(v)
(vi)
Income to F
(vii) Reversion
(viii) Estate duty
Sum of (i) -(vii)
(ix)
Sum of (i)—(viii)
(x)
£
4604.831
6961.933
1567.735
2386.488
6247.972
4503-839
9823.318
13903.884
36096.116
50000.000
(i)
(4)
Standard deviation of:
(0
(11")
(iii)
(iv)
(v)
(vi)
(vii)
(viii)
2463.752
4184.749
750075
2641.701
2848.315
3090.322
2026.843
1959.965
(2)
As proportion
of (x)
009210
013924
003135
0.04773
012496
009008
019647
0.27808
(3)
As proportion
of (ix)
0.12757
019287
004343
006611
017309
012477
0.27214
(5)
Coefficient of
variation
= (4)/(l)
0.53504
0.60109
0.47845
1.10694
0.45588
0.68615
0.20633
014097
programming technique used which has not been explained
earlier is that required by the sentence 'Sort ta, tb, ..., tf into
ascending order, say tlt tit . . . , te, remembering which relates to
which life-tenant.'
A simple method of sorting a few items is that of comparing
pairs and inverting them if necessary. Thus, compare ta with tb
and invert them if ta is greater than tb, then compare the resulting
U with tc, etc., until te with tf. Then start again. In each run
through count the number of inversions made; when this count
is zero the process is finished. 'Remembering which relates to
which life tenant' is performed by setting up the numbers 1 to 6
and inverting them when an inversion is made on the t's.
Supposed,.. .,v6contain 1,.. .,6; v7,...,v 12 contain ta,.. .,tb.
vO is working space for inversions.
13°
S. BENJAMIN
3) n1 = 0
n2 = 0
2) ->1, v(8+n2) > v(7 + n2)
vO = v(7 + n2)
v(7 + n2) = v(8 + n2)
t)(8 + n2) = vO
vO = v(1+n2)
v(l + n2) = v(2 + n2)
v{2 + n2) = vO
nl = n1 +1
1) n2 = n2 +1
-> 2, n2 = 5
-»• 3, n1 == 0
End
Notes
Counter of inversions
Modifier
]
Jump if right order, otherwise
reverse using vO as working space
J
R e v e r s e c o r r e s p o n d i n g p a i r o f1 . . . I
Count the inversion
Next pair
Loop unless 5 pairs completed
Repeat unless no inversions
Provided the above programme contains no errors, we have the t's
in ascending order in v7,... ,v12 and the corresponding identifying
numbers 1,... ,6 in v\,... ,v6, where v1 relates to vl, etc. Thus vl
contains the number of the life tenant who dies first and v7 contains
the time to her death, etc. The programme was written to take
any number of life tenants up to ten, and the part which followed
through the rules of the will was gathered into one subroutine.
Hence by rewriting only this subroutine any similar problem can
be run on the same programme in future.
Once programming methods and computer techniques become
everyday knowledge in the profession we can look forward to an
article in J.S.S. showing how to look at almost any reversions
problem in a standard way, so that apart from reading in a few
details particular to the case in hand the same programme will
cope. Thus, for example, it will be explained that children of life
tenants should be treated as dummy life tenants in a certain way;
that different rates of interest should be applied to each life tenant,
the above example being a special case of the general, etc. An
alternative would be the development of a special autocode which
would enable each problem to be programmed very quickly and
easily, such as the 'Montecode' developed for simulation work in
the iron and steel industry, where statements of the type 'SCAN'
can be made and where one can move automatically to the equivalent of the next death.
COMPUTERS AND ACTUARIAL SCIENCE
131
With luck such an article may appear in J.S.S. within the next
two years, say within thirty years of the first actuarial interest in
computers. The article may even be written by someone who is
interested in reversions.
STOP-LOSS AND ALL THAT
OR
MURDER IN THE PENSION SCHEME
Most traditional actuarial work can be effected by commutation
functions because the values required are essentially 'expected'
values. The most that is usually required in the way of variation
about the expected is that the final value should be on the safe side;
furthermore, it is usually, though not always, clear how to obtain
a suitable margin.
In recent years a type of contract, namely group life assurance
with rebate of premium, has come into prominence, for which
traditional actuarial methods give no adequate answer to the problem of calculating a premium. The problem is essentially one of
'variation' in mortality experience. A typical contract will charge
a premium P for a one-year temporary assurance on a group of
lives; at the end of the year a rebate is given if 0.9P > C where
C is the total claim. The amount of the rebate is .8(.9P.C).
It is easy to write down an equation for the premium; if the
true expenses are (1 —g)P, the net premium gP must support the
claim and any rebate, i.e.
where p(C) is the probability distribution of the total claim C.
The difficulty has all been swept into the expression p(C). A
glance at the recent paper by P. M. Madders in f.S.S. 16, 346, gives
an idea of the ingenuity required to obtain a numerical solution.
The tradition of Continental actuaries has been somewhat
different, and they have been grappling with claim distributions
for a long while. Their approach has been analytical, under the
heading 'The Theory of Risk' and the main line of attack has
I32
S. BENJAMIN
been that of curve-fitting—with the usual difficulties of this approach that a compromise must be found between curves which fit
the data and curves which are amenable to analytic manipulation.
The natural approach via computers would be quite different
and the following pages are devoted to using the simulation method
(Monte Carlo) to obtain claim distributions and premiums for
various types of contract, including
(a) group life with rebate,
(b) 'stop-loss' reinsurance—where the reinsurer pays the
excess above a given amount when the total claim exceeds
this amount, and
(c) 'excess-of-loss' reinsurance—where the reinsurer pays the
excess above a given amount on each individual claim which
exceeds the given amount.
'Stop-loss' is an interesting form of insurance (or reinsurance).
It is very new in the life field but considerable interest in it seems
to have arisen recently. It is suitable for pension schemes and
new life offices but the accepting market is very small and seemingly
haphazard. There is also the possibility that the life offices will
resist its introduction on the grounds that it might 'kill' the usual
methods of group assurance and reinsurance.
The problem of calculating stop-loss premiums is virtually the
same as that of calculating group-life premiums with rebate. The
latter are quoted freely at the moment, but so far as I know the
tariff rate has merely been picked out of the air at 10% above the
normal premium (without rebate).
Let us consider the basic problem. Given the age x and the sum
assured S for each member of a group scheme, and a suitable
mortality table, the expected claim for one year is
where St = sum assured for the ith member, qt = value of qx for
the ith member, N = number of members, i = 1,.. .,N.
Suppose we now choose a certain value A, e.g. twice the expected
claim, and ask an insurer to pay only when the total claim exceeds
this value—known as the 'priority' or the 'deductible'. We now
COMPUTERS AND ACTUARIAL SCIENCE
133
need to know the way the total claim will fluctuate, i.e. we need
the distribution of total claim, and for this purpose the Monte
Carlo technique is a 'natural'. All we have to do is to simulate
one year's mortality experience a large number of times. Suppose
we do 1000 simulations, obtaining 1000 examples of possible total
claim, say Cv C2, . . . , C1000. By summing those values of C which
are greater than the given 'priority' A, and dividing by 1000, we
obtain a close estimate of the pure premium required for a stoploss insurance, i.e.
(To find the premium for a group life contract with rebate a
little further work is required.)
There are several methods of carrying out the simulation.
Method I
This is the straightforward method.
Take each member i and read in his values of age xt and sum
assured St. Look up his mortality rate, say qt. Generate a random
fraction/. I f / < q we say that member has died and add his sum
assured St into the claim total C, otherwise not. Then we pass on
to the next member. When we have dealt with all N members we
have built up a total claim, say Cx. By repeating the whole process
1000 times we obtain 1000 simulated claim-totals C1... C1000.
Clearly if/is uniformly distributed in the range (0, 1) then the
probability that f < q is q and we are 'killing off' the members
with the required probabilities.
The programme could look as follows:
We require two data tapes:
(a) A table of qx; suppose this starts at age 11 and ends with
the marker L; it is read into v11 onwards.
(b) The members' data consisting of pairs of numbers x, S and
terminated by any negative number, say —1. We assume
the end of the paper-tape has been joined to the beginning
to form a continuous loop which will just run round and
round.
S. BENJAMIN
134
We reserve boxes v201,.. .v1l200 for the totals of the 1000
simulations; v201 will be used for the total claim from the first
run through the scheme and so on. We use n2i to count the number
of simulations up to 1000 and also as a modifier to step appropriately through v 2 0 1 , . . . ,v1200.
We put the age x in box n\ and hence we shall find qx in box vn\.
We put the sum assured S in vl.
Notes
v0 =
= SQRT
SQRT 2
2
vO
\ Set opening value of random
vO = FRAC VO
vO
VO
/ fraction in
in vO
v0
STOP
T
STOP
Too insert qx tape in tape-reader
vll = TAPE*
vll
Read qx tape into fvll
l l onwards
STOP
T
STOP
Too insert members' data tape
til
n2 = 0
Counter for number of simulations
v(201 +n2) = 0
for total claim
Clear box for
1) v(201+n2)
Read x
3) n\ = TAPE
2, 0 > n1
n1
Jump if age is negative, i.e. end
endofof
-> 2,
data
v1
Otherwise read S
1 ) 1 == TAPE
4) v0
4)
vO =
= v0
vOxX10
10
vO
vO
vO
vO
4,
4,
=
=
=
=
1000 > v0
1000 > vO
SQRT vO
SQRT vO
FRAC vO
FRAC vO
Generate
~
a random fraction in
' v0
Jump back to read next member if
Jump back to read next member if
f > qx, i.e. if member does not
f > qx, i.e. if member does not
die, otherwise
die, otherwise
Add <S into claim total
v(20l+n2)
= v(201
v(201+n2)
+ v1
l
v(201 +n2) =
+n2) +
Add 5 into claim total
Go back to read next member
->3
-> 3
Go back to read next member
We
end
2) n2 = n2
n2 +
+1l
We only reach this point after end
of data; so step up
up n2,
«2, and
and
-> 1, n2=
n2 =1000
1000
Start all over again
End
STOP
End
Directive to
( 0)
0)
to start obeying
programme.
3,
3, vO
vO >
> vn1
vn\
This programme contains 20 instructions written. Let us count
how many are obeyed if the scheme contains N members. We
need concern outselves only with the major loops.
(a) Each random fraction requires at least 8 instructions
obeyed because the pair of instructions 4) and
-4 are
obeyed at least 3 times.
n
COMPUTERS AND ACTUARIAL SCIENCE
135
(b) Each member starts at 3) and apart from the few (say 5 per
1000 on average) who die, they all continue until the
conditional loop back at -> 3, vO > vnl. Say iV(4+a) =
12N instructions obeyed.
(c) Each simulation starts at 1) and continues until -> 1,
nl = 1000. Say 1000(3 +b) = 1000(3 + 127V) instructions
obeyed. Thus if N = 1000 members we have 12,003,000
instructions obeyed.
(d) To this must be added reading time for 2000N numbers.
To digress for a moment; one of the most difficult things to do
is to estimate how long a job will take to do on a computer.
However, if the inner loop of the programme can be specified,
even writing it down in autocode is a big step towards estimating
the time required. Unfortunately, in many data processing jobs it is
extremely difficult to decide what the inner loop of the programme
will contain until the job is at an advanced stage of specification.
In the case of our present example we have a scientific programme
rather than a data-processing one, i.e. small input and output, and
short-written programme with tight loops obeyed a large number
of times.
Thus one could estimate the time to do our present example
fairly well from the above information. For any particular machine
one would want to know the average instruction time, the time
for subroutines such as generating a pseudo-random fraction, and
the speed for reading data (including re-winds if on magnetic tape).
A rough guess at some timings at two extremes would be
(N = 1000):
In Pegasus autocode on Pegasus—note that most autocodes can
be run on more than one machine; some autocodes can be run on
the machines of different manufacturers—the instructions are
obeyed at about 20 per second making 170 hours together with
paper-tape reading time of say 30 hours. Say approximately
200 hours.
On Atlas, operating one machine instruction per microsecond,
perhaps approximately 2 minutes would be required, allowing for
several machine instructions to each autocode instruction.
136
S. BENJAMIN
This problem was set to the Students Society Programming
Course. It was carried out in machine language on Pegasus with
the data on magnetic tape and took about 10 minutes. This figure
is totally inconsistent with the above figures. It is in fact about
200 times faster than it would be on a straight comparison but this
was due to the use of a different method.
A factor of 200 represents in terms of cost a reduction from pounds
to pence and in my opinion makes the difference between making
the use of Monte Carlo methods for these problems prohibitively
costly and making them extremely cheap. The nominal cost of
½ second on Atlas to quote a group life premium would be swamped
in the handling charge.
We turn to Method II.
Method II
(The method described here is an improved version of the one
used by the Students' Society Programming Course. It is in fact
a direct result of criticisms by the 'students'. Similarly, I would
expect in the future that if the new Advanced Study Group
becomes the focus of actuarial research which it deserves, then
any project handed to it is likely to suffer considerable change
for the better by the time the 'students' hand back the
answers.)
The trouble with Method I is that most of the random fractions
generated—199 in 200 on average—are wasted on survivors. By
avoiding this waste Method II achieves its considerably higher
speed.
Suppose we had carried out 1000 simulations by Method I and
laid out the deaths as follows:
Simulation
Member
1
2
3
N
Total claim
1
2
3
4
500
501
S1
S1
S2
St
c,
1000
Sa
Ss
SN
c2
C2
s3
SN
SN
C4
C100
C501
C100
COMPUTERS AND ACTUARIAL SCIENCE
137
Method I worked down the columns. In the above tableau, in
the first simulation member 1 survived, member 2 died, etc.; in
the second simulation member 1 survived.. .member TV died; and
so on.
Suppose that instead of doing this we try to fill in the whole of
the top row first, i.e. member 1, and then pass on to the next row,
member 2, and so on. Consider the row for member 1 and let us
go straight for the interval between his successive 'deaths'. In
the tableau, member 1 died in simulation year 3 and again in
simulation year 1000.
Now the probability that member 1 dies in any simulation year
is qx since his age does not change from one simulation (year) to
another. Hence the probability that he first dies in simulation
year r is
and we note that
Thus if we generate a random fraction/ and sum the series
until we have
and
then we may take simulation year r as the year of first death of
member 1. If r goes longer than 1000 then he does not die at all
in the whole 1000 simulations.
Having found his first year of death, we can revive him and find
the interval until his next death in exactly the same way.
From the above we have that
as can be seen easily from first principles. Hence, having
generated f we need to solve
1-pr = f
S. BENJAMIN
138
to find r. In general r will not be an exact integer and we need the
next higher integer.
We can simplify further by noting that if f is a random fraction
uniformly distributed in the range (0, 1) so is 1 —.f So we may
write more simply
Pr=f
to the next higher integer.
or
We can tabulate the values of log px at the beginning of the
programme, then to find r we need only to generate/, take its log
and divide by the tabulated value of log px.
Successive values of r are added together until 1000 years are
covered; we then pass on to the next member.
The basic flow-chart for this programme is as follows:
Set C1t.. .C1000 = 0
Read a member's x, S
Set simulation-year counter R = 0
Generate f
Form r
Add r to simulation-year counter R
?R > 1000
Yes
No
Add member's S to CB
A test for end of scheme data (e.g. age = — 1) should be inserted
after reading each member's data.
The programme would be:
Notes
V0 = SQRT 2
V0 = FRAC V0
STOP
V11 = TAPE*
«2 = 0
\ Set opening value of random
/ fraction in vO
T o insert qx tape in tape-reader
read qx tape into v11l onwards;
n0 then equals the number of qx
Read in
COMPUTERS AND ACTUARIAL SCIENCE
139
Notes
5) v(ll+n2) = l - v ( l l + n 2 )
]
v(ll+n2) = LOGV(11+N2)
n2 = n2 +1
->5, nO > n2
n2 = 0
6) v(201 +n2) = 0
n2 = n2 + 1
-> 6, n2 =# 1000
STOP
[Replace the qx by log px using a
I short loop of instructions
j l n this programme v201-vl200
I must all be zeroized beforehand
[ t o build up the claim totals
C 1 . . .C 1000 .
T o insert members' data tape
1) n2 = 0
Zeroize R for new member
nl = TAPE
-> 2, 0 >
Read x
n1
vl = TAPE
4)
vO = vO x 10
4, 1000 > vO
v0 = SQRT vO
End of data tape if age is negative
Read S
I Generate a random fraction/
in vO
vO = FKAC vO
v2 = LOGV0
Logf
v2 =
v2/vn1
v2 = INT
V2
v2 = v2 + 1
n3 =
v2
n2 = n2 +
n3
-> 1, n2 > 1000
Log f/log Px
Integer part
Next higher integer = r
n3 = r (see note below)
Add r to R
New member if we have over-shot
the 1000 simulation years,
otherwise
v(200 + n2) = v(200+n2)+vl Add sum assured to CR total and
2)
4
STOP
(
0)
generate a n e w f
End
Directive to start obeying
programme
(Note, n-boxes and v-boxes cannot be added together directly.)
The advantage of this method is that every random fraction
generated is used directly to produce a useful death.
A string of 1000 sample values of total claim, in random order,
is not a very useful thing to print out. If we wish to process them
in any way we can do it by programme. Visually a histogram is
more useful. Some members of the Students' Society course took
an interval of 5 % of the expected claim and produced the following
S. BENJAMIN
140
distributions for an actual group life scheme, using A49/52 select
and A49/52 ult.
Amount of
Number of times
claim as a
total claim fell in
percentage
the interval when
of expected
the basis was
claim
A49/52sel. A49/52ult.
051015-
202530-
16
0
0
4
39
32
21
35-
8
40455055-
4
606570-
7580859095100105110115120125130135140145-
59
44
25
25
23
32
86
35
23
24
57
41
36
39
18
23
45
22
20
25
14
2
0
3
1
8
8
11
23
7
25
14
31
50
32
49
54
44
67
55
43
66
44
47
45
22
50
45
22
25
16
Amount of
claim as a
percentage
of expected
| Claim
150155160165170175180185190195200205210215220225230235240245250255260265270275280285290295300-
Number of times
total claim fell in
the interval when
the basis was
A49/52sel. A49/52ult.
14
31
11
8
7
20
10
9
15
6
2
7
3
4
3
1
4
3
0
0
0
0
0
0
1
0
0
1
0
0
14
16
5
17
10
7
5
6
3
4
2
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1000
1000
In general the distribution of total claim is not Normal—it
depends on the distribution of sums assured—and this is where the
analytical difficulties arise. The data used by the Students' Society
were, however, from a works scheme in which the sums assured
were within a very narrow range and the above distributions may
be found to be near Normal.
COMPUTERS AND ACTUARIAL SCIENCE
141
The following figures summarize one run of this experiment:
Number of members
1339
Total sum assured £942,700
A 49/52 sel.
Expected claim Sq
S2q
Expected no. of deaths q
Mean claim from simulations
£2626.3
1,894,073
A49/52 ult.
£5269.6
3,800,302
3.753
£2569
7.536
£5214
We can test the deviation of the mean claim from the expected
value by using
=
var
whence
S.D.
=
Sq,
S2q/1000,
A49/52 sel.
A49/52ult.
-1.3
-0.9
Neither is significant at the 5 % level and the simulations can
be accepted as sufficiently good for further use.
The calculation of a premium with rebate
To find a group life assurance premium, with rebate, on the
formula stated at the beginning of this section, viz.
we need to solve the equation given there in analytical terms. In
terms of our simulated claim totals C I . . . C 1 0 0 0 the equation
becomes
i.e. the premium over 1000 simulations must support the claims
and the rebates.
The formula we shall discuss puts g = 1 and is in general
IO
ASS I7
142
S. BENJAMIN
The natural computer approach to this is by successive approximation. (Iterative methods are obviously well-suited to
computers.) The method used first calculated the value of
for the two extremes P1 = 0, and P2 = maximum value of Ci.
We have/(0) < 0 andf(max Ci) > 0 by inspection. We then use
successive binary cutting of the interval until f(P) = 0. Thus the
next trial value of P is
P 3 = ½(0+max. Ci).
If/(P3) < 0 substitute P3 for P1 and take P4 = ½(P3+P2).
If/(P3) > 0 substitute P3 for P2 and take P4 = ½(P1+P3).
Iff(P3) = 0 this is the solution.
Etc.
We have reached the stage where we can say that the 'student'
should be able to programme this for himself. (It is worth inserting two tests for the end of the process;
or
where e' and e" are suitably chosen small constants. Also the
programme should be written to read in different values of k and
a.)
Some numerical results
If we put k = 1 so that some proportion, a, of the full difference
between the premium and the claim is returned we can see that
if a = 0 then we have a straight contract for which we have
P = C from the sample,
(i)
or
P = Sq from the population.
(ii)
If a = 100% then
P
max. Ci from the sample,
(iii)
S from the population
(iv)
P
or
will satisfy the contract.
143
COMPUTERS AND ACTUARIAL SCIENCE
(i) Differs from (ii) because of random fluctuation. This is also
true for (iii) and (iv), but from a random sample of only 1000
values we find max Ci is considerably less than S. Otherwise,
if a = 100%, P is independent of the mortality. In the scheme
used above we had
S = £942,700,
max Ci = £7,500 on A49/52 select
£11,800 on A49/52ult.
(We return to this point later.)
Now it is intuitively clear that the greater a becomes, i.e. the
greater the proportion returned to the scheme, the greater the
element of profit-sharing and the less relevant is the mortality.
Some experiments were carried out in order to find at what size
of a the premium stabilizes. Values of P for different k and a were
calculated from the simulations carried out on the two bases
A49/52 select and A49/52 ult., the former being conveniently
about one half of the latter. The results were as follows:
Premium for given group life scheme where rebate is of form
α(kP-C)when kP > C.
%α
0
20
40
60
80
100
0
2569
5214
2569
5214
2569
5214
2569
5214
2569
5214
2569
5214
20
2569
5214
2571
5215
2572
5216
2574
5216
2576
5217
2577
5218
40
2569
5214
2579
5220
2589
5226
2600
5232
2611
5238
2622
5244
60
2569
5214
2597
5238
2627
5263
2659
5289
2694
5316
2731
5344
80
2569
5214
2631
5286
2702
5367
2787
5459
2889
5565
3019
5690
100
2569
5214
2688
5388
2844
5614
3071
5939
3463
6496
7500
11800
%k
Upper figure is premium on A 49/52 select.
Lower figure is premium on A49/52 ultimate.
10-2
144
S. BENJAMIN
For k = 100% the range of a was further subdivided to give
P
%α
A49/52 sel.
80
85
90
95
96
97
98
99
100
3463
3629
3862
4242
4364
4514
4709
5037
7500
A49/52 ult.
6496
6725
7052
7626
7806
8033
8344
8832
11800
These figures seem to demonstrate that the premium to be
charged on a rebate formula is virtually as sensitive to the mortality
basis as is a straight temporary assurance premium until we reach
values of k and α of the order of 99.9%. In view of this perhaps
the phrase 'profit-sharing' which is often applied to these contracts
is inappropriate.
Calculation of a stop-loss premium
In a stop-loss insurance a certain figure, known as the 'priority'
or 'deductible' is named; if the total death claim for the year
exceeds this amount the insurer pays the excess.
The simplest way to find the premium for any value of the
'priority' is to sort the simulated claim totals into ascending order.
Let us call the result C1... C 1 0 0 0 .
Suppose as a typical example the 'priority' is to be set at twice
the expected claim. By inspection of the string of sorted values
suppose we find that twice the expected claim lies between C 8 7 5
and C 8 7 6 (a typical result). Then the pure stop-loss premium before
loadings is
(Ci - 2 x expected claim)/l000
Ci -125 x 2 x expected claim
Hence the summation column
programme of course.
1000.
is worth tabulating—by
COMPUTERS AND ACTUARIAL SCIENCE
145
If the 'priority' is set equal to a particular value of C, say Cr,
then the premium becomes
[C 1000 +C 999 + . . . +C r -(1000-r+l)C r ]/1000
= [C1000 + C999+ • • • +C r + 1 -(1000-r)C r ]/1000
Hence the summation column
is worth
tabulating since it gives the premium corresponding to any
'priority' immediately.
Sorting
The above paragraph requires us to sort 1000 numbers into
ascending order, and clearly the method of inverting pairs which
was described earlier become unwieldy.
Several methods of sorting on computers have been developed,
all of them extremely cunning. One method in common use for
sorting data both on magnetic tape and internally in the store is
a 'string-merging' process, the principle of which can best be
indicated by an example:
Suppose the numbers are first divided into two, approximately
equal, parts A and B:
A
7 8 6 10 3 5
1 2 9 11 4 12
B
We set up two other areas C and D to receive them, and the
numbers are read successively from A and B into C or D according
to certain rules.
First, we define a string as a group of consecutive numbers
which are in ascending order. We may mark off the strings in A
and B as follows:
A 7 8 6 10 II 3 5
B 1 2 9 11 4 12
Thus A contains three strings A1, A2, A3, and B contains two
strings Bl, B2. We merge A l with Bl and write the result to
area C thus:
Take the first member of A and the first of B, i.e. 7 and 1.
Since 1 is the smaller, write it to area C and bring up the next
146
S. BENJAMIN
member of B, viz. 2. Compare 7 with 2. Since 2 is the smaller
write it to C and bring up 9. Compare 7 with 9. Now 7 is the
smaller; write it to C and bring up the next member of A, viz. 8.
Since 8 is smaller than 9 write 8 to C. The first string of A is
finished so write the rest of B viz. 9 and 11 to C. Now deal with
the second string of A and the second of B similarly but write
the results to area D; and so on. The final result will be:
c 1 2 7 8 9 11 3 5
D 4 6 10 12 |
We now pass back to areas A and B in the same way and continue the passes until we have only one string.
Since the length of the strings roughly doubles at each pass the
process is fairly efficient.
Fortunately one can reasonably expect any machine to be supplied with standard sorting subroutines as part of its 'software'
(as opposed to 'hardware').
Calculation of excess-of-loss premiums
An excess-of-loss insurance is similar to a stop-loss contract
except that the 'priority' is applied to each claim individually.
There is probably a mnemonic for remembering which is which
but I do not know one, and I find the only solution is to write it
down on a piece of paper at the beginning of any discussion.
In the simulation programme it is now necessary to set aside two
sets of 1000 locations each in which to sum the claims. Suppose
the priority is set at £1500. Every time a member dies his sum
assured must be tested. If it is greater than £1500 the excess
must be carried to the appropriate simulation year in the second
set. The premium for the excess-of-loss contract is then the mean
of the 1000 values in the second set.
I understand that the real experts then apply a stop-loss to the
excess-of-loss total, but they have not invented a special name for
this yet.
Probabilities of ruin
If we wish to investigate the probability of very high values of
total claim—and some people do—then even Method II becomes
COMPUTERS AND ACTUARIAL SCIENCE
147
too lengthy. Thus if we wish to find the level of total claim which
would be exceeded with a probability of only 1:1000 then 1000
simulations would supply one example (the largest claim) on
which to base an estimate; 100,000 simulations would be required
in order to base an estimate on a sample of 100 values. With ' ruin'
probabilities of the order of 1:1,000,000 even Atlas would become
expensive.
The following method appears to work but the only support
I can give for its theoretical validity is that three persons whose
opinions I respect have said that they cannot see anything
obviously wrong with it. Part of my suspicion arises from the
fact that it has a peculiar feature which makes it too good to be
true.
Method III
One simulation is carried out as follows:
Let qi be the mortality rate for (the age of) member i. Let us
kill off all the members of the scheme one after another, without
revival, and take a note of the total claim at each stage. Let 2} be
the total after the jth death. The process of killing must select each
death with a probability equal to the probability that out of the
survivors at that stage that member will die, i.e.
qi/ qi,
where the denominator is summed only over the survivors.
Thus, if there are N members of the scheme (i = 1 . . . N) in
any order, form the summation column
Qo = 0,
Q1 = q1,
Q2 = q1 + q2,
QN = q1 + q 2 + . . . + q N .
Generate a pseudo-random fraction f, uniformly distributed in
the interval (0, 1). Form fQN and search down the Q column until
Qi-1
fQN
<Qi,
148
S. BENJAMIN
and take the ith member as the one to die. His sum assured Si is
then copied away to T1 and represents the total claim after one
death in the first simulation.
In order to prevent killing him again in this simulation we may
set his sum assured in the list of original data, negative.
Now adjust the Q column to omit qi and repeat the process.
Form a newf. Form fQN-1. Search down the column until
Q i-1
< Qi
fQN-1
and take numberj as the next death. His sum assured Si is added to
the contents of T1 and copied in T2 and we have the following totals :
total claim after 0 deaths = 0 in box T0,
total claim after 1 death = Si in box T1,
total claim after 2 deaths = Si + Sj in box T2.
Now Sj in the original data must be set negative as a marker
that member j is also dead.
The process can be carried on until everyone is dead. At each
stage the sum assured for the dying member has to be found by
counting down the data omitting those members whose sum
assured is already negative. We end up with an increasing sequence
of totals
To,T1, T2, . . . , TN,
where To = 0 and TN = Si because everyone is dead.
If we carry out this complete simulation say 100 times we can
consider the results tabulated as follows:
Total claim after r deaths
r
Simulation
1
1
0
r
...
N
T1(1) . . . Tr(1) ... TN(1)
TI(2) ... Tr(2)
To(100)
T1(100)
2
100
...
TO
(1)
Tr(100)
... TN(2)
... TN(100)
The entries in the first column will all be zero and the entries in
the last column will all be equal to the total sum assured Si.
COMPUTERS AND ACTUARIAL SCIENCE
149
Now consider a particular interval. For a scheme of 1000 lives
with expected claim of say £5000 we might be interested in the
short interval £15,000-£15,499. The probability that the total
claim lies in this interval may be expressed as
probability claim lies
probability there
in the interval, given
are r deaths
r that there are r deaths
Taking the second term first, using the Poisson distribution we
may take this as
e-mmr\r!
where m = the expected number of deaths.
An estimate of the first term may be found from the tableau of
our simulation results. If we look down the column headed
'r deaths' and count the number of times, nr, out of 100, that the
value of Tr lies in the given interval then nr/100 is an estimate of the
probability that, given r deaths, the total claim lies in the given
interval. Doing this for all columns we can form
(nr/100)(e-mmr/r!)
quite simply to obtain the required probability.
Similarly, if required, the whole range of total claim from zero
to total sum assured can be covered by suitable intervals.
Method III in practice
As described above method III sounds very lengthy, and is.
Fortunately in practice there is a saving feature. Consider a scheme
of say 10,000 lives, in which one might expect about 50 deaths.
To determine orders of magnitude we may use numbers of deaths
rather than amount of claim. With an expected number of deaths
equal to 50, the standard deviation of the number of deaths is
about 7. Hence we are very unlikely to be interested in practice
in claims involving more than 90 to 100 deaths, i.e. 6 to 7 standard
deviations above the mean. Hence it is unnecessary to carry the
simulations beyond the first 100 or so deaths—a stopping rule
based on the total claim to date can be built into the programme.
S. BENJAMIN
150
The first implication of this simplification is that the amount
of storage required is cut considerably. The number of boxes
apparently required at first was 10,000 for the basic data of sums
assured, plus 100 simulations x 10,001 for the various values of T,
i.e. over 1,000,000. In practice 10,000+100x100, i.e. 20,000
boxes only are required. Internal storage for 1,000,000 numbers
is very rare as yet; machines with storage for 20,000 numbers are
becoming more common these days.
The second implication is that if in any one simulation we are
going to kill only 1 % of the members, it is unnecessary to go
through the long routine of adjusting the Q column at each death.
If we leave the Q column unchanged we shall from time to time
try to kill a member twice, but inspection of his data will show
his sum assured set negative and we can merely ignore this particular
death. The number of times this will happen will be very small
indeed. Clearly this also simplifies and speeds up the processing
very considerably.
In practice the data are usually presented in age order, or can
be sorted into this order, and it is unnecessary to carry a full
column of Q. If the youngest age is a and the oldest b and the
number of members at age x is Nx then two short columns
Ma
= Na
Ma+l = Na + Na+1
Mb
Ra
= Naqa
R a +1 = N a q a + N a + 1 q a + 1
= N a + N a + 1 + . . . + N b Rb
= Naqa + Na+1qa+1 +
+ Nbqb
are all that is required.
A search down the R column comparing with fRb establishe
the age group; e.g.
Rx < fRb
Rx+1
establishes age x; then
i = INT[(/R b -R x /q x ] + l
establishes the ith member of that age group, i.e. the (Mx + i)th
member of the scheme, as the member to die.
COMPUTERS AND ACTUARIAL SCIENCE
151
This method was programmed and tried out on the scheme
used in our earlier numerical examples. We found the probability
that the total claim would lie between five and six times the
expected claim i.e. £12,845-£15,414 on A49/52 select and
£26,085-£31,302 on A 49/52 ultimate. The results were .300 x 10 -7
for the former and .222 x l0 - 1 3 for the latter.
Method II would presumably have required about 108 and 1014
simulations respectively to throw up examples of such extreme
claims. (As a guide 1014 microseconds = 31/4 years approximately.)
Peculiarity of Method HI
In Method III the major part of the work is carried out by the
time we have found the values of nr, and all that remains in order
to calculate the final expression is to form the Poisson probabilities
e-m, e-m, e-mm2/2!, . . . and carry out a few multiplications and
additions. But until that final stage nothing we did involved using
the absolute values of the mortality rates—only their relative
values to each other, i.e. using mortality rates equal to kqx where
k is a constant for all ages would have produced the same result.
It is only at the stage of using m = expected number of deaths
that we use the absolute values of qx.
Hence if we wish to find the claim distribution, with special
emphasis on its awkward top tail, on several mortality bases kqx
for different values of k, Method III produces the extra results
very quickly.
It is not the purpose of these notes to discuss the statistical
decision problem of allowing for uncertainty in the mortality basis
to be used in the premium quotation for a given scheme, but in
any calculation involving alternative hypotheses, Method III
should be extremely useful.
S. BENJAMIN
152
EXAMINATION PAPER
May 1984, Part 13, Paper 7
1. In what circumstances would it be appropriate to carry out
a Monte Carlo simulation of the mortality experience of a group
of lives, printing out the names of the deaths?
2. How would you carry out an experiment to determine
whether the probability model inherent in the usual life-table
adequately represents the year-to-year fluctuations in the mortality
experience of a group of lives?
3. State the data you would require from your office's data
processing installation in order to relate your office's expenses to
the insurance sector of the National Economic Model.
4. It is required to smooth a set of crude mortality rates qx by
maximizing the expression
(where E = Ex = given exposed to risk at age x and 0 = 0 x =
given number of deaths at age x) subject to the constraints
(i)
(ii)
(iii)
Explain how you would amend one of the standard quadratic
programming methods (P. Wegner, J.S.S. 16, 468) to do this.
5. In the Preface to the a(55) tables certain adjustments to the
rates for future years were given. Discuss the results of the
investigation by the Students Society's Computer Group in 1963
when sequential analysis (Johnson & Moore, J.S.S, 14, 84) was
used to test the suitability of the adjustments. What was the result
of the similar investigation in 1966 on the a(65) table?
6. Given only the totals of sums assured by year of entry and
the totals by year of maturity for non-profit endowment assurances,
how would you use a standard 'Transportation' programme to
obtain absolute upper and lower bounds to the net liability?
7. If you found yourself in an under-developed country where
the Standard International Actuarial Autocode was not available
COMPUTERS AND ACTUARIAL SCIENCE
153
on the local computers, what special matrices would you store in
order to be able to use a typical matrix programming scheme for
those valuation calculations which still require the use of commutation functions?
8. Explain how you would use the net premium method of
valuation in order to:
(i) project the future income from your investments,
(ii) set your maximum retention on any one life,
(iii) estimate the return on next year's agency selling drive,
(iv) determine your maximum holding in equities,
(v) determine the rate of bonus to declare,
by carrying out the calculations on dozens of different bases before
breakfast on 1 January.
© Copyright 2026 Paperzz