It's basically a textbook question however I want to make sure about every derivation step.
X, Z are random variables.
Z follows Bernoulli distribution. The probability density function of Z: $h(z) = x\delta(1) + (1-x)\delta(0)$,
where $\delta(\cdot)$ is Delta distribution, meaning, $\delta(\cdot)=1, \text{ if } z=\cdot; \delta(1)=0, \text{ otherwise}$
The probability density function of X: $f_x$
Then we have $E[Z] = \int xf_xdx$.
I was wondering if it is, $E[Z] = E[1\times x + 0\times (1-x)]=E[1\times \int xf_xdx]=\int xf_xdx$
If it is not, would you please show me the derivation steps? Thanks!
Looking forward to your reply.