Conditional probability

For 2 events A and B, the conditional probability of A given B, is written as P(A|B) and refers to the probability of the occurrence of A, given that B has already occurred.

An example might be, what is the probability of a fault in a manufactured part (event A), given that it was manufactured at some factory (event B)

provide that the probability of event B is not zero, i.e. P(B) != 0 then;

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

this can be reversed like so (provided P(A) != 0;

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