CommencezCommencez gratuitement

Analyse sanguine pour la grippe porcine

Vous consultez le médecin pour un fort mal de tête. Le médecin vous sélectionne au hasard pour un test sanguin de dépistage de la grippe porcine, que l'on soupçonne d'affecter 1 personne sur 9 000 dans votre ville. La précision du test est de 99 %, ce qui signifie que la probabilité d'un faux positif est de 1 %. La probabilité d'un faux négatif est nulle.

Sachant que votre test est positif, répondez aux questions suivantes.

Cette activité fait partie du cours

Fondements de la probabilité en Python

Voir le cours

Exercice interactif pratique

Essayez cet exercice en complétant ce code d’exemple.

# Probability of having Swine_flu
P_Swine_flu = 1./9000
# Probability of not having Swine_flu
P_no_Swine_flu = 1 - ____
# Probability of being positive given that you have Swine_flu
P_Positive_g_Swine_flu = ____
# Probability of being positive given that you do not have Swine_flu
P_Positive_g_no_Swine_flu = ____

# Probability of Positive
P_Positive = (____ * ____) + (____ * ____)

# Bayes' rule for P(Swine_flu|Positive)
P_Swine_flu_g_Positive = (____ * ____) / P_Positive

print(P_Swine_flu_g_Positive)
Modifier et exécuter le code