Vediamo come applicare il metodo Venn–tabella a situazioni concrete. In tutti gli esempi procediamo così: si fissano gli eventi, si traducono i dati in vincoli sulle quantità x,y,z,tx, y, z, t, si risolve il sistema e si risponde alla domanda. Gli esempi mostrano anche errori classici da evitare, come confondere P(AB)P(A\mid B) con P(BA)P(B\mid A).

Let us see how to apply the Venn–table method to concrete situations. In all the examples we proceed as follows: we fix the events, translate the data into constraints on the quantities x,y,z,tx, y, z, t, solve the system and answer the question. The examples also show classic mistakes to avoid, such as confusing P(AB)P(A\mid B) with P(BA)P(B\mid A).

Esempio — Vaccino antinfluenzale

Giorgio deve decidere se vaccinarsi contro l’influenza. Sappiamo che il vaccino ha copertura parziale. Definiamo:

  • AA = “Giorgio si vaccina”;
  • BB = “Giorgio prende l’influenza”.

Dai dati statistici: P(A)=15P(A) = \tfrac{1}{5}, P(B)=13P(B) = \tfrac{1}{3}, e tra i vaccinati la percentuale di ammalati è P(BA)=16P(B\mid A) = \tfrac{1}{6}.

Il vaccino protegge? Se AA e BB fossero indipendenti, vaccinarsi non farebbe alcuna differenza. Confrontiamo P(BA)P(B\mid A) con P(B)P(B):

P(BA)=160,167<P(B)=130,333.P(B\mid A) = \tfrac{1}{6} \approx 0,167 \quad < \quad P(B) = \tfrac{1}{3} \approx 0,333.

Vaccinarsi dimezza la probabilità di ammalarsi: gli eventi AA e BB sono correlati negativamente. Per la legge della probabilità composta:

P(AB)=P(A)P(BA)=1516=130.P(A\cap B) = P(A)\cdot P(B\mid A) = \tfrac{1}{5}\cdot\tfrac{1}{6} = \tfrac{1}{30}.

Quindi la correlazione vale:

corr(A,B)=1/30(1/5)(1/3)1=1/301/151=121=12.\operatorname{corr}(A,B) = \frac{1/30}{(1/5)(1/3)} - 1 = \frac{1/30}{1/15} - 1 = \tfrac{1}{2}-1 = \boxed{-\tfrac{1}{2}}.

La correlazione negativa conferma l’effetto protettivo del vaccino.

Riempiamo la tabella. Con P(AB)=130P(A\cap B) = \tfrac{1}{30} deduciamo tutte le celle:

AA (vaccinato)A\overline{A} (non vacc.)Totale
BB (influenza)130\tfrac{1}{30}930\tfrac{9}{30}1030=13\tfrac{10}{30}=\tfrac{1}{3}
B\overline{B} (sano)530\tfrac{5}{30}1530\tfrac{15}{30}2030=23\tfrac{20}{30}=\tfrac{2}{3}
Totale630=15\tfrac{6}{30}=\tfrac{1}{5}2430=45\tfrac{24}{30}=\tfrac{4}{5}11

Da qui possiamo rispondere ad altre domande, per esempio: tra chi non si vaccina, qual è la probabilità di ammalarsi?

P(BA)=P(AB)P(A)=9/3024/30=38=37,5%.P(B\mid \overline{A}) = \frac{P(\overline{A}\cap B)}{P(\overline{A})} = \frac{9/30}{24/30} = \boxed{\tfrac{3}{8} = 37,5\%}.

Collegamenti

Argomenti: Probabilita
Concetti: Correlazione · Probabilita condizionata · Tabella di contingenza
Metodi: Prob condizionata · Tabella contingenza
Competenze: Calcolo probabilita · Modellizzare

Example — Influenza vaccine

Giorgio has to decide whether to get vaccinated against influenza. We know that the vaccine has partial coverage. Let us define:

  • AA = “Giorgio gets vaccinated”;
  • BB = “Giorgio catches influenza”.

From the statistical data: P(A)=15P(A) = \tfrac{1}{5}, P(B)=13P(B) = \tfrac{1}{3}, and among the vaccinated the proportion of those who fall ill is P(BA)=16P(B\mid A) = \tfrac{1}{6}.

Does the vaccine protect? If AA and BB were independent, getting vaccinated would make no difference. Let us compare P(BA)P(B\mid A) with P(B)P(B):

