In probability theory, the chain rule[1] (also called the general product rule[2] [3]) describes how to calculate the probability of the intersection of, not necessarily independent, events or the joint distribution of random variables respectively, using conditional probabilities. This rule allows you to express a joint probability in terms of only conditional probabilities.[4] The rule is notably used in the context of discrete stochastic processes and in applications, e.g. the study of Bayesian networks, which describe a probability distribution in terms of conditional probabilities.
A
B
P(A\capB)=P(B\midA)P(A)
where
P(B\midA)
B
A
An Urn A has 1 black ball and 2 white balls and another Urn B has 1 black ball and 3 white balls. Suppose we pick an urn at random and then select a ball from that urn. Let event
A
P(A)=P(\overline{A})=1/2
\overlineA
A
B
P(B|A)=2/3.
A\capB
P(A\capB)=P(B\midA)P(A)=
23 | |
⋅ |
12 | |
= |
13. | |
For events
A1,\ldots,An
\begin{align} P\left(A1\capA2\cap\ldots\capAn\right)&=P\left(An\midA1\cap\ldots\capAn-1\right)P\left(A1\cap\ldots\capAn-1\right)\\ &=P\left(An\midA1\cap\ldots\capAn-1\right)P\left(An-1\midA1\cap\ldots\capAn-2\right)P\left(A1\cap\ldots\capAn-2\right)\\ &=P\left(An\midA1\cap\ldots\capAn-1\right)P\left(An-1\midA1\cap\ldots\capAn-2\right) ⋅ \ldots ⋅ P(A3\midA1\capA2)P(A2\midA1)P(A1)\\ &=P(A1)P(A2\midA1)P(A3\midA1\capA2) ⋅ \ldots ⋅ P(An\midA1\cap...\capAn-1)\\ &=
n | |
\prod | |
k=1 |
P(Ak\midA1\cap...\capAk-1)\\ &=
n | |
\prod | |
k=1 |
P\left(Ak|
k-1 | |
cap | |
j=1 |
Aj\right). \end{align}
For
n=4
\begin{align} P(A1\capA2\capA3\capA4)&=P(A4\midA3\capA2\capA1)P(A3\capA2\capA1)\\ &=P(A4\midA3\capA2\capA1)P(A3\midA2\capA1)P(A2\capA1)\\ &=P(A4\midA3\capA2\capA1)P(A3\midA2\capA1)P(A2\midA1)P(A1) \end{align}
We randomly draw 4 cards without replacement from deck with 52 cards. What is the probability that we have picked 4 aces?
First, we set . Obviously, we get the following probabilities
P(A1)=
4{52}, | |
P(A |
2\midA1)=
3{51}, | |
P(A |
3\midA1\capA2)=
2{50}, | |
P(A |
4\midA1\capA2\capA3)=
1{49} | |
Applying the chain rule,
P(A1\capA2\capA3\capA4)=
4{52} | |
⋅ |
3{51} | |
⋅ |
2{50} | |
⋅ |
1{49} | |
Let
(\Omega,lA,P)
A\inlA
B\inlA
\begin{align} P(A\midB):=\begin{cases}
P(A\capB) | |
P(B) |
,&P(B)>0,\ 0&P(B)=0.\end{cases} \end{align}
For two discrete random variables
X,Y
A:=\{X=x\}
B:=\{Y=y\}
P(X=x,Y=y)=P(X=x\midY=y)P(Y=y),
or
P(X,Y)(x,y)=PX(x\midy)PY(y),
where
PX(x):=P(X=x)
X
PX(x\midy)
X
Y
Let
X1,\ldots,Xn
x1,...,xn\inR
P\left(Xn=xn,\ldots,X1=x1\right)=P\left(Xn=xn|Xn-1=xn-1,\ldots,X1=x1\right)P\left(Xn-1=xn-1,\ldots,X1=x1\right)
and using the chain rule, where we set
Ak:=\{Xk=xk\}
\begin{align} P\left(X1=x1,\ldotsXn=xn\right)&=P\left(X1=x1\midX2=x2,\ldots,Xn=xn\right)P\left(X2=x2,\ldots,Xn=xn\right)\\ &=P(X1=x1)P(X2=x2\midX1=x1)P(X3=x3\midX1=x1,X2=x2) ⋅ \ldots\\ & ⋅ P(Xn=xn\midX1=x1,...,Xn-1=xn-1)\\ \end{align}
For
n=3
\begin{align} P | |
(X1,X2,X3) |
(x1,x2,x3) &=P(X1=x1,X2=x2,X3=x3)\ &=P(X3=x3\midX2=x2,X1=x1)P(X2=x2,X1=x1)\\ &=P(X3=x3\midX2=x2,X1=x1)P(X2=x2\midX1=x1)P(X1=x1)\\ &=
P | |
X3\midX2,X1 |
(x3\midx2,x1)
P | |
X2\midX1 |
(x2\midx1)
P | |
X1 |
(x1). \end{align}