PDA

View Full Version : Best Programming Question I have ever seen

Random_Dude
June 1st, 2011, 10:34 PM
http://stackoverflow.com/questions/6163683/cycles-in-family-tree-software

Cheers :cool:

Throne777
June 1st, 2011, 10:44 PM
http://stackoverflow.com/questions/6163683/cycles-in-family-tree-software

Cheers :cool:

Someone's got to be pulling someone else's leg somewhere. I find it very hard to believe someone would openly admit to fathering children with his own daughter to a company.

On a related note, that family tree must be more like a stump.

earthpigg
June 1st, 2011, 11:35 PM
Someone's got to be pulling someone else's leg somewhere. I find it very hard to believe someone would openly admit to fathering children with his own daughter to a company.

Unless he's already been convicted and done his time.

jerenept
June 2nd, 2011, 01:20 AM
if (father=son) or (mother=daughter) then
writeln('WTF?') else
writeln('Valid family tree');

Output: WTF? <--- my opinion.

sisco311
June 2nd, 2011, 01:34 AM
if user="Woody Allen"
then
error
else
fi

:evil:

NovaAesa
June 2nd, 2011, 02:48 AM
You can always end up with cycles in a family tree without marriages from people within the same bloodline. E.g. Alice and Bob who are brother and sister can marry Charlie and Donna who are also brother and sister.

forrestcupp
June 2nd, 2011, 02:57 AM
That's just amazing. It kind of reminds me of the old song I'm My Own Grandpa.

3Miro
June 2nd, 2011, 03:03 AM
You can always end up with cycles in a family tree without marriages from people within the same bloodline. E.g. Alice and Bob who are brother and sister can marry Charlie and Donna who are also brother and sister.

That is not a cycle, it is still a valid three.

The problem in the case of incest is that Father -> Daughter -> Grand Daughter and Father -> Grand Daughter both lead from Father to Grand Daughter, which by definition is not three.

AB Parents -> A + C -> A + C children
AB Parents -> B + D -> B + D children
CD Parents -> A + C -> A + C children
CD Parents -> B + D -> B + D children

All links are unique. This is not a three in the strictest of definitions, but there is still only way to go from a node to a node if you only traverse "up-to-down".

mmsmc
June 2nd, 2011, 04:06 AM
if (father=son) or (mother=daughter) then
writeln('WTF?') else
writeln('Valid family tree');

Output: WTF? <--- my opinion.

well, there you go, need we say any more?

Bandit
June 2nd, 2011, 04:15 AM
How can I resolve those errors without removing all data assertions?

Answer: Quit selling to West Virginia!

Bandit
June 2nd, 2011, 04:18 AM
Unless he's already been convicted and done his time.

Its not illegal if she is of age. But its still damn wrong!:lolflag:

mkendall
June 2nd, 2011, 06:10 AM
Its not illegal if she is of age.

Actually, yes it is. Ask David Epstein.

Random_Dude
June 2nd, 2011, 09:02 AM
That's just amazing. It kind of reminds me of the old song I'm My Own Grandpa.