# Discrete random variable-expected value

For each discrete random variable $$X$$ and a measurable set $$B$$, for which $$P [B]> 0$$, show that $$E [X | B] = \frac{E [1_{B}X]} {P [B]}$$. I have $$E [X | B] = \frac{\sum x_{i} * P(\{X=x_{i}\} \cap B) } {P [B]}$$ and I don't know what next.

$$\frac{E[X 1_B]}{p[B]}=\frac{\sum_{\omega \in \Omega} x \times 1_B\times P(\{X=x\} ) } {P [B]}=\frac{\sum_{\omega \in B\cup B^{c}} x \times 1_B\times P(\{X=x\} ) } {P [B]}=\frac{\sum_{\omega \in B} x \times 1_B\times P(\{X=x\} )+0 } {P [B]}=\frac{\sum_{\omega \in B} x \times P(\{X=x\} ) } {P [B]}=\frac{\sum_{\omega \in B} x \times P(\{X=x\} \cap \{ \omega \in B\} ) } {P [B]}=\frac{\sum_{\omega \in \Omega} x \times P(\{X=x\} \cap \{ \omega \in B\} ) } {P [B]}=\sum_{\omega \in \Omega} x \times \frac{P(\{X=x\} \cap \{ \omega \in B\}}{P [B]} )=\sum_{\omega \in \Omega} x \times P(\{X=x\}|B )=E(X|B)$$

another way

$$\frac{E[X 1_B]}{p[B]}=\frac{EE[X 1_B|X]}{p[B]}$$

$$=\frac{E(XE[1_B|X])}{p[B]}=\frac{E(Xg(X))}{p[B]}$$

$$=\frac{\sum_x x g(x) p(X=x)}{p[B]}=\frac{\sum_x x E(1_B|X=x) p(X=x)}{p[B]}$$

$$=\frac{\sum_x x p(B|X=x) p(X=x)}{p[B]}$$

$$=\frac{\sum_x x p(X=x|B) p(B)}{p[B]}$$

$$=\frac{p(B) \sum_x x p(X=x|B) }{p[B]}$$

$$=\sum_x x p(X=x|B)=E(X|B)$$

note that $$E[1_B|X]$$ is a random variable that it is a function of $$X$$.

• What did you prove? – Kingis Mar 30 at 17:36
• I edited it. is it what you want or not? – masoud Mar 30 at 19:15
• Why do you use $\omega$? – Kingis Mar 30 at 19:28
• since $E(X 1_B)=E(X 1_B(\omega))$ , $B$ is a measurable set so $B \in F$ in the probability space $(\Omega, F ,P)$ (so $B\subset \Omega$ such that $B\in F$ – masoud Mar 30 at 19:32
• okey but i must write probably $\omega$ im my equation when i have X – Kingis Mar 30 at 19:47