Neha Patil (Editor)

Conditional probability

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Conditional probability

In probability theory, conditional probability is a measure of the probability of an event given that (by assumption, presumption, assertion or evidence) another event has occurred. 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(A|B), or sometimes PB(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%.

Contents

The concept of conditional probability is one of the most fundamental and one of the most important concepts in probability theory. But conditional probabilities can be quite slippery and require careful interpretation. For example, there need not be a causal or temporal relationship between A and B.

P(A|B) may or may not be equal to P(A) (the unconditional probability of A). If P(A|B) = P(A) (or its equivalent P(B|A) = P(B)), then events A and B are said to be independent: in such a case, having knowledge about either event does not change our knowledge about the other event. Also, in general, P(A|B) (the conditional probability of A given B) is not equal to P(B|A). For example, if you have cancer you might have a 90% chance of testing positive for cancer. In this case what is being measured is that the if event B "having cancer" has occurred, the probability A - test is positive given that B having cancer occurred is 90%, P(A|B) = 90%. Alternatively, you can test positive for cancer but you may have only a 10% chance of actually having cancer because cancer is very rare. In this case what is being measured is the probability of the event B - having cancer given that the event A - test is positive has occurred, P(B|A) = 10%. 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.

Kolmogorov definition

Given two events A and B from the sigma-field 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 ( A | B ) = P ( A 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 B ) / P ( B ) as P ( A | B ) 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 B ) = P ( A | B ) 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:

P ( A B ) = P ( A ) + P ( B ) P ( A B ) 0

Measure-theoretic definition

If P(B) = 0, then the simple definition of P(A|B) 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 non-degenerate and jointly continuous random variables with density ƒX,Y(xy) then, if B has positive measure,

P ( X A Y B ) = y B x A f X , Y ( x , y ) d x d y y B x R f X , Y ( x , y ) d x d y .

The case where B has zero measure is problematic. For the case that B = {y0}, representing a single point, the conditional probability could be defined as

P ( X A Y = y 0 ) = x A f X , Y ( x , y 0 ) d x x R f X , Y ( x , y 0 ) d x ,

however this approach leads to the Borel–Kolmogorov paradox. The more general case of zero measure is even more problematic, as can be seen by noting that the limit, as all δyi approach zero, of

P ( X A Y i [ y i , y i + δ y i ] ) i x A f X , Y ( x , y i ) d x δ y i i x R f X , Y ( x , y i ) d x δ 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(A|X), that takes on the value

P ( A X = x )

whenever

X = x .

More formally:

P ( A | X ) ( ω ) = P ( A X = X ( ω ) ) .

The conditional probability P(A|X) is a function of X, e.g., if the function g is defined as

g ( x ) = P ( A X = x ) ,

then

P ( A | X ) = g X

Note that P(A|X) and X are now both random variables. From the law of total probability, the expected value of P(A|X) is equal to the unconditional probability of A.

Example

Suppose that somebody secretly rolls two fair six-sided dice, and we must predict the outcome (the sum of the two upward faces).

  • Let A be the value rolled on die 1.
  • Let B be the value rolled on die 2.
  • 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) = 636 = 16.

    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) = 1036

    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) = 310 = 0.3.

    Use in inference

    In statistical inference, the conditional probability is an update of the probability of an event based on new information. Incorporating the new information can be done as follows

  • 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 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 B compared with P(B), the probability B has occurred.
  • This results in P(A|B) = P(A 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(A|E) 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

    P ( A B ) = P ( A ) P ( B ) .

    If P(B) is not zero, then this is equivalent to the statement that

    P ( A | B ) = P ( A ) .

    Similarly, if P(A) is not zero, then

    P ( B | A ) = P ( B ) .

    is also equivalent. Although the derived forms may seem more intuitive, they are not the preferred definition as the conditional probabilities may be undefined, and the preferred definition is symmetrical in A and B.

    Important distinctions: Independent events vs mutually exclusive events

    The concepts of mutually independent events and mutually exclusive events are often confused.

    As noted, statistical independence means:

    P(A|B) = P(A), P(B|A) = P(B), provided that the probability for the conditioning event is not zero.

    However, mutually exclusive events implies that:

    P(A|B) = 0, P(B|A)=0, and P ( A B ) = 0 .

    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(A|B) ≈ P(B|A). This can be an insidious error, even for those who are highly conversant with statistics. The relationship between P(A|B) and P(B|A) is given by Bayes' theorem:

    P ( B | A ) = P ( A | B ) P ( B ) P ( A ) P ( B | A ) P ( A | B ) = P ( B ) P ( A )

    That is, P(A|B) ≈ P(B|A) only if P(B)/P(A) ≈ 1, or equivalently, P(A) ≈ P(B).

    Alternatively, noting that AB = BA, and applying conditional probability:

    P ( A | B ) P ( B ) = P ( A B ) = P ( B A ) = P ( B | A ) 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(A|B). These probabilities are linked through the law of total probability:

    P ( A ) = n P ( A B n ) = n P ( A | B n ) P ( B n ) .

    where the events ( B n ) form a countable partition of A .

    This fallacy may arise through selection bias. For example, in the context of a medical claim, let SC 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(SC) 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(SC) is high. The actual probability observed by the doctor is P(SC|H).

    Over- or under-weighting 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(A|B) 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.

    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:

    1.  ω B : P ( ω | B ) = α P ( ω ) 2.  ω B : P ( ω | B ) = 0 3.  ω Ω P ( ω | B ) = 1.

    Substituting 1 and 2 into 3 to select α:

    1 = ω Ω P ( ω | B ) = ω B α P ( ω ) + ω B 0 0 = α ω B P ( ω ) = α P ( B ) α = 1 P ( B )

    So the new probability distribution is

    1.  ω B : P ( ω | B ) = P ( ω ) P ( B ) 2.  ω B : P ( ω | B ) = 0

    Now for a general event A,

    P ( A | B ) = ω A B P ( ω | B ) + ω A B c P ( ω | B ) 0 = ω A B P ( ω ) P ( B ) = P ( A B ) P ( B )

    References

    Conditional probability Wikipedia