P(BA)=160,167<P(B)=130,333.P(B\mid A) = \tfrac{1}{6} \approx 0,167 \quad < \quad P(B) = \tfrac{1}{3} \approx 0,333.

Getting vaccinated halves the probability of falling ill: the events AA and BB are negatively correlated. By the law of compound probability:

P(AB)=P(A)P(BA)=1516=130.P(A\cap B) = P(A)\cdot P(B\mid A) = \tfrac{1}{5}\cdot\tfrac{1}{6} = \tfrac{1}{30}.

So the correlation is:

corr(A,B)=1/30(1/5)(1/3)1=1/301/151=121=12.\operatorname{corr}(A,B) = \frac{1/30}{(1/5)(1/3)} - 1 = \frac{1/30}{1/15} - 1 = \tfrac{1}{2}-1 = \boxed{-\tfrac{1}{2}}.

The negative correlation confirms the protective effect of the vaccine.

Let us fill in the table. With P(AB)=130P(A\cap B) = \tfrac{1}{30} we deduce all the cells:

AA (vaccinated)A\overline{A} (not vacc.)Total
BB (influenza)130\tfrac{1}{30}930\tfrac{9}{30}1030=13\tfrac{10}{30}=\tfrac{1}{3}
B\overline{B} (healthy)530\tfrac{5}{30}1530\tfrac{15}{30}2030=23\tfrac{20}{30}=\tfrac{2}{3}
Total630=15\tfrac{6}{30}=\tfrac{1}{5}2430=45\tfrac{24}{30}=\tfrac{4}{5}11

From here we can answer other questions, for example: among those who do not get vaccinated, what is the probability of falling ill?

P(BA)=P(AB)P(A)=9/3024/30=38=37,5%.P(B\mid \overline{A}) = \frac{P(\overline{A}\cap B)}{P(\overline{A})} = \frac{9/30}{24/30} = \boxed{\tfrac{3}{8} = 37,5\%}.

Topics: Probability
Concepts: Correlation · Conditional probability · Contingency table
Methods: Conditional probability · Contingency table
Skills: Probability calculation · Modelling

Esempio — Letalità di un virus

Durante un’epidemia, un virus AA colpisce circa lo 0,1%0{,}1\% della popolazione: P(A)=0,001P(A) = 0,001. La letalità riportata (probabilità di morire una volta contratto il virus) è P(BA)=0,03P(B\mid A) = 0,03, dove BB = “il soggetto muore”.

Domanda: qual è la probabilità complessiva di morire a causa del virus? Per la legge della probabilità composta:

P(AB)=P(A)P(BA)=0,0010,03=0,00003.P(A\cap B) = P(A)\cdot P(B\mid A) = 0,001\cdot 0,03 = \boxed{0,00003}.

Tre persone su centomila: un numero che, moltiplicato per milioni di abitanti, dà comunque un impatto notevole.

Domanda inversa: tra i deceduti nel periodo, sapendo che in totale P(B)=0,00037P(B) = 0,00037, qual è la frazione imputabile al virus?

P(AB)=P(AB)P(B)=0,000030,000370,0818%.P(A\mid B) = \frac{P(A\cap B)}{P(B)} = \frac{0,00003}{0,00037} \approx \boxed{0,081 \approx 8\%}.

Quindi circa l’8%8\% dei decessi complessivi è attribuibile al virus.

Attenzione

P(AB)P(A\mid B) e P(BA)P(B\mid A) sono quantità molto diverse: confonderle è un errore classico. Qui la letalità P(BA)=3%P(B\mid A)=3\% e la frazione di decessi imputabili al virus P(AB)8%P(A\mid B)\approx 8\% rispondono a due domande completamente distinte.

Collegamenti

Argomenti: Probabilita
Concetti: Formula del prodotto · Probabilita condizionata · Teorema di bayes
Metodi: Bayes · Prob condizionata
Competenze: Calcolo probabilita

Example — Lethality of a virus

During an epidemic, a virus AA strikes about 0,1%0{,}1\% of the population: P(A)=0,001P(A) = 0,001. The reported lethality (the probability of dying once the virus has been contracted) is P(BA)=0,03P(B\mid A) = 0,03, where BB = “the subject dies”.

Question: what is the overall probability of dying because of the virus? By the law of compound probability:

P(AB)=P(A)P(BA)=0,0010,03=0,00003.P(A\cap B) = P(A)\cdot P(B\mid A) = 0,001\cdot 0,03 = \boxed{0,00003}.

Three people in a hundred thousand: a figure that, multiplied by millions of inhabitants, nonetheless has a considerable impact.

