Conditional probability
Part of a series on Statistics 
Probability theory 


In probability theory, a conditional probability measures the probability of an event given that (by assumption, presumption, assertion or evidence) another event has occurred.^{[1]} If the event of interest is A and the event B is known or assumed to have occurred, "the conditional probability of A given B", or "the probability of A under the condition B", is usually written as P(AB), or sometimes P_{B}(A). For example, the probability that any given person has a cough on any given day may be only 5%. But if we know or assume that the person has a cold, then they are much more likely to be coughing. The conditional probability of coughing given that you have a cold might be a much higher 75%.
The concept of conditional probability is one of the most fundamental and one of the most important concepts in probability theory.^{[2]} But conditional probabilities can be quite slippery and require careful interpretation.^{[3]} For example, there need not be a causal or temporal relationship between A and B.
P(AB) may or may not be equal to P(A) (the unconditional probability of A). If P(AB) = P(A), then A and B are said to be independent. Also, in general, P(AB) (the conditional probability of A given B) is not equal to P(BA). For example, if you have cancer you might have a 90% chance of testing positive for cancer, but if you test positive for cancer you might have only a 10% chance of actually having cancer because cancer is very rare. Falsely equating the two probabilities causes various errors of reasoning such as the base rate fallacy. Conditional probabilities can be correctly reversed using Bayes' theorem.
Contents

Definition 1

Conditioning on an event 1.1
 Kolmogorov definition 1.1.1
 As an axiom of probability 1.1.2
 Definition with σalgebra 1.2
 Conditioning on a random variable 1.3

Conditioning on an event 1.1
 Example 2
 Use in inference 3
 Statistical independence 4

Common fallacies 5
 Assuming conditional probability is of similar size to its inverse 5.1
 Assuming marginal and conditional probabilities are of similar size 5.2
 Over or underweighting priors 5.3
 Formal derivation 6
 See also 7
 References 8
 External links 9
Definition
Conditioning on an event
Kolmogorov definition
Given two events A and B from the sigmafield of a probability space with P(B) > 0, the conditional probability of A given B is defined as the quotient of the probability of the joint of events A and B, and the probability of B:
 P(AB) = \frac{P(A \cap B)}{P(B)}
This may be visualized as restricting the sample space to B. The logic behind this equation is that if the outcomes are restricted to B, this set serves as the new sample space.
Note that this is a definition but not a theoretical result. We just denote the quantity P(A\cap B)/P(B) as P(AB) and call it the conditional probability of A given B.
As an axiom of probability
Some authors, such as De Finetti, prefer to introduce conditional probability as an axiom of probability:
 P(A \cap B) = P(AB)P(B)
Although mathematically equivalent, this may be preferred philosophically; under major probability interpretations such as the subjective theory, conditional probability is considered a primitive entity. Further, this "multiplication axiom" introduces a symmetry with the summation axiom for mutually exclusive events:^{[4]}
 P(A \cup B) = P(A) + P(B)  \cancelto0{P(A \cap B)}
Definition with σalgebra
If P(B) = 0, then the simple definition of P(AB) is undefined. However, it is possible to define a conditional probability with respect to a σalgebra of such events (such as those arising from a continuous random variable).
For example, if X and Y are nondegenerate and jointly continuous random variables with density ƒ_{X,Y}(x, y) then, if B has positive measure,
 P(X \in A \mid Y \in B) = \frac{\int_{y\in B}\int_{x\in A} f_{X,Y}(x,y)\,dx\,dy}{\int_{y\in B}\int_{x\in\Omega} f_{X,Y}(x,y)\,dx\,dy} .
The case where B has zero measure can only be dealt with directly in the case that B = {y_{0}}, representing a single point, in which case
 P(X \in A \mid Y = y_0) = \frac{\int_{x\in A} f_{X,Y}(x,y_0)\,dx}{\int_{x\in\Omega} f_{X,Y}(x,y_0)\,dx} .
If A has measure zero then the conditional probability is zero. An indication of why the more general case of zero measure cannot be dealt with in a similar way can be seen by noting that the limit, as all δy_{i} approach zero, of
 P(X \in A \mid Y \in \cup_i[y_i,y_i+\delta y_i]) \approxeq \frac{\sum_{i} \int_{x\in A} f_{X,Y}(x,y_i)\,dx\,\delta y_i}{\sum_{i}\int_{x\in\Omega} f_{X,Y}(x,y_i) \,dx\, \delta y_i} ,
depends on their relationship as they approach zero. See conditional expectation for more information.
Conditioning on a random variable
Conditioning on an event may be generalized to conditioning on a random variable. Let X be a random variable; we assume for the sake of presentation that X is discrete, that is, X takes on only finitely many values x. Let A be an event. The conditional probability of A given X is defined as the random variable, written P(AX), that takes on the value
 P(A\mid X=x)
whenever
 X=x.
More formally:
 P(AX)(\omega)=P(A\mid X=X(\omega)) .
The conditional probability P(AX) is a function of X, e.g., if the function g is defined as
 g(x)= P(A\mid X=x),
then
 P(AX) =g\circ X
Note that P(AX) and X are now both random variables. From the law of total probability, the expected value of P(AX) is equal to the unconditional probability of A.
Example
Suppose that somebody secretly rolls two fair sixsided dice, and we must predict the outcome.
What is the probability that A = 2?
Table 1 shows the sample space of 36 outcomes
Clearly, A = 2 in exactly 6 of the 36 outcomes, thus P(A=2) = ^{6}⁄_{36} = ^{1}⁄_{6}.

Table 1 + B=1 2 3 4 5 6 A=1 2 3 4 5 6 7 2 3 4 5 6 7 8 3 4 5 6 7 8 9 4 5 6 7 8 9 10 5 6 7 8 9 10 11 6 7 8 9 10 11 12
Suppose it is revealed that A+B ≤ 5
What is the probability A+B ≤ 5 ?
Table 2 shows that A+B ≤ 5 for exactly 10 of the same 36 outcomes, thus P(A+B ≤ 5) = ^{10}⁄_{36}

Table 2 + B=1 2 3 4 5 6 A=1 2 3 4 5 6 7 2 3 4 5 6 7 8 3 4 5 6 7 8 9 4 5 6 7 8 9 10 5 6 7 8 9 10 11 6 7 8 9 10 11 12
What is the probability that A = 2 given that A+B ≤ 5 ?
Table 3 shows that for 3 of these 10 outcomes, A = 2
Thus, the conditional probability P(A=2  A+B ≤ 5) = ^{3}⁄_{10} = 0.3.

Table 3 + B=1 2 3 4 5 6 A=1 2 3 4 5 6 7 2 3 4 5 6 7 8 3 4 5 6 7 8 9 4 5 6 7 8 9 10 5 6 7 8 9 10 11 6 7 8 9 10 11 12
Use in inference
In statistical inference, the conditional probability is an update of the probability of an event based on new information.^{[3]} Incorporating the new information can be done as follows ^{[1]}
 Let A the event of interest be in the sample space, say (X,P).
 The occurrence of the event A knowing that event B has or will have occurred, means the occurrence of A as it is restricted to B, i.e. A \cap B.
 Without the knowledge of the occurrence of B, the information about the occurrence of A would simply be P(A)
 The probability of A knowing that event B has or will have occurred, will be the probability of A \cap B compared with P(B), the probability B has occurred.
 This results in P(AB) = P(A \cap B)/P(B) whenever P(B)>0 and 0 otherwise.
Note: This approach results in a probability measure that is consistent with the original probability measure and satisfies all the Kolmogorov Axioms. This conditional probability measure also could have resulted by assuming that the relative magnitude of the probability of A with respect to X will be preserved with respect to B (cf. a Formal Derivation below).
Note: The phraseology "evidence" or "information" is generally used in the Bayesian interpretation of probability. The conditioning event is interpreted as evidence for the conditioned event. That is, P(A) is the probability of A before accounting for evidence E, and P(AE) is the probability of A after having accounted for evidence E or after having updated P(A). This is consistent with the frequentist interpretation, which presumably is the first definition given above.
Statistical independence
Events A and B are defined to be statistically independent if:
 \begin{align} P(A \cap B) &= P(A) P(B) \\ \Leftrightarrow P(AB) &= P(A) \\ \Leftrightarrow P(BA) &= P(B) \end{align}
That is, the occurrence of A does not affect the probability of B, and vice versa. Although the derived forms may seem more intuitive, they are not the preferred definition as the conditional probabilities may be undefined if P(A) or P(B) are 0, and the preferred definition is symmetrical in A and B.
Common fallacies
 These fallacies should not be confused with Robert K. Shope's 1978 "conditional fallacy", which deals with counterfactual examples that beg the question.
Assuming conditional probability is of similar size to its inverse
In general, it cannot be assumed that P(AB) ≈ P(BA). This can be an insidious error, even for those who are highly conversant with statistics.^{[5]} The relationship between P(AB) and P(BA) is given by Bayes' theorem:
 P(BA) = \frac{P(AB) P(B)}{P(A)}.
That is, P(AB) ≈ P(BA) only if P(B)/P(A) ≈ 1, or equivalently, P(A) ≈ P(B).
Alternatively, noting that A ∩ B = B ∩ A, and applying conditional probability:
 P(AB)P(B) = P(A \cap B) = P(B \cap A) = P(BA)P(A)
Rearranging gives the result.
Assuming marginal and conditional probabilities are of similar size
In general, it cannot be assumed that P(A) ≈ P(AB). These probabilities are linked through the law of total probability:
 P(A) = \sum_n P(A \cap B_n) = \sum_n P(AB_n)P(B_n).
where the events (B_n) form a countable partition of A.
This fallacy may arise through selection bias.^{[6]} For example, in the context of a medical claim, let S_{C} be the event that a sequela (chronic disease) S occurs as a consequence of circumstance (acute condition) C. Let H be the event that an individual seeks medical help. Suppose that in most cases, C does not cause S so P(S_{C}) is low. Suppose also that medical attention is only sought if S has occurred due to C. From experience of patients, a doctor may therefore erroneously conclude that P(S_{C}) is high. The actual probability observed by the doctor is P(S_{C}H).
Over or underweighting priors
Not taking prior probability into account partially or completely is called base rate neglect. The reverse, insufficient adjustment from the prior probability is conservatism.
Formal derivation
Formally, P(AB) is defined as the probability of A according to a new probability function on the sample space, such that outcomes not in B have probability 0 and that it is consistent with all original probability measures.^{[7]}^{[8]}
Let Ω be a sample space with elementary events {ω}. Suppose we are told the event B ⊆ Ω has occurred. A new probability distribution (denoted by the conditional notation) is to be assigned on {ω} to reflect this. For events in B, it is reasonable to assume that the relative magnitudes of the probabilities will be preserved. For some constant scale factor α, the new distribution will therefore satisfy:
 \begin{align} &\text{1. }\omega \in B : P(\omegaB) = \alpha P(\omega) \\ &\text{2. }\omega \notin B : P(\omegaB) = 0 \\ &\text{3. }\sum_{\omega \in \Omega} {P(\omegaB)} = 1. \end{align}
Substituting 1 and 2 into 3 to select α:
 \begin{align} \sum_{\omega \in \Omega} {P(\omega  B)} &= \sum_{\omega \in B} {\alpha P(\omega)} + \cancelto{0}{\sum_{\omega \notin B} 0} \\ &= \alpha \sum_{\omega \in B} {P(\omega)} \\ &= \alpha \cdot P(B) \\ \Rightarrow \alpha &= \frac{1}{P(B)} \end{align}
So the new probability distribution is
 \begin{align} \text{1. }\omega \in B&: P(\omegaB) = \frac{P(\omega)}{P(B)} \\ \text{2. }\omega \notin B&: P(\omega B) = 0 \end{align}
Now for a general event A,
 \begin{align} P(AB) &= \sum_{\omega \in A \cap B} {P(\omega  B)} + \cancelto{0}{\sum_{\omega \in A \cap B^c} P(\omegaB)} \\ &= \sum_{\omega \in A \cap B} {\frac{P(\omega)}{P(B)}} \\ &= \frac{P(A \cap B)}{P(B)} \end{align}
See also
 Borel–Kolmogorov paradox
 Chain rule (probability)
 Class membership probabilities
 Conditional probability distribution
 Conditioning (probability)
 Joint probability distribution
 Monty Hall problem
 Posterior probability
References
 ^ ^{a} ^{b}
 ^
 ^ ^{a} ^{b}
 ^ Gillies, Donald (2000); "Philosophical Theories of Probability"; Routledge; Chapter 4 "The subjective theory"
 ^ Paulos, J.A. (1988) Innumeracy: Mathematical Illiteracy and its Consequences, Hill and Wang. ISBN 0809074478 (p. 63 et seq.)
 ^ Thomas Bruss, F; Der Wyatt Earp Effekt; Spektrum der Wissenschaft; March 2007
 ^ George Casella and Roger L. Berger (1990), Statistical Inference, Duxbury Press, ISBN 0534119581 (p. 18 et seq.)
 ^ Grinstead and Snell's Introduction to Probability, p. 134
External links
 Weisstein, Eric W., "Conditional Probability", MathWorld.
 F. Thomas Bruss Der WyattEarpEffekt oder die betörende Macht kleiner Wahrscheinlichkeiten (in German), Spektrum der Wissenschaft (German Edition of Scientific American), Vol 2, 110–113, (2007).
 Visual explanation of conditional probability
 Articles needing additional references from September 2013
 All articles needing additional references
 WorldHeritage articles that are too technical from January 2014
 All articles that are too technical
 Articles needing expert attention from January 2014
 All articles needing expert attention
 Probability theory
 Logical fallacies
 Conditionals
 Statistical ratios
 Statistical terminology