Fabulous Adventures In Coding
Eric Lippert is a principal developer on the C# compiler team. Learn more about Eric.
Happy New Year all, and welcome to 2010, or, as my friend Professor Orbifold prefers it, MMX. I hope your festive holiday season was as festive and enjoyable as mine.
The extended Lippert family continues to grow; this year at the annual Boxing Day party we needed two overflow tables for dinner instead of the usual one. The older cousins are now all married, some of them are bringing new babies, and some of the younger cousins are starting to bring boyfriends and girlfriends. I pointed out that the youngest person at the table was my brand-new “first cousin once removed”, which touched off a long discussion of how exactly one computes degree of cousin-hood and removed-ness. As a public service, here’s how it works.
Recursive explanation for computer programmers and mathematicians:
Base case: if X and Y are zeroth cousins no times removed then X and Y are siblings.
Recursive case 1: if n > 0 and X and Y are nth cousins no times removed then X.Parent and Y.Parent are (n-1)th cousins no times removed.
Recursive case 2: if m > 0 and X and Y are nth cousins m times removed then WOLOG assume that X is of a later generation than Y. In this case, X.Parent and Y are nth cousins (m-1) times removed.
Explanation for normal people:
Take two different people who have a common ancestor but who are not related by direct succession (that is, neither is the mother, father, grandmother, and so on, of the other):
Degree of cousin-hood is the minimum of the numbers of generations back that you have to go to find the nearest common ancestor, minus one.
Removed-ness is the absolute difference between the numbers of generations back you have to go to find the nearest common ancestor.
For example, consider this fragment of a family tree:
Mary / \ Laura Bob | | John Helen | | Xerxes Melinda
Take Helen and Xerxes for example. Their nearest common ancestor is Mary. Helen has to go back two generations to get to Mary. Xerxes has to go back three. The minimum of two and three, minus one, is one. The absolute difference of two and three is one. So Helen and Xerxes are first cousins, once removed. So are John and Melinda.
“Zeroth cousins” are not called cousins, but have special names for the relationship. “Zeroth cousins no times removed” are of course brothers and sisters. “Zeroth cousins once removed” are uncles, aunts, nieces and nephews. “Zeroth cousins twice removed” are great-uncles, great-aunts, great-nieces and great-nephews. (Or sometimes grand-uncles, and so on.)
Summing up this family tree:
Mary is Laura and Bob’s mother, John and Helen’s grandmother, and Xerxes and Melinda’s great-grandmother.
Laura is Mary’s daughter, Bob’s sister, John’s mother, Helen’s aunt, Xerxes’ grandmother, and Melinda’s great-aunt.
Bob is Mary’s son, Laura’s brother, John’s uncle, Helen’s father, Xerxes’ great-uncle, and Melinda’s grandfather.
John is Mary’s grandson, Laura’s son, Bob’s nephew, Helen’s first cousin (no times removed), Xerxes’ father, and Melinda’s first cousin once removed.
Helen is Mary’s granddaughter, Laura’s niece, Bob’s daughter, John’s first cousin (no times removed), Xerxes’ first cousin once removed, and Melinda’s mother.
Xerxes is Mary’s great-grandson, Laura’s grandson, Bob’s great-nephew, John’s son, Helen’s first cousin once removed, and Melinda’s second cousin (no times removed).
Melinda is Mary’s great-granddaughter, Laura’s great-niece, Bob’s granddaughter, John’s first cousin once removed, Helen’s daughter, and Xerxes’ second cousin (no times removed).
Of course, this is all perfectly straightforward. If, say, your mother dies and your father marries her sister and has more children, then working out who is whose cousin can get rather trickier. And heaven only knows what happens if you are your own grandfather.
Incidentally, it is illegal in the state of Washington for a man to marry his widow’s sister. Anyone care to guess why?
> Incidentally, it is illegal in the state of Washington for a man to marry his widow’s sister. Anyone care to guess why?
If your wife is a widow, it means you're dead... so you can't marry your wife's sister.
Happy new year Eric, and thanks for the headache ;)
"If, say, your mother dies and your father marries her sister and has more children, then working out who is whose cousin can get rather trickier." -- is this where "half" and "double" come into play? I have heard of half-brother and double-cousin. Is there such a thing as a "half-cousin"?
Good questions. Normal first cousins have a common grandmother and grandfather. Double first cousins happens when a pair of siblings procreate with another a pair of siblings. The children of each couple are then first cousins through both pairs of grandparents, making them double first cousins. Working out who is double second cousins is rather more complicated, but again, you have to come up with situations in which the second cousins are second cousins via two pairs of great-grandparents.
If a man has children by two (unrelated) women (or vice versa) then the children are half siblings.
If your half-sibling has children and you have children, then the children are half first cousins to each other. Again, normal first cousins have two grandparents in common; half first cousins only have one grandparent in common.
And finally, in my example above of a man having children with two women who are sisters, the children are three-quarter siblings!
I have oft found this confusing and that explanation helps a lot. However, I find it strange the Bob is "Laura’s sister" and "Helen's father".
Typo. Fixed. Thanks! -- Eric
Are there any precedence rules?
For instance my grandfather-in-law maried his brothers wife after his wife and his brother passed away.
So are they cousins or half siblings or some sort of cousin-half-brother combo?
The combinations hurt my head!
I've always understood the structure to be slightly different. The way I learned it, there is an asymmetry between the relationship between "removed" cousins like Helen and Xerxes which is encoded in the additional descriptors "upwards" and "downwards".
In my scheme (although it's not mine, of course) Helen is Xerxes' second cousin, once removed upwards, and Xerxes is Helen's first cousin, once removed downwards.
In other words, if your regular cousins have chidren, they're your first cousins, once removed downwards, but you're their second cousin, once removed upwards.
I used to go to school with my half step cousin once removed.
It's illegal for a man to marry his widow's sister because if it is his widow, it means he is the one that is dead.
Of course, by extension, you are your own (-1)st cousin, and your ancestors/descendents are your (-1)st cousins N-times removed.
Who wants to create the class diagram? Bonus points for incorporating step-cousins and method implementations for generating the family tree from an arbitrary node. Note that you can have no (-1)st step-cousin!
Extra bonus points if you provide a sample cousin relationship calculation circuit using only NAND gates.
ok folks I'm just kidding
My father's younger brother married my mother's younger sister. My mother always said that my cousin by that marriage was my double cousin (i.e. a cousin on both of my parent's lineages.) I don't know if that's the real definition or not.
That's correct. So you and your double cousins are actually much more closely related than regular first cousins. And had either your father and uncle, or your mother and aunt been identical twins, you and your double cousins would be even more closely related. -- Eric
Is it wrong that I understand the recursive definition better?
Wikipedia has great charts about this.
Marry your cousin and Gimme 6!
Now, normally, there is a _pair_ of nearest common ancestors (i.e. the mother and father of the next ancestors which are siblings). When there is not, we say 'half-sibling' etc. Or, rather, I _say_ "etc", but I don't know what you would actually say for the other cases.
I do not know exactly why it is illegal, however in India specially in the south our traditional marriages conform to certain rules. Each family gets 3 codes called as 'gothras' (say g1, g2, g3). In the above case Mary and her husband Jim, receives g1, g2, g3. g1 is received from Jims Father, g2 is from Mary's Father and g3 from Mary's maternal grand father. Similarly each family get their codes from their respective parents, as they form a new family a new set of code is created. In some families that very strict where marriage between cousins is not allowed at all. They make sure that the family codes g1 and g2 are different, some families are who are little lax as they are not direcly blood related and have same family codes because of common ancestary do allow but make sure that the first code g1 is different. In the above scenario John can marry Hellen however John's sister is not allowed to marry Hellen's brother. The rules look complex but when you understand the reason behind it you will be amazed that such rules created were not by accident or by some sentiment but has very rational basis. It is believed that the dominating physical characteristics in a boy are mostly inherited from father while the dominating characteristics for a girl are inherited from mother. In the above case John's mother and Hellen's father are brother and sister since they may have more common qualities in a stricter family the marriage between their children is not allowed. However in this case John would receive fewer characteristics from his mother while Hellen would receive few from her father, the chances that their offspring has a clash of common characteristics is reduced. This was the system that had been following for ages and many could not explain why they have to follow. My father explained possible rational behind the system.
While I find your blog entry accurate, I'm not a fan of the whole "removedness" system, because there is ambiguity to the system.
John and Melinda are both "first cousins once removed". i.e. John is Melinda's first cousin once removed, and Melinda is John's first cousin once removed. The problem arises when all generations don't have the same length of time between them (as is common with many first cousins once removed, and further apart relationships). If John and Melinda are about the same age, wouldn't it be nice to determine who is from the younger and older generation?
So, I like the system where if X and Y are Nth cousins, then
X.Parent(male) is the Nth uncle of Y
X.Parent(female) is the Nth aunt of Y
Y [male] is the Nth nephew of X.Parent
Y [female] is the Nth nephew of X.Parent
This system also describes gender, which can be confusing with some names.
So, in the example above, John would be Melinda's second uncle, and Melinda would be John's second niece.