Question: Suppose that X is a random variable with possible values 0,1 and 2. Find a formula for P(X = k) in terms of EX
and E(X^2
) for k = 0,1,2

Note: E(X) refers to the expected value of a random variable

Do I start with the definition of expected values?

Thanks:)

Answer: 
For any point $(x,y)$, consider the transformation:
$$
f(x,y)=\left(0.25+\dfrac{0.5}{\sqrt{x^2+y^2}}\right)(x,y)
$$

Notice that the distance from this new point to the origin is:
$$
\left(0.25+\dfrac{0.5}{\sqrt{x^2+y^2}}\right)\sqrt{x^2+y^2}=0.25\sqrt{x^2+y^2}+0.5
$$

Hence, since $0 \leq \sqrt{x^2+y^2} \leq 1$, it follows that $0 \leq 0.25\sqrt{x^2+y^2} \leq 0.25$ which implies that $0.5 \leq 0.25\sqrt{x^2+y^2}+0.5 \leq 0.75$. Indeed, observe that this mapping yields:

$$(1,0) \to \left(0.25+\dfrac{0.5}{\sqrt{1^2+0^2}}\right)(1.0)=0.75(1,0)=(0.75,0) \\$$
as well as
$$ \begin{align\*}
(0.1, -0.1) \to \left(0.25+\dfrac{0.5}{\sqrt{0.1^2+(-0.1)^2}}\right)(0.1, -0.1) &=\left(\dfrac14+\dfrac5{\sqrt2} \right)(0.1, -0.1) \\
&\approx(0.37855,-0.37855) \\
\end{align\*} $$
Hint: If we write $x = r \cos \theta$ and $y = r \sin \theta$, we have that $x^2 + y^2 = r^2$. Can you scale $x$ and $y$ by something to make $0.5^2 \leq x^2 + y^2 \leq 0.75^2$?