# The family tree conundrum ... # you have two parents, your parents each have two parents, that makes it # four grandparents for you, then there must be eight great grandparents # and so on. A light hearted look at a serious problem. # tested with Python24 vegaseat 24jul2005 generations = 3 number_of_parents = 2 ** generations print "after 3 generation we have %d great grandparents" % number_of_parents print # going back 40 generations for generations in range(4, 41): number_of_parents = 2 ** generations print "In %d generation we have %d (g)parents" % (generations, number_of_parents) print print """Going back in your family tree for 40 generations, or around a thousand years, there should be over one trillion great-great-great-...-grandparents you could lay claim to being related with. Hmmm, that alone is more people then ever lived! We demand an explanation from our government!"""
Are you able to help answer this sponsored question?
Questions asked by members who have earned a lot of community kudos are featured in order to give back and encourage quality replies.