# Thread: Expected values and probability mass function.

1. ## Expected values and probability mass function.

Hi everyone. I am incredibly lost on this problem and I have no idea how to do it. It seems like it's easy, but I'm just not getting it. Any hints would be extremely helpful. Thanks!

Let X be a random variable taking values 0, 1 or 2. Suppose E[X] = m_1
and E[X^2] = m_2. Compute P [X = i] for i = 0; 1; 2.

(E is expected value; P is the probability function.)

Hi everyone. I am incredibly lost on this problem and I have no idea how to do it. It seems like it's easy, but I'm just not getting it. Any hints would be extremely helpful. Thanks!

Let X be a random variable taking values 0, 1 or 2. Suppose E[X] = m_1
and E[X^2] = m_2. Compute P [X = i] for i = 0; 1; 2.

(E is expected value; P is the probability function.)
write some simultaneous equations containing the information in the question:

$\displaystyle E(X) =m_1 = 0 \cdot P(X=0) + 1 \cdot P(X=1) + 2 \cdot P(X=2)$
$\displaystyle E(X^2) =m_2 = 0 \cdot P(X=0) + 1^2 \cdot P(X=1) + 2^2 \cdot P(X=2)$

ie,

$\displaystyle m_1 = P(X=1) + 2 \cdot P(X=2)$
$\displaystyle m_2 = P(X=1) + 4 \cdot P(X=2)$

Solve simultaneously to get P(X=1) and P(X=2). Finally, note that P(X=0) + P(X=1) + P(X=2) =1

Originally Posted by iamthemanyes
Let X be a random variable taking values 0, 1 or 2. Suppose E[X] = m_1 and E[X^2] = m_2. Compute P [X = i] for i = 0; 1; 2.
To shorten the notation let $\displaystyle p_i=\mathcal{P}(X=i),~i=0,1,2$

From the given $\displaystyle \mathcal{E}[X]=0\cdot p_0+1\cdot p_1+2\cdot p_2=m_1$
AND
$\displaystyle \mathcal{E}[X^2]=0^2\cdot p_0+1^2\cdot p_1+2^2\cdot p_2=m_2$.

Now you can solve for $\displaystyle p_1~\&~p_2$.

Then recall that $\displaystyle p_0+p_1+p_2=1.$