Conditional Probability


Table of contents

  1. Definition
  2. Bayes’ Rule
  3. Normalization
    1. Discrete probability

Definition


The probability of event \(x\) conditioned on knowing event \(y\) (or of \(x\) given \(y\)) is defined as:

\[p(x\mid y) = \frac{p(x, y)}{p(y)}\]

Bayes’ Rule

\[p(x\mid y) = \frac{p(y\mid x)p(x)}{p(y)}\]

Example: throwing darts (20 equal regions)

\[p(\text{reg } 5 \mid \text{not reg } 20) = \frac{p(\text{reg } 5, \text{not reg } 20)}{p(\text{not reg } 20)} = \frac{p(\text{reg } 5)}{p(\text{not reg } 20)} = \frac{1/20}{19/20} = \frac{1}{19}\]

Example: \(p(Cnt, MT)\) Based on population:

\[p(Cnt) = \begin{bmatrix} p(Cnt = E) \\ p(Cnt = S) \\ p(Cnt = W) \end{bmatrix} = \begin{bmatrix} 0.88 \\ 0.08 \\ 0.04 \end{bmatrix}\]

Based on research: conditional probability table:

\(p(MT\mid Cnt)\) E S W
Eng 0.95 0.7 0.6
Scot 0.04 0.3 0.0
Well 0.01 0.0 0.4

Calculate joint probability distribution as: \(p(Cnt, MT) = p(MT\mid Cnt) p(Cnt)\)

\(p(MT, Cnt)\) E S W
Eng \(0.95 \times 0.88\) \(0.7 \times 0.08\) \(0.6 \times 0.04\)
Scot \(0.04 \times 0.88\) \(0.3 \times 0.08\) \(0.0 \times 0.04\)
Well \(0.01 \times 0.88\) \(0.0 \times 0.08\) \(0.4 \times 0.04\)

Normalization


Discrete probability

\[\sum_x p(x\mid y) = 1\]

This means that the sum of all the probabilities of \(x\) given \(y\) is 1. So if \(dom(y) = \{1,2\}\) then:

\[\sum_x p(x\mid y=1) = 1\]

And

\[\sum_x p(x\mid y=2) = 1\]