# Conditional Probability

### [Conditional Probability](https://en.wikipedia.org/wiki/Conditional_probability)

This is defined as the probability of an event occurring, assuming that one or more other events have already occurred. Two events, $$A$$ and $$B$$ are considered to be _independent_ if event $$A$$ has no effect on the probability of event $$B$$ (i.e. $$P(B \vert A) = P(B)$$). If events $$A$$ and $$B$$ are _not independent_, then we must consider the probability that both events occur. This can be referred to as the _intersection_ of events $$A$$ and $$B$$, defined as $$P(A \cap B) = P(B \vert A) * P(A)$$. We can then use this definition to find the _conditional probability_ by dividing the probability of the intersection of the two events $$(A \cap B)$$ by the probability of the event that is assumed to have already occurred (event $$A$$):

$$\large P(B \vert A)=\frac{P(A \cap B)}{P(A)}$$

### [Bayes' Theorem](https://en.wikipedia.org/wiki/Bayes'_theorem)

Let $$A$$ and $$B$$ be two events such that $$P(A \vert B)$$ denotes the probability of the occurrence of $$A$$ given that $$B$$ has occurred and $$P(B \vert A)$$ denotes the probability of the occurrence of  $$B$$given that $$A$$ has occurred, then:

$$\large P(A \vert B) = \frac{P(B \vert A) * P(A)}{P(B)} = \frac{P(B \vert A) * P(A)}{P( B \vert A) * P(A) + P(B \vert A^c) * P(A^c)}$$

<div align="left"><img src="https://3501392451-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLZ89zzVxrdnG1RG6CA%2F-LMra_S_R9dn880oYnDO%2F-LMsFA9UJjj79tESga8M%2Fquestions.png?alt=media&#x26;token=a7fa6a22-b86c-4ec0-bfb1-87af9683220b" alt=""></div>

