El Teorema de probabilitats totals [ 1] afirma el següent:
Considerem un espai de probabilitats
(
Ω
,
A
,
P
)
{\displaystyle (\Omega ,{\mathcal {A}},\mathbb {P} )}
i sigui
A
1
,
A
2
,
.
.
.
,
A
n
,
…
{\displaystyle A_{1},A_{2},...,A_{n},\dots }
una partició (finita o infinit numerable) de
Ω
{\displaystyle \Omega }
en esdeveniments que tenen probabilitat diferent de zero:
Ω
=
⋃
n
A
n
.
{\displaystyle \Omega =\bigcup _{n}A_{n}.}
Per tot
n
,
A
n
∈
A
.
{\displaystyle {\text{Per tot }}n,\ A_{n}\in {\mathcal {A}}.}
Si
n
≠
m
{\displaystyle n\neq m}
,
A
n
∩
A
m
=
∅
{\displaystyle A_{n}\cap A_{m}=\emptyset }
Per tot
n
,
P
(
A
n
)
>
0.
{\displaystyle {\text{Per tot }}n,\ \mathbb {P} (A_{n})>0.}
Sigui
B
{\displaystyle B}
un esdeveniment qualsevol. Aleshores,
P
(
B
)
=
∑
n
P
(
B
|
A
n
)
P
(
A
n
)
,
{\displaystyle \mathbb {P} (B)=\sum _{n}\mathbb {P} (B\,|\,A_{n})\,\mathbb {P} (A_{n}),}
on
P
(
B
|
A
n
)
{\displaystyle \mathbb {P} (B\,|\,A_{n})}
és la probabilitat de
B
{\displaystyle B}
condicionada per
A
n
{\displaystyle A_{n}}
.
P
(
B
)
=
P
(
B
∩
Ω
)
=
P
(
B
∩
(
⋃
n
A
n
)
)
=
P
(
⋃
n
(
B
∩
A
n
)
)
=
∑
n
P
(
B
∩
A
n
)
=
∑
n
P
(
B
|
A
n
)
P
(
A
n
)
.
{\displaystyle \mathbb {P} (B)=\mathbb {P} (B\cap \Omega )=\mathbb {P} {\Big (}B\cap {\big (}\bigcup _{n}A_{n}{\big )}{\Big )}=\mathbb {P} {\Big (}\bigcup _{n}{\big (}B\cap A_{n}{\big )}{\Big )}=\sum _{n}\mathbb {P} {\big (}B\cap A_{n}{\big )}=\sum _{n}\mathbb {P} (B\,|\,A_{n})\,\mathbb {P} (A_{n}).}
Una versió per probabilitats condicionades
modifica
Considerem ara una partició finita o numerable d'un esdeveniment
A
{\displaystyle A}
:
A
=
⋃
n
A
n
{\displaystyle A=\bigcup _{n}A_{n}}
amb les mateixes condicions 2, 3 i 4 d'abans. Aleshores
P
(
B
|
A
)
=
∑
n
P
(
B
|
A
n
)
P
(
A
n
|
A
)
.
(
1
)
{\displaystyle \mathbb {P} (B\,|\,A)=\sum _{n}\mathbb {P} (B\,|\,A_{n})\,\mathbb {P} (A_{n}\,|\,A).\qquad (1)}
Prova: Raonant com a la demostració anterior,
P
(
B
∩
A
)
=
P
(
B
∩
(
⋃
n
A
n
)
)
=
∑
n
P
(
B
∩
A
n
)
=
∑
n
P
(
B
|
A
n
)
P
(
A
n
)
,
{\displaystyle \mathbb {P} (B\cap A)=\mathbb {P} {\Big (}B\cap {\big (}\bigcup _{n}A_{n}{\big )}{\Big )}=\sum _{n}\mathbb {P} (B\cap A_{n})=\sum _{n}\mathbb {P} (B\,|\,A_{n})\,\mathbb {P} (A_{n}),}
Però com que
A
n
=
A
n
∩
A
,
{\displaystyle A_{n}=A_{n}\cap A,}
P
(
A
n
)
=
P
(
A
n
∩
A
)
=
P
(
A
n
|
A
)
P
(
A
)
.
{\displaystyle \mathbb {P} (A_{n})=\mathbb {P} (A_{n}\cap A)=\mathbb {P} (A_{n}\,|\,A)\,\mathbb {P} (A).}
Llavors,
P
(
B
∩
A
)
=
∑
n
P
(
B
|
A
n
)
P
(
A
n
|
A
)
P
(
A
)
,
{\displaystyle \mathbb {P} (B\cap A)=\sum _{n}\mathbb {P} (B\,|\,A_{n})\,\mathbb {P} (A_{n}\,|\,A)\,\mathbb {P} (A),}
d'on surt la fórmula (1).
Observació. Si totes les probabilitats
P
(
B
|
A
n
)
{\displaystyle \mathbb {P} (B\,|\,A_{n})}
són iguals, posem
P
(
B
|
A
n
)
=
C
{\displaystyle \mathbb {P} (B\,|\,A_{n})=C}
, llavors també
P
(
B
|
A
)
=
C
.
{\textstyle \mathbb {P} (B\,|\,A)=C.}
En efecte, aplicant la fórmula (1),
P
(
B
|
A
)
=
∑
n
P
(
B
|
A
n
)
P
(
A
n
|
A
)
=
C
∑
n
P
(
A
n
|
A
)
=
C
.
{\displaystyle \mathbb {P} (B\,|\,A)=\sum _{n}\mathbb {P} (B\,|\,A_{n})\,\mathbb {P} (A_{n}\,|\,A)=C\sum _{n}\mathbb {P} (A_{n}\,|\,A)=C.}
La versió del teorema per probabilitats condicionades permet reduir el càlcul de
P
(
B
|
A
)
{\displaystyle \mathbb {P} (B|A)\ }
al de les probabilitats
P
(
B
|
A
n
)
,
{\displaystyle \ \mathbb {P} (B\,|\,A_{n}),\ }
que a vegades és més fàcil, ja que l'esdeveniment
A
n
{\displaystyle A_{n}}
, sent més petit que l'esdeveniment
A
{\displaystyle A}
, ofereix informació més precisa, i facilita la predicció (pronòstic = càlcul de probabilitat condicional ). Això passa sovint quan s'estudien dues cadenes de Markov , on una és la imatge de l'altra. La demostració de la propietat de Markov per als processos de Galton-Watson n'és un exemple.