Can you please help me on this question:
(a) In class we define the expectation of a random variable $X$ as $$\mathbb{E}(X):=\sum_{\omega\in\Omega}X(\omega)\mathrm{Pr}[\omega]\;,$$ where $\Omega$ is the sample space. In the notes, the expectation is defined to be $$\mathbb{E}(X):=\sum_{a\in\mathscr{A}}a\mathrm{Pr}[X=a]\;.$$ where $\mathscr{A}$ is the range of values that $X$ can take on. Show that the two definitions are equivalent.
(b) Given a random variable $X$ defined on a sample space $\Omega$, $Y=X^2$ is also a random variable defined on $\Omega$. Why? (Hint: Look review [sic] the definition of a random variable)
(c) Show, from the definition of the expectation, that $$\mathbb{E}(X^2)=\sum_{a\in\mathscr{A}}a^2\operatorname{Pr}[X=a].$$ (You can start with the definition in class or the definition in the notes, since you have already shown in part (a) that they are equivalent.)
(d) Generalize the result in part (c) to give an expression for $\mathbb{E}(f(X))$, where $f$ is an arbitrary function from $\mathfrak{R}$ to $\mathfrak{R}$. You can give your answer without proof.
Thanks!