AI, Python, Heredity, Joint Probability, Bayesian Networks.
each person for person in probabilities: # Update gene probability if person in one_gene: probabilities[person]["gene"][1] += p elif person in two_genes: probabilities[person]["gene"][2] += p else: probabilities[person]["gene"][0] += p # Update trait probability if person in have_trait: