How to prove that $P(U\le h(X))=E(P(U\le h(x)\mid X=x))$

31 Views Asked by At

This question comes from a derivation of the wiki page here about the unconditional acceptance probability:

enter image description here

The general form seems to be:

$ \mathbb P(U\le h(X))=\mathbb E_g(\mathbb P(U\le h(x)\mid X=x))$

where $U$ is uniformly distributed over [0,1], $h$ is a nice function with range being [0,1] and the pdf of r.v. $X$ is $g(x)$. Maybe $U$ and $X$ are independent from the context of the wiki. I don't know how to prove this equation.

1

There are 1 best solutions below

0
On BEST ANSWER

$\mathbb P(U\leq h(X))=\int_{x} P(U\leq h(X)|X=x)g(x)dx$ Now take $f(x)=P(U\leq h(X)|X=x)$ Then $\mathbb P(U\leq h(X))=\int_{x} f(x)g(x)dx=E_{g}(f(X))=E_{g}(P(U\leq h(X)|X=x))$