Salta al contenuto
Note per Studenti Conditional Probability Report

Conditional Probability

In questa pagina 5

Motivation

When modelling an experiment with uncertain results we often accumulate information during the process. When new information is available it is reasonable to re-evaluate the probabilities previously assigned: conditional probability is the tool to incorporate new information and update the probability measure. Typically the new information is the occurrence of an event connected to the event whose probability we want to re-evaluate.

Example. In an experiment on a new drug, let E=E= "the patient recovers" with original probability P(E)P(E). If now the event F=F= "the patient gets the drug" occurs we want to re-evaluate P(E)P(E). We call P(E∣F)P(E\mid F) the probability of EE knowing that FF has occurred.

An example that motivates the definition

An urn contains 80 black balls and 20 red balls. Draw 2 balls without replacement; d1d_1 and d2d_2 denote the first and second ball drawn. The model has Ω={\Omega=\{all dispositions of 2 balls drawn without replacement}\} and PP the equiprobable measure on Ω\Omega (see Empirical and Equiprobable MeasuresProbability theory does not say how to choose P; two common choices are the empirical measure built from repeated trials and, on a finite sample space, the equiprobable measure P(E) = favourable cases over all cases.Empirical and Equiprobable Measures →, Sampling and Allocation ProblemsCounting problems are modelled either as drawing balls from an urn (sampling) or as placing tokens into cells (allocation), leading to dispositions with and without repetition, permutations and combinations without repetition.Sampling and Allocation Problems →). Then P([d1=red]∩[d2=red])=20⋅19100⋅99P([d_1=\text{red}]\cap[d_2=\text{red}])=\frac{20\cdot19}{100\cdot99} (dispositions without replacement of two red balls over all dispositions without replacement). Since [d1=red]=([d1=red]∩[d2=red])∪([d1=red]∩[d2=black])[d_1=\text{red}]=([d_1=\text{red}]\cap[d_2=\text{red}])\cup([d_1=\text{red}]\cap[d_2=\text{black}]) we compute P([d1=red])=20⋅19100⋅99+20⋅80100⋅99=20100,P([d_1=\text{red}])=\frac{20\cdot19}{100\cdot99}+\frac{20\cdot80}{100\cdot99}=\frac{20}{100}, which coincides with the "intuitive" answer. (The page writes the intuitive answer as 80/10080/100, which is a slip: it must be 20/10020/100, the fraction of red balls.)

By the same token [d2=red]=([d1=red]∩[d2=red])∪([d1=black]∩[d2=red])[d_2=\text{red}]=([d_1=\text{red}]\cap[d_2=\text{red}])\cup([d_1=\text{black}]\cap[d_2=\text{red}]), which gives P([d2=red])=20⋅19100⋅99+80⋅20100⋅99=20100.P([d_2=\text{red}])=\frac{20\cdot19}{100\cdot99}+\frac{80\cdot20}{100\cdot99}=\frac{20}{100}. This looks slightly "surprising" and does not correspond to an immediately intuitive computation, since it is not clear how to take into account the result of the first draw. If instead the outcome of the first draw is known, it becomes intuitive again: P([d2=red] knowing that [d1=red] occurred)=1999,P([d2=red] knowing [d1=black])=2099.P([d_2=\text{red}]\text{ knowing that }[d_1=\text{red}]\text{ occurred})=\frac{19}{99},\qquad P([d_2=\text{red}]\text{ knowing }[d_1=\text{black}])=\frac{20}{99}. Written briefly P([d2=red]∣[d1=red])P([d_2=\text{red}]\mid[d_1=\text{red}]) and P([d2=red]∣[d1=black])P([d_2=\text{red}]\mid[d_1=\text{black}]). Notice that P([d2=red]∣[d1=red])=1999=P([d1=red]∩[d2=red])P([d1=red])=20⋅19100⋅9920100,P([d_2=\text{red}]\mid[d_1=\text{red}])=\frac{19}{99}=\frac{P([d_1=\text{red}]\cap[d_2=\text{red}])}{P([d_1=\text{red}])}=\frac{\frac{20\cdot19}{100\cdot99}}{\frac{20}{100}}, P([d2=red]∣[d1=black])=2099=P([d1=black]∩[d2=red])P([d1=black])=80⋅20100⋅9980100.P([d_2=\text{red}]\mid[d_1=\text{black}])=\frac{20}{99}=\frac{P([d_1=\text{black}]\cap[d_2=\text{red}])}{P([d_1=\text{black}])}=\frac{\frac{80\cdot20}{100\cdot99}}{\frac{80}{100}}. (On the page the middle value in the second line appears as 20/10020/100; the computation of the right-hand side gives 20/9920/99, which is the value stated in the previous paragraph.)

