# Why does the expectancy of a discrete random variable depend only on its distribution and not the r.v. directly?

In some lecture notes that I have on discrete probability, after defining expectancy, it says "the expectancy doesn't depend on the random variable directly; it depends only on its distribution", where with "distribution" the function $$W:X(\Omega) \rightarrow \mathbb{R},\ W(x)=P(X=x),$$ $X:\Omega \rightarrow \mathbb{R}$ being our random variable.

As an explanation for the above, the following line is given: $$\mathbb{E}X=\sum_{x\in X(\Omega) } x \cdot W(x)=\sum_{\omega \in \Omega} X(\omega) P(\omega).$$

Now I understand why the above holds, but I don't understand why this line entitles one to say that expectancy depends only on the distribution of a random variable. If I would change my random variable $X$ to $X'$, so that $X(\omega')\neq X'(\omega')$, for some $\omega'\in \Omega$, than by the above line, of course $\mathbb{E}X \neq \mathbb{E}X'$ .

For a better understand: Could someone provide me with an example of two different r.v.'s having the same distribution ?

-
Why don't you expand what r.d. stands for ? I, for one, have no idea what it is. –  Sasha Apr 18 '12 at 18:37
(In my answer I assume that "r.d." is a typo for "r.v." and stands for "random variable"). –  Henning Makholm Apr 18 '12 at 18:38
Yes, it was a typo, sorry –  user26698 Apr 18 '12 at 19:06

For example, let the experiment be to roll two fair 6-sided dice of different colors, and the $X$ be the random variable that gives the result of the red die and $Y$ be the random variable that gives the result of the green die.

Then $X$ and $Y$ are different random variables because they map $\Omega$ to $\{1,2,3,4,5,6\}$ in two different ways. However their distribution is the same, because for every $x\in \mathbb R$ it holds that $P(X=x)=P(Y=x)$, and therefore $\mathbb EX = \mathbb EY$.

More variable with the same distribution, but different from each other as well as from $X$ and $Y$, are $7-X$ and $((X+Y)\bmod 6) + 1$.

-
I'd venture to say that if the distribution of to r.v.'s is same, they are the same. –  nbubis Apr 18 '12 at 18:53
@nubis: But if the random variables $X$ and $Y$ were the same, then the event $X=Y$ would be the same as $X=X$, which occurs with probability $1$. And it clearly isn't. –  Henning Makholm Apr 18 '12 at 18:57
I disagree. The random variable $X$ is not the same as the value obtained for a specif instance. Thus, $P(X=a,Y=a)=P(X=a,X=a)$ –  nbubis Apr 18 '12 at 23:30
@nbubis: You disagree that if two things "are the same", then one can be replaced by the other in an expression without changing the result? –  Henning Makholm Apr 19 '12 at 10:39
@nbubis: What you're "just trying to stress" is wrong. A random variables is not the same as its distribution, because it is not valid to replace one random variable in an expression with a different random variable of the same distribution. Things that cannot be exchanged with each other are not the same! (Otherwise, you are using "the same" in a really, confusingly nonstandard way). –  Henning Makholm Apr 19 '12 at 11:14
show 1 more comment
1. The reason that expectation is a distributional property follows simply from the definition of expectation. Let $X$ and $Y$ be integrable extended real valued random variables on a probability space $(\Omega,\mathfrak{F},P)$ and let $X(P)$ and $Y(P)$ denote their distributions on $(\overline{\mathbf{R}},\mathfrak{B}_{\overline{\mathbf{R}}})$ respectively. Now if $X$ and $Y$ have the same distribution, then $X(P)=Y(P)$ and $$\mathbf{E}(X)=\int X(\omega)\,\mathrm{d}P(\omega)=\int x\,\mathrm{d}X(P)(x)=\int y\,\mathrm{d}Y(P)(y)=\int Y(\omega)\,\mathrm{d}P(\omega)=\mathbf{E}(Y).$$ So, knowing only the distribution of a random variable we can identify the expectation.

2. For a particularly nice example of two random variables which are not equal but have the same distributions, consider if $(\Omega,\mathfrak{F},P)=([0,1],\mathfrak{B}_{[0,1]},m_L)$. Let $X$ and $Y$ be positive real valued random variables on $(\Omega,\mathfrak{F},P)$ into the measurable space $([0,1],\mathfrak{B}_{[0,1]})$ given by \begin{align}X(\omega)&=\omega&\text{for every }\omega\in\Omega,\\ Y(\omega)&=1-\omega &\text{for every }\omega\in\Omega.\end{align} Then $X\neq Y$. To show that $X(P)$ and $Y(P)$ are equal, let $E\in\{[a,b)\colon a,b\in[0,1], a<b\}$ be given. To prove the result, we want to show that $X(P)(E)=Y(P)(E)$. Note that \begin{align}X^{-1}(E)&=\{\omega\in\Omega\colon X(\omega)\in E\}=\{\omega\in[0,1]\colon \omega\in[a,b)\}=[a,b),\\ Y^{-1}(E)&=\{\omega\in\Omega\colon Y(\omega)\in E\}=\{\omega\in[0,1]\colon 1-\omega\in[a,b)\}=[1-b,1-a). \end{align} Thus we have $$X(P)(E)=P(X^{-1}(E))=m_L([a,b))=b-a=m_L([1-b,1-a))=P(Y^{-1}(E))=Y(P)(E)$$ Since $X(P)$ and $Y(P)$ are equal on $\{[a,b)\colon a,b\in[0,1], a<b\}$, they are also equal on $\sigma\{[a,b)\colon a,b\in[0,1], a<b\}=\mathfrak{B}_{[0,1]}$, which is the desired result.

-