Exercise 3 solution import random rng = random.Random(11) CHROMS = 22 trials = 5000 first = None for n in range(3, 9): none = 0 for _ in range(trials): hits = sum(1 for _ in range(CHROMS) if all(rng.random() < 0.5 for _ in range(n))) if hits == 0: none += 1 share = none / trials print(n, round(share, 3), round((1 - 1 / 2**n) ** CHROMS, 3)) if first is None and share > 0.5: first = n print("first generation where more than half share nothing:", first) Output: 3 0.054 0.053 4 0.239 0.242 5 0.498 0.497 6 0.697 0.707 7 0.843 0.842 8 0.917 0.917 first generation where more than half share nothing: 6 Reading it: the middle column is the simulation and the last is the formula (1 - 1/2^n)^22, which agree closely. By generation 6 back, more than half of the people would share no whole chromosome with a particular ancestor in this simplified model, even though that ancestor is still genuinely one of their ancestors. Real DNA is cut and rejoined by crossing over (Genetics and Heredity Fundamentals 4), so real ancestors leave small segments rather than whole chromosomes, and the exact numbers differ (check).