Home › Forums › Actuarial Resources & Blogs › 4 types of calculations involving ahnentafel position numbers, by computer
- This topic has 0 replies, 1 voice, and was last updated 4 months, 1 week ago by Richard Purvey.
-
AuthorPosts
-
June 26, 2024 at 12:17 pm #25214
Four types of calculation involving ahnentafel position numbers and how to do them by computer
First type
How to calculate the number of generations ahnentafel position number X is back from ahnentafel position number 1, using a spreadsheet
For example, the number of generations ahnentafel position number 9 is back from ahnentafel position number 1 is 3 generations.
Put the appropriate headings into cells A1 and B1 and then put ahnentafel position number X into cell A2, and into cell B2, put the formula =INT(LN(A2)/LN(2))
Second type
The computer program below will calculate the number of generations ahnentafel position number X is back from ahnentafel position number 1 AND state the parental sequence for ahnentafel position number X in terms of ahnentafel position number 1
For example, the number of generations ahnentafel position number 9 is back from ahnentafel position number 1 is 3 generations and the parental sequence for ahnentafel position number 9 in terms of ahnentafel position number 1 is father’s father’s mother (the program will state this as FATH FATH MOTH).
10 INPUT X
20 A=INT(LN(X)/LN(2))
30 PRINT A
40 IF X=1 THEN END
50 B=0
60 DIM NUM$(A)
70 IF X=1 THEN GOTO 120
80 B=B+1
90 IF X/2=INT(X/2) THEN NUM$(A+1-B)=”FATH” ELSE NUM$(A+1-B)=”MOTH”
100 X=INT(X/2)
110 GOTO 70
120 FOR X=1 TO A
130 PRINT NUM$(X)
140 NEXT X
Third type
The computer program below will calculate and display the descendant ahnentafel position numbers for ahnentafel position number X
For example, the descendant ahnentafel position numbers for ahnentafel position number 9 are 4, 2 and 1.
10 INPUT X
20 IF X=1 THEN END
30 X=INT(X/2)
40 PRINT X
50 GOTO 20
Fourth type
The computer program below will calculate and display the ancestral ahnentafel position numbers for ahnentafel position number X, doing this for each generation back from ahnentafel position number X, as far back as G generations back from ahnentafel position number X
For example, the ancestral ahnentafel position numbers for ahnentafel position number 9, for each generation back from ahnentafel position number 9, as far back as 2 generations back from ahnentafel position number 9 are 18 and 19 followed by 36, 37, 38 and 39.
10 INPUT X, G
20 IF G=0 THEN END
30 FOR Y=1 TO G
40 FOR Z=0 TO 2^Y-1
50 PRINT 2^Y*X+Z
60 NEXT Z
70 PRINT “ “
80 NEXT Y
Richard Purvey June 2024
-
AuthorPosts
- You must be logged in to reply to this topic.