I'm trying to use Mathematica to explore basic "generic" genealogical
concepts, such as "what is a 3rd cousin twice removed?".
I'm not happy with what I've done so far. I've defined three basic
functions, where x is a given person:
S[x] = the spouse of x, a set of 0 or 1 person
P[x] = the parents of x, a set of two people
C[x] = the children of x, a set of 0 or more people
I[x] = x, an identity function
I believe all genealogical relations can be expressed as a combination
of the above.
For simplicity, I'm assuming (for now) no multiple marriages or other
complications (and C is almost P^-1, but not quite).
I shorthand P[S[x]] (x's parents-in-law) as PSx below.
Some obvious "cancellations" between S, P, C, and I:
SSx = Ix [my spouse's spouse is me]
PCx = {Ix,Sx} [parents of my children are me and my spouse]
CSx = Cx [my spouse's children are my children]
SPx = Px [my parents' spouses are my parents]
There are probably a lot more of these.
In this notation, a 3rd cousin is "CCCPPPx" and a 3rd cousin twice
removed is "CCCCCPPPx" which we can shorthand as "C5P3x".
Interestingly, sibling-in-law is either CPS (my spouse's sibling) or
SCP (my sibling's spouse). In this case, the ambiguity is in the
English language.
Is there a better approach? An existing approach? My main
unhappinesses w/ my method:
1. No concept of gender, so you end up saying "spouse, sibling,
parent, etc". Not a big deal for "cousin", but "niece/nephew" becomes
"0th cousin once removed", and there's no way(?) to say "aunt/uncle"?
2. I can't seem to decide if my function arguments are sets or singletons.
3. There seems to be rich mathematical structure here:
a. my set of functions is any string consisting of the letters S, P,
and C (after the cancellations above) and the letter I (identity element)
b. my set doesn't quite form a group, semi-group, ring, field, etc.
c. Functional composition is always associative, but not commutative
in this case
d. 'S' is a self-inverse, but 'P' and 'C' aren't quite inverses
4. Cancellation makes definitions difficult. CP defines my siblings,
but it also defines me. {CPS, SCP} defines my siblings-in-law, but
since CP can be the identity, it also defines {IS, SI}, my
spouse. Having to define sibling as "CP-I" gets ugly fast.
5. It doesn't distinguish between 1st child, 2nd child, etc
6. Allowing for multiple marriages (a future step) diminishes the
mathematical identities (eg, SSx could now be my spouse's ex-spouse).
Thoughts?
--
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.