Reverse question: among those who died in the period, knowing that in total P(B)=0,00037P(B) = 0,00037, what fraction is attributable to the virus?

P(AB)=P(AB)P(B)=0,000030,000370,0818%.P(A\mid B) = \frac{P(A\cap B)}{P(B)} = \frac{0,00003}{0,00037} \approx \boxed{0,081 \approx 8\%}.

So about 8%8\% of the overall deaths is attributable to the virus.

Caution

P(AB)P(A\mid B) and P(BA)P(B\mid A) are very different quantities: confusing them is a classic mistake. Here the lethality P(BA)=3%P(B\mid A)=3\% and the fraction of deaths attributable to the virus P(AB)8%P(A\mid B)\approx 8\% answer two completely distinct questions.

Topics: Probability
Concepts: Product formula · Conditional probability · Bayes’ theorem
Methods: Bayes · Conditional probability
Skills: Probability calculation

Esempio — Rapina e forze dell'ordine

Sia AA = “il soggetto viene preso dalla polizia” e BB = “il soggetto fa la rapina”. I dati: P(AB)=0,6,P(AB)=0,1,P(A)=0,3.P(A\mid B) = 0,6, \quad P(A\mid \overline{B}) = 0,1, \quad P(A) = 0,3. Domanda: qual è P(B)P(B)?

Impostiamo il diagramma di Venn con quattro incognite x,y,z,tx, y, z, t, dove x=P(AB)x=P(A\cap\overline{B}), y=P(AB)y=P(A\cap B), z=P(BA)z=P(B\cap\overline{A}), t=P(AB)t=P(\overline{A}\cap\overline{B}). Traduciamo i dati in un sistema:

x + y + z + t = 1 \\[3pt] P(A) = x + y = 0,3 \\[3pt] P(A\mid B) = \dfrac{y}{y+z} = 0,6 \\[3pt] P(A\mid \overline{B}) = \dfrac{x}{x+t} = 0,1 \end{cases}$$ Dalla terza equazione: $y = 0,6\,(y+z) \implies 0,4\,y = 0,6\,z \implies y = 1,5\,z$. Dalla quarta: $x = 0,1\,(x+t) \implies 0,9\,x = 0,1\,t \implies t = 9\,x$. Dalla seconda: $x = 0,3 - y = 0,3 - 1,5\,z$. Sostituendo nella prima: $$(0,3-1,5\,z) + 1,5\,z + z + 9\,(0,3-1,5\,z) = 1,$$ cioè $0,3 + z + 2,7 - 13,5\,z = 1$, da cui $3 - 12,5\,z = 1 \implies z = 0,16$. Dunque: $y = 1,5\cdot 0,16 = 0,24$, &nbsp; $x = 0,3 - 0,24 = 0,06$, &nbsp; $t = 9\cdot 0,06 = 0,54$. $$P(B) = y + z = 0,24 + 0,16 = \boxed{0,4 = 40\%}.$$ **Verifica:** $x+y+z+t = 0,06+0,24+0,16+0,54 = 1$ ✓. ## Collegamenti **Argomenti:** [[Knowledge Graph/Topics/Probabilita|Probabilita]] **Concetti:** [[Knowledge Graph/Concepts/Diagramma di venn|Diagramma di venn]] · [[Knowledge Graph/Concepts/Probabilita condizionata|Probabilita condizionata]] · [[Knowledge Graph/Concepts/Sistema di vincoli|Sistema di vincoli]] **Metodi:** [[Knowledge Graph/Methods/Diagramma venn prob|Diagramma venn prob]] · [[Knowledge Graph/Methods/Prob condizionata|Prob condizionata]] **Competenze:** [[Knowledge Graph/Skills/Calcolo probabilita|Calcolo probabilita]] · [[Knowledge Graph/Skills/Risolvere sistemi|Risolvere sistemi]] </div> <span class="fl-lang" data-lang="en"></span> <div class="fl-sec"> > [!example] Example — Robbery and law enforcement > > Let $A$ = "the subject is caught by the police" and $B$ = "the subject commits the robbery". The data: > $$P(A\mid B) = 0,6, \quad P(A\mid \overline{B}) = 0,1, \quad P(A) = 0,3.$$ > **Question:** what is $P(B)$? We set up the Venn diagram with four unknowns $x, y, z, t$, where $x=P(A\cap\overline{B})$, $y=P(A\cap B)$, $z=P(B\cap\overline{A})$, $t=P(\overline{A}\cap\overline{B})$. We translate the data into a system: $$\begin{cases} x + y + z + t = 1 \\[3pt] P(A) = x + y = 0,3 \\[3pt] P(A\mid B) = \dfrac{y}{y+z} = 0,6 \\[3pt] P(A\mid \overline{B}) = \dfrac{x}{x+t} = 0,1 \end{cases}$$ From the third equation: $y = 0,6\,(y+z) \implies 0,4\,y = 0,6\,z \implies y = 1,5\,z$. From the fourth: $x = 0,1\,(x+t) \implies 0,9\,x = 0,1\,t \implies t = 9\,x$. From the second: $x = 0,3 - y = 0,3 - 1,5\,z$. Substituting into the first: $$(0,3-1,5\,z) + 1,5\,z + z + 9\,(0,3-1,5\,z) = 1,$$ that is $0,3 + z + 2,7 - 13,5\,z = 1$, whence $3 - 12,5\,z = 1 \implies z = 0,16$. Therefore: $y = 1,5\cdot 0,16 = 0,24$, &nbsp; $x = 0,3 - 0,24 = 0,06$, &nbsp; $t = 9\cdot 0,06 = 0,54$. $$P(B) = y + z = 0,24 + 0,16 = \boxed{0,4 = 40\%}.$$ **Check:** $x+y+z+t = 0,06+0,24+0,16+0,54 = 1$ ✓. ## Links **Topics:** [[Knowledge Graph/Topics/Probabilita|Probability]] **Concepts:** [[Knowledge Graph/Concepts/Diagramma di venn|Venn diagram]] · [[Knowledge Graph/Concepts/Probabilita condizionata|Conditional probability]] · [[Knowledge Graph/Concepts/Sistema di vincoli|System of constraints]] **Methods:** [[Knowledge Graph/Methods/Diagramma venn prob|Venn diagram probability]] · [[Knowledge Graph/Methods/Prob condizionata|Conditional probability]] **Skills:** [[Knowledge Graph/Skills/Calcolo probabilita|Probability calculation]] · [[Knowledge Graph/Skills/Risolvere sistemi|Solving systems]] </div> <span class="atom-split" id="4-esempio--esame-di-guida" data-atom="4-esempio--esame-di-guida" data-title-it="Esempio — Esame di guida" data-title-en="Example — Driving test" data-tags="matematica,classe/quarta,topic/probabilita,concept/probabilita-totale,concept/probabilita-condizionata,concept/formula-del-prodotto,method/prob-totale,method/prob-condizionata,skill/calcolo-probabilita,skill/risolvere-equazioni"></span> <span class="fl-lang" data-lang="it"></span> <div class="fl-sec"> > [!example] Esempio — Esame di guida > > La probabilità di passare l'esame di guida è del $30\%$ per chi ha fatto almeno $10$ guide, e del $10\%$ per chi ne ha fatte meno di $10$. Tra quelli che hanno passato il test, coloro che hanno fatto almeno $10$ guide sono il $50\%$. **Qual è la percentuale di persone che fa poche guide?** Definiamo $A$ = "passare l'esame", $B$ = "aver fatto almeno $10$ guide". Dati: $$P(A\mid B) = 0,3, \quad P(A\mid \overline{B}) = 0,1, \quad P(B\mid A) = 0,5.$$ Richiesta: $P(\overline{B}) = 1-P(B)$. Dalla legge della probabilità composta, $P(A\cap B)$ si può scrivere in due modi: $$P(A\cap B) = P(B)\cdot P(A\mid B) = 0,3\,P(B),$$ $$P(A\cap B) = P(A)\cdot P(B\mid A) = 0,5\,P(A).$$ Uguagliando: $0,3\,P(B) = 0,5\,P(A)$, cioè $P(A) = 0,6\,P(B)$. D'altra parte, usando la decomposizione di $P(A)$ sui due casi (guide $\ge 10$ e guide $<10$): $$P(A) = P(A\cap B) + P(A\cap\overline{B}) = 0,3\,P(B) + 0,1\,(1-P(B)) = 0,2\,P(B) + 0,1.$$ Combinando con $P(A) = 0,6\,P(B)$: $$0,6\,P(B) = 0,2\,P(B) + 0,1 \implies 0,4\,P(B) = 0,1 \implies P(B) = \boxed{0,25}.$$ Dunque il $25\%$ delle persone fa almeno $10$ guide, e il $\boxed{75\%}$ ne fa meno di $10$. **Controllo via tabella:** $P(A) = 0,6\cdot 0,25 = 0,15$ (cioè il $15\%$ passa l'esame, un valore intermedio tra $30\%$ e $10\%$, ragionevole). La tabella di contingenza si riempie come: | | $A$ (passato) | $\overline{A}$ (bocciato) | Totale | | --- | --- | --- | --- | | $B$ ($\ge 10$ guide) | $0,075$ | $0,175$ | $0,25$ | | $\overline{B}$ ($<10$ guide) | $0,075$ | $0,675$ | $0,75$ | | Totale | $0,15$ | $0,85$ | $1$ | Tutti i vincoli sono soddisfatti ✓. ## Collegamenti **Argomenti:** [[Knowledge Graph/Topics/Probabilita|Probabilita]] **Concetti:** [[Knowledge Graph/Concepts/Formula del prodotto|Formula del prodotto]] · [[Knowledge Graph/Concepts/Probabilita condizionata|Probabilita condizionata]] · [[Knowledge Graph/Concepts/Probabilita totale|Probabilita totale]] **Metodi:** [[Knowledge Graph/Methods/Prob condizionata|Prob condizionata]] · [[Knowledge Graph/Methods/Prob totale|Prob totale]] **Competenze:** [[Knowledge Graph/Skills/Calcolo probabilita|Calcolo probabilita]] · [[Knowledge Graph/Skills/Risolvere equazioni|Risolvere equazioni]] </div> <span class="fl-lang" data-lang="en"></span> <div class="fl-sec"> > [!example] Example — Driving test > > The probability of passing the driving test is $30\%$ for those who have taken at least $10$ lessons, and $10\%$ for those who have taken fewer than $10$. Among those who passed the test, those who took at least $10$ lessons are $50\%$. **What is the percentage of people who take few lessons?** Let us define $A$ = "passing the test", $B$ = "having taken at least $10$ lessons". Data: $$P(A\mid B) = 0,3, \quad P(A\mid \overline{B}) = 0,1, \quad P(B\mid A) = 0,5.$$ Requested: $P(\overline{B}) = 1-P(B)$. By the law of compound probability, $P(A\cap B)$ can be written in two ways: $$P(A\cap B) = P(B)\cdot P(A\mid B) = 0,3\,P(B),$$ $$P(A\cap B) = P(A)\cdot P(B\mid A) = 0,5\,P(A).$$ Equating: $0,3\,P(B) = 0,5\,P(A)$, that is $P(A) = 0,6\,P(B)$. On the other hand, using the decomposition of $P(A)$ over the two cases (lessons $\ge 10$ and lessons $<10$): $$P(A) = P(A\cap B) + P(A\cap\overline{B}) = 0,3\,P(B) + 0,1\,(1-P(B)) = 0,2\,P(B) + 0,1.$$ Combining with $P(A) = 0,6\,P(B)$: $$0,6\,P(B) = 0,2\,P(B) + 0,1 \implies 0,4\,P(B) = 0,1 \implies P(B) = \boxed{0,25}.$$ So $25\%$ of the people take at least $10$ lessons, and $\boxed{75\%}$ take fewer than $10$. **Check via table:** $P(A) = 0,6\cdot 0,25 = 0,15$ (that is, $15\%$ pass the test, a value intermediate between $30\%$ and $10\%$, reasonable). The contingency table is filled in as: | | $A$ (passed) | $\overline{A}$ (failed) | Total | | --- | --- | --- | --- | | $B$ ($\ge 10$ lessons) | $0,075$ | $0,175$ | $0,25$ | | $\overline{B}$ ($<10$ lessons) | $0,075$ | $0,675$ | $0,75$ | | Total | $0,15$ | $0,85$ | $1$ | All the constraints are satisfied ✓. ## Links **Topics:** [[Knowledge Graph/Topics/Probabilita|Probability]] **Concepts:** [[Knowledge Graph/Concepts/Formula del prodotto|Product formula]] · [[Knowledge Graph/Concepts/Probabilita condizionata|Conditional probability]] · [[Knowledge Graph/Concepts/Probabilita totale|Total probability]] **Methods:** [[Knowledge Graph/Methods/Prob condizionata|Conditional probability]] · [[Knowledge Graph/Methods/Prob totale|Total probability]] **Skills:** [[Knowledge Graph/Skills/Calcolo probabilita|Probability calculation]] · [[Knowledge Graph/Skills/Risolvere equazioni|Solving equations]] </div>