# The Expectation of Probability Mass Function

Suppose we have a finite set $\sf{X}$ over which a probability mass function can be defined as the positive real numbers $P(x)$ for $x \in \sf{X}$ such that $\sum\nolimits_{x\in \sf{X}} P(x) =1$.

I would like to know that how can we interpret the quantity:

$\sum\limits_{x \in \sf{X}} P(x) \cdot P(x)$;

or if we define a random variable $X$ taking values in $\sf{X}$, how do we interpret the quantity $P(X)$ so that the above formula becomes

$\mathbb{E}\left(P(X)\right)$,

where $\mathbb{E}$ is the expectation.

Intuitively, at least in the discrete cases, the random variable $X$ is a function of some underlying outcome some experiment. So $P(X)$ is a function of a function of (composite function of) those outcomes. Thus $P(X)$ can also be regarded as a random variable.

So I am not sure about the notion of $P(X)$ or $\mathbb{E}\left(P(X)\right)$. Can anyone help me?

-

For every function $G$, $\mathbb E(G(X))=\sum\limits_xG(x)P(x)$ hence, indeed, $\sum\limits_xP(x)^2=\mathbb E(P(X))$. Note that $\sum\limits_xP(x)^2$ is also $\mathbb P(X=X')$ where $X$ and $X'$ are two independent random variables with distribution $P$, that is, such that $\mathbb P(X=x,X'=x')=P(x)P(x')$ for every $x$ and $x'$.
Thanks very much @Did. $P(x) = \textbf{Pr}\{X=x\} = \textbf{Pr}\{\omega: X(\omega)=x\}$. But why do we need the notion of $P(X)$ which seems to be a strange random variable? – Richie Feb 16 '13 at 10:25
Well, this is what I tried to explain by first recalling the general formula for $\mathbb E(G(X))$. Looking at this formula it is clear that the choice $G=P$ guarantees that $\mathbb E(G(X))$ equals $\sum\limits_xP(x)^2$. – Did Feb 16 '13 at 10:58