Definition

Given E,F∈FE,F\in\mathcal F with P(F)>0P(F)>0 define P(E∣F)≜P(E∩F)P(F),P(E\mid F)\triangleq\frac{P(E\cap F)}{P(F)}, called the conditional probability of EE given (the occurrence of) FF.

Properties

  • (a) 0≤P(E∣F)≤10\le P(E\mid F)\le1 for all E∈FE\in\mathcal F. Indeed E∩F⊂F⇒0≤P(E∩F)≤P(F)⇒0≤P(E∣F)=P(E∩F)P(F)≤P(F)P(F)=1E\cap F\subset F\Rightarrow0\le P(E\cap F)\le P(F)\Rightarrow0\le P(E\mid F)=\frac{P(E\cap F)}{P(F)}\le\frac{P(F)}{P(F)}=1.
  • (b) If E∩F=∅E\cap F=\varnothing then P(E∣F)=0P(E\mid F)=0 (trivial).
  • (c) If P(E)=0P(E)=0 then P(E∣F)=0P(E\mid F)=0. Indeed E∩F⊂E⇒0≤P(E∣F)=P(E∩F)P(F)≤P(E)P(F)=0E\cap F\subset E\Rightarrow0\le P(E\mid F)=\frac{P(E\cap F)}{P(F)}\le\frac{P(E)}{P(F)}=0.
  • (d) If P(E)=1P(E)=1 then P(E∣F)=1P(E\mid F)=1. Indeed P(E∣F)=P(E∩F)P(F)≥P(E)+P(F)−1P(F)=1P(E\mid F)=\frac{P(E\cap F)}{P(F)}\ge\frac{P(E)+P(F)-1}{P(F)}=1 (using P(E∩F)=P(E)+P(F)−P(E∪F)≥P(E)+P(F)−1P(E\cap F)=P(E)+P(F)-P(E\cup F)\ge P(E)+P(F)-1).
  • (e) Remark: in general P(E∣F)≷P(E)P(E\mid F)\gtrless P(E) depending on P,E,FP,E,F. It is natural to compare the original probability P(E)P(E) with P(E∣F)P(E\mid F), the revised probability of EE after the occurrence of FF.

Lemma: P(⋅∣F)P(\cdot\mid F) is a probability measure

Lemma. For fixed FF with P(F)>0P(F)>0, the map P(⋅∣F):F→RP(\cdot\mid F):\mathcal F\to\mathbb R is a probability measure.

