I have a problem that states:
There is 1 parent(grandparent) that has two kids. Each of the 2 kids has 2 kids. What is the probability that if the grandparent gets High Blood Pressure that their children will get it and that if the children get it (one or both children) than what is the prob that the grandchildren will also get it.
I know that there is a 50% chance that the grandparent gets High blood pressure.
p = 0.50
def generate():
return random.random() >= p
sum(generate() for i in range(1000))
Aucun commentaire:
Enregistrer un commentaire