Motivation:


1. I want to compute $$E[g(X)] := \int\_{\Omega} g(X(\omega)) d\mathbb{P}(\omega) \tag{\*}$$ without needing change of variable formula.
2. I want to prove the change of variable formula (you know the one I don't want to use for #1) without 'standard machine' (indicator, simple, nonnegative, integrable).


That is, prove $$(\*) = \int\_{\mathbb{R}} g(x) d\mathcal{L}\_X(x)$$


possibly by writing


$$g(X) = \int\_{\mathbb R} g(x) 1\_{\{x = X(\omega)\}}(\omega) dx$$




---


We are given $(\Omega, \mathscr F, \mathbb P)$, $n \in \mathbb N$, $i = 1, \dots, n$ and $A\_i \in \mathscr F$.


Bernoulli: Let $X\_i \sim Be(p)$ where and $p = \mathbb P (A\_i)$.


Binomial: Let $X = \sum\_i X\_i \sim Binom(n,p)$ where $n \in \mathbb N$.


Thus, we can write the random variables explicitly in terms of indicator functions $X\_i = 1\_{A\_i}$ and $X = \sum\_i 1\_{A\_i}$.


Is there a way to do this for any random variable? Given the definition of Lebesgue integration, I think we can though we would have to use $\lim$, $\sup$, $\sum$, $X^+, X^-$, etc. Here's what I tried:


Discrete Uniform: Let $DU\_i \sim Unif\{1,\cdots,6\}$. Can we write $DU=\sum\_{d=1}^{6} d1\_d dd$?


Continuous Uniform: Let $CU\_i \sim Unif(0,1)$. Can we write $CU=\int\_0^1 c 1\_c dc$?


Normal: Let $Z \sim N(0,1)$. Can we write $Z = \int\_{\mathbb R} z1\_z dz$ ?


How about $$Z = \int\_{\mathbb R} z \lim\_n \frac{\sum\_{i=1}^{n} 1\_{A\_i} - np}{\sqrt{np(1-p)}} dz$$ ?


I'm guessing that while $$\frac{\sum\_i 1\_{A\_i} - np}{\sqrt{np(1-p)}} \nrightarrow Z$$, $$\frac{\sum\_i 1\_{A\_i} - np}{\sqrt{np(1-p)}} \to 1\_z$$


I guess we need some filtration $\{\mathscr F\_0\} \cup \{\mathscr F\_n\}\_{n \in \mathbb N}$ and possibly $\mathscr F\_{\infty} := \sigma(\mathscr F\_0 \cup \bigcup\_{n \in \mathbb N} \mathscr F\_n)$


Any: $Y = \int\_{\mathbb R} y1\_y dy$ ?


I guess there may be some integrability issue such as if $X \sim Cantor$. I guess there may be some integrability issue such as if $X \sim Cantor$. I recall $\mathscr L\_X(B) = P(X \in B)$ is a probability measure on $(\mathbb R, \mathscr B)$, but I'm not sure how that would resolve any integrability issue.


Perhaps $Y = \int\_{\mathbb R} y1\_y d\mu(x)$, but I'm not sure what the measurable space would be.




---


Found this in class notes:


For any $X$, $g\_n(X) = \min\{n, \frac{[[2^ng(x)]]}{2^n}\}$ is simple, nondecreasing and $\to X$.


Then


$$X = X^+-X^-$$


$$X^+ = \lim\_n \min\{n, \frac{[[2^nx^+]]}{2^n}\}$$


$$\min\{n, \frac{[[2^nx^+]]}{2^n}\} = n\*1\_{n \le \frac{[[2^nx^+]]}{2^n}} + \frac{[[2^nx^+]]}{2^n}\* 1\_{n \ge \frac{[[2^nx^+]]}{2^n}}$$


I guess that counts?



Explicitly representing a random variable in terms of indicator functions
$\newcommand{\ep}{\epsilon}
\newcommand{\R}{\mathbb{R}}
\newcommand{\E}{\operatorname{\mathsf E}} 
\newcommand{\PP}{\operatorname{\mathsf P}}$ 


For any random variable (r.v.) $X$, you can write $X=X\_+-X\_-$, where $X\_+:=\max(0,X)$ and $X\_-:=\max(0,-X)$. Then you can write 
$$X\_+=\int\_0^\infty I\{X>x\}dx,\quad X\_-=\int\_0^\infty I\{-X>x\}dx,$$
and hence
\begin{equation}
 X=\int\_0^\infty (I\{X>x\}-I\{-X>x\})dx,\tag{1}
\end{equation}
where $I\{\cdot\}$ is the indicator function. 


**Addition in response to the editing of the post:** 
Suppose that $g\colon\R\to\R$ is a Borel-measurable function such that $\E g(X)$ exists. By (1),
\begin{equation}
 g(X)=\int\_0^\infty (I\{g(X)>u\}-I\{-g(X)>u\})du. \tag{2}
\end{equation}
So, introducing the distribution (law) $\mu\_X=\PP X^{-1}$ of $X$, by the Fubini theorem we have 
\begin{align\*}
 \E g(X)&=\int\_0^\infty (\E I\{g(X)>u\}-\E I\{-g(X)>u\})du \\ 
 &=\int\_0^\infty (\PP\{g(X)>u\}-\PP\{-g(X)>u\})du \\ 
 &=\int\_0^\infty [\mu\_X(\{x\in\R\colon g(x)>u\})-\mu\_X(\{x\in\R\colon -g(x)>u\})]du \\ 
 &=\int\_0^\infty du \Big(\int\_\R\mu\_X(dx)(I\{g(x)>u\}-I\{-g(x)>u\})\Big) \\ 
 &=\int\_\R\mu\_X(dx)\int\_0^\infty du\, (I\{g(x)>u\}-I\{-g(x)>u\}) \\ 
 &=\int\_\R\mu\_X(dx)g(x), 
\end{align\*}
which is what you wanted, I hope. 


