# Four BASIC programs for life contingencies

Home Forums General Actuarial Four BASIC programs for life contingencies

Viewing 1 post (of 1 total)
• Author
Posts
• #6964

BASIC Programs For Four Of The Standard Algorithmic Calculations Currently Included In The Actuarial Life Contingencies Syllabus

In each case, make the first line of the program:

10 DEF FNS(U)=whatever the survival function, S(U), is.

For example, for a Makeham with A equal to 0.00022, B equal to 2.7*10^(-6) and c equal to 1.124, make the first line of the program:

10 DEF FNS(U)=EXP(-0.00022*U-2.7*10^(-6)*(1.124^U-1)/LN(1.124))

And then;

If you want the program to calculate an n-year temporary curtate life expectancy for (x) when executed then add on the following:

20 INPUT x,n

40 FOR r=1 TO n

60 NEXT r

90 END

Or if you want the program to calculate the actuarial present value of an n-year temporary immediate life annuity, with a discount factor of v, of 1 per year payable m times per year for (x) (m may be equal to 1) when executed then add on the following:

20 INPUT x,n,m,v

40 FOR r=1 TO m*n

60 NEXT r

90 END

Or if you want the program to calculate the actuarial present value of an n-year temporary life annuity due, with a discount factor of v, of 1 per year payable m times per year for (x) (m may be equal to 1) when executed then add on the following:

20 INPUT x,n,m,v

40 FOR r=0 TO m*n-1

60 NEXT r

90 END

Or if you want the program to calculate the actuarial present value of a death benefit, with a discount factor of v, of 1 payable at the end of the 1/m year of death for (x) (m may be equal to 1), provided this occurs within n years, when executed then add on the following:

20 INPUT x,n,m,v

40 FOR r=0 TO m*n-1

60 NEXT r