What is the smallest and largest possible values for the variance? Suppose
$P( X \in \{1,2,3\}) = 1$ and  $E(X) =2.5.$

What is the smallest and largest possible values for the variance?

My understand: So what I understand is variance finds the distance between each element and the mean. So the closer 2 is to E(X) the farther 1 and 3 can be from E(X). But I have no clue how to obtain this..

Although the two things are equal, I think it is easier to use $$\operatorname{Var}(X) = \mathbb{E}\Big[(X-\mathbb{E}X)^2\Big]$$
rather than $\operatorname{Var}(X)=\mathbb{E}X^2-(\mathbb{E}X)^2$.
Let $\mathbb{P}[X=i]=p_i$, then
\begin{align}
\operatorname{Var}(X) &= \mathbb{E}\Big[(X-\mathbb{E}X)^2\Big] \\
 &= \sum_{i \in \{1,2,3\}}(i-2.5)^2 \cdot p_i \\
 &= (-1.5)^2\cdot p_1 + (-0.5)^2 \cdot p_2 + (0.5)^2 p_3 \\
 &= 2.25\cdot p_1 + 0.25\cdot p_2 + 0.25\cdot p_3. \tag{$\spadesuit$}
\end{align}
Maximizing and minimizing this under constraints $p_1+p_2+p_3=1$ and $1\cdot p_1 + 2\cdot p_2 + 3\cdot p_3 = 2.5$ is simple, because the weights of $p_2$ and $p_3$ are equal and these are both $0.5$ away from the mean:


*

*To minimize variance move all the probability mass away from $p_1$ –distribute everything between $p_2$ and $p_3$ in a way that gives you the correct expected value.

*To maximize variance move the probability mass as much as possible to $p_1$. To achieve the correct expected value you have to have some counterbalance in $p_3$, but $p_2$ should be equal to zero.


Taking into account the two bullet points, the formula marked by $(\spadesuit)$ has a nice intuition: to minimize variance, move the probability mass as much as possible in the direction of the mean. To maximize the variance do the opposite – move the probability mass away from the mean.
I hope this helps $\ddot\smile$
