partie5_ex86.py

Created by cahier-indice-algo-1gen

Created on April 22, 2022

477 Bytes


from random import *

def test_individu():
    if random() < 0.04:
        contamine = True
        if random() < 0.99:
            test = True
        else:
            test = False
    else:
        contamine = False
        if random() < 0.09:
            test = True
        else:
            test = False
    return test
    
def test_pop(n):
    positifs = 0
    for i in range(n):
        positifs = positifs + test_individu()
    return positifs / n