Proof. (FF is fixed once and for all.)

  • (i) P(E∣F)≥0P(E\mid F)\ge0 for all EE, since P(E∣F)=P(E∩F)/P(F)P(E\mid F)=P(E\cap F)/P(F).
  • (ii) P(Ω∣F)=P(Ω∩F)P(F)=P(F)P(F)=1P(\Omega\mid F)=\frac{P(\Omega\cap F)}{P(F)}=\frac{P(F)}{P(F)}=1.
  • (iii) If (Ei)(E_i) is a disjoint sequence of events, then (Ei∩F)(E_i\cap F) is a disjoint sequence too and P(⋃iEi ∣ F)=P((⋃iEi)∩F)P(F)=P(⋃i(Ei∩F))P(F)=∑iP(Ei∩F)P(F)=∑iP(Ei∣F).P\Big(\bigcup_iE_i\,\Big|\,F\Big)=\frac{P\big((\bigcup_iE_i)\cap F\big)}{P(F)}=\frac{P\big(\bigcup_i(E_i\cap F)\big)}{P(F)}=\sum_i\frac{P(E_i\cap F)}{P(F)}=\sum_iP(E_i\mid F).

The axioms are satisfied, so P(⋅∣F)P(\cdot\mid F) is a probability measure (see Probability Measures and AxiomsA probability measure is a non-negative, normalised, sigma-additive map on the sigma-algebra of events; from the three axioms follow the complement rule, monotonicity, subadditivity and inclusion-exclusion, while the axioms do not determine P uniquely.Probability Measures and Axioms →). □\square

Remark. In particular P(Ec∣F)=1−P(E∣F)P(E^c\mid F)=1-P(E\mid F).

Warning. P(E∣Fc)P(E\mid F^c) has no relation with P(E∣F)P(E\mid F) in general!

Empirical conditional probability

Suppose you need to evaluate the effectiveness of a new drug. You organize a clinical trial with nn patients affected by the disease: some get the new drug, some the traditional treatment, some recover, some do not. Define

  • DD = patient gets the new drug, Dˉ\bar D = patient does not get it;
  • RR = patient recovers, Rˉ\bar R = patient does not recover.

Raw data: for each patient one records which of R,RˉR,\bar R and which of D,DˉD,\bar D hold. The summary is the contingency table

DD Dˉ\bar D
RR nRDn_{RD} nRDˉn_{R\bar D} nR=nRD+nRDˉn_R=n_{RD}+n_{R\bar D}
Rˉ\bar R nRˉDn_{\bar RD} nRˉDˉn_{\bar R\bar D} nRˉ=nRˉD+nRˉDˉn_{\bar R}=n_{\bar RD}+n_{\bar R\bar D}
nDn_D nDˉn_{\bar D} n=nR+nRˉ=nD+nDˉn=n_R+n_{\bar R}=n_D+n_{\bar D}

The empirical conditional probabilities (empirical measure P^n\hat P_n of Empirical and Equiprobable MeasuresProbability theory does not say how to choose P; two common choices are the empirical measure built from repeated trials and, on a finite sample space, the equiprobable measure P(E) = favourable cases over all cases.Empirical and Equiprobable Measures →) are P^n(R∣D)=P^n(R∩D)P^n(D)=nRDn⋅nnD=nRDnD=nRDnRD+nRˉD.\hat P_n(R\mid D)=\frac{\hat P_n(R\cap D)}{\hat P_n(D)}=\frac{n_{RD}}n\cdot\frac n{n_D}=\frac{n_{RD}}{n_D}=\frac{n_{RD}}{n_{RD}+n_{\bar RD}}. (The subscripts in this last denominator are small on the page; the form above follows from nD=nRD+nRˉDn_D=n_{RD}+n_{\bar RD}.)

The new drug is effective if P^n(R∣D)>P^n(R∣Dˉ)\hat P_n(R\mid D)>\hat P_n(R\mid\bar D), which is equivalent to det⁡∣nRDnRDˉnRˉDnRˉDˉ∣>0.\det\begin{vmatrix}n_{RD}&n_{R\bar D}\\n_{\bar RD}&n_{\bar R\bar D}\end{vmatrix}>0. These conditions are also equivalent to P^n(R∣D)>P^n(R)\hat P_n(R\mid D)>\hat P_n(R).

Exercise (footnote on the page). P(E∣F)≥P(E∣Fc)P(E\mid F)\ge P(E\mid F^c) is equivalent to P(E∣F)≥P(E)P(E\mid F)\ge P(E). Hint: start by proving that P(E∣F)−P(E∣Fc)=P(E∣F)−P(E)P(Fc).P(E\mid F)-P(E\mid F^c)=\frac{P(E\mid F)-P(E)}{P(F^c)}.

Multiplication formula

If both P(E)>0P(E)>0 and P(F)>0P(F)>0 then P(E∣F)=P(E∩F)P(F)P(E\mid F)=\frac{P(E\cap F)}{P(F)} and P(F∣E)=P(E∩F)P(E)P(F\mid E)=\frac{P(E\cap F)}{P(E)}, therefore P(E∩F)=P(E∣F)P(F)=P(F∣E)P(E).P(E\cap F)=P(E\mid F)P(F)=P(F\mid E)P(E). These are called multiplication formulas and are very useful for the evaluation of P(E∩F)P(E\cap F). Although mathematically equivalent, in practice one might be more convenient than the other.

Example (continuing the urn of 80 black and 20 red balls). P([d1=red]∩[d2=black])=P([d2=black]∣[d1=red]) P([d1=red])=8099⋅20100.P([d_1=\text{red}]\cap[d_2=\text{black}])=P([d_2=\text{black}]\mid[d_1=\text{red}])\,P([d_1=\text{red}])=\frac{80}{99}\cdot\frac{20}{100}.

More elaborate multiplication formulas involve 3 or more events: P(E1∩E2∩E3)=P(E3∣E2∩E1)P(E2∩E1)=P(E3∣E2∩E1)P(E2∣E1)P(E1), etc.P(E_1\cap E_2\cap E_3)=P(E_3\mid E_2\cap E_1)P(E_2\cap E_1)=P(E_3\mid E_2\cap E_1)P(E_2\mid E_1)P(E_1),\ \text{etc.}

Example (deck of cards). Poker deck of 52 cards, draw 3 cards without replacement. P("no clubs among the 3 cards")P(\text{"no clubs among the 3 cards"}) is the product, written right to left, of: P(first no club)P(\text{first no club}), P(second no club∣first no club)P(\text{second no club}\mid\text{first no club}), P(third no club∣first and second no clubs)P(\text{third no club}\mid\text{first and second no clubs}): 52−1352×3851×3750.\frac{52-13}{52}\times\frac{38}{51}\times\frac{37}{50}. (52−13=3952-13=39 cards that are not clubs at the first draw out of 52 in the deck; after the first draw 38 non-clubs remain among 51 cards; after two draws 37 non-clubs among 50.)

Example (Polya urn, good to model the spread of viruses). The urn contains 3 white and 5 red balls. Three draws; after each draw the ball is replaced in the urn together with 2 more balls of the same colour. (In the formulas a comma means ∩\cap.) P(d1=W,d2=W,d3=R)=P(d3=R∣d2=W,d1=W) P(d2=W∣d1=W) P(d1=W)=512×510×38.P(d_1=W,d_2=W,d_3=R)=P(d_3=R\mid d_2=W,d_1=W)\,P(d_2=W\mid d_1=W)\,P(d_1=W)=\frac5{12}\times\frac5{10}\times\frac38. (After one white draw the urn has 5 white and 5 red balls, after a second white draw 7 white and 5 red out of 12.)

Example (two tetrahedral dice). Throw two tetrahedral dice, one black one white. Compute P(4 occurs on the black die∣sum of the dice=i)P(\text{4 occurs on the black die}\mid\text{sum of the dice}=i) for i=2,…,8i=2,\dots,8. Represent Ω\Omega as the 4×44\times4 table of pairs (black, white) with equiprobable measure PP; the anti-diagonals are the sums 5,6,7,85,6,7,8 (and the corner cells give the sums 2,3,42,3,4). Let E=E= "4 on black", Fi=F_i= "sum =i=i". Then P(E∣Fi)=P(E∩Fi)P(Fi)=∣E∩Fi∣∣Fi∣P(E\mid F_i)=\frac{P(E\cap F_i)}{P(F_i)}=\frac{|E\cap F_i|}{|F_i|} and:

  • P(E∣Fi)=0P(E\mid F_i)=0 for i=2,3,4i=2,3,4 since E∩Fi=∅E\cap F_i=\varnothing;
  • P(E∣F5)=14P(E\mid F_5)=\frac14, P(E∣F6)=13P(E\mid F_6)=\frac13, P(E∣F7)=12P(E\mid F_7)=\frac12, P(E∣F8)=1P(E\mid F_8)=1.

Versione ripasso

  • Definition: for P(F)>0P(F)>0, P(E∣F)=P(E∩F)P(F)P(E\mid F)=\dfrac{P(E\cap F)}{P(F)} = probability of EE knowing that FF occurred.
  • Properties: 0≤P(E∣F)≤10\le P(E\mid F)\le1; E∩F=∅⇒P(E∣F)=0E\cap F=\varnothing\Rightarrow P(E\mid F)=0; P(E)=0⇒P(E∣F)=0P(E)=0\Rightarrow P(E\mid F)=0; P(E)=1⇒P(E∣F)=1P(E)=1\Rightarrow P(E\mid F)=1; P(E∣F)≷P(E)P(E\mid F)\gtrless P(E) in general.
  • Lemma: P(⋅∣F)P(\cdot\mid F) is a probability measure (nonneg., P(Ω∣F)=1P(\Omega\mid F)=1, σ\sigma-additive since Ei∩FE_i\cap F disjoint); so P(Ec∣F)=1−P(E∣F)P(E^c\mid F)=1-P(E\mid F). Warning: P(E∣Fc)P(E\mid F^c) is unrelated to P(E∣F)P(E\mid F).
  • Multiplication formula: P(E∩F)=P(E∣F)P(F)=P(F∣E)P(E)P(E\cap F)=P(E\mid F)P(F)=P(F\mid E)P(E); P(E1∩E2∩E3)=P(E3∣E1∩E2)P(E2∣E1)P(E1)P(E_1\cap E_2\cap E_3)=P(E_3\mid E_1\cap E_2)P(E_2\mid E_1)P(E_1).
  • Empirical version: P^n(R∣D)=nRD/nD\hat P_n(R\mid D)=n_{RD}/n_D. Drug effective iff P^n(R∣D)>P^n(R∣Dˉ)\hat P_n(R\mid D)>\hat P_n(R\mid\bar D) iff det⁡∣nRDnRDˉnRˉDnRˉDˉ∣>0\det\begin{vmatrix}n_{RD}&n_{R\bar D}\\n_{\bar RD}&n_{\bar R\bar D}\end{vmatrix}>0 iff P^n(R∣D)>P^n(R)\hat P_n(R\mid D)>\hat P_n(R).
  • Examples: urn 80B/20R: P(d2=red∣d1=red)=19/99P(d_2=\text{red}\mid d_1=\text{red})=19/99, P(d2=red∣d1=black)=20/99P(d_2=\text{red}\mid d_1=\text{black})=20/99, yet P(d2=red)=20/100P(d_2=\text{red})=20/100; no clubs in 3 cards 395238513750\frac{39}{52}\frac{38}{51}\frac{37}{50}; Polya urn 51251038\frac5{12}\frac5{10}\frac38; tetrahedral dice 0,14,13,12,10,\frac14,\frac13,\frac12,1 for sums ≤4,5,6,7,8\le4,5,6,7,8.
  • Typical mistakes: dividing by the wrong event; confusing P(E∣F)P(E\mid F) with P(F∣E)P(F\mid E); treating P(E∣Fc)P(E\mid F^c) as 1−P(E∣F)1-P(E\mid F).

Teoria collegata