Given a random variable $X$, satifying $P(0\leq X \leq 1)=1$, and $\mathsf{E}[X^2] = \alpha$. We know its maximum variance $\text{Var}(X) = \alpha(1-\alpha)$ achived by a binary random variable $P(X =x) = \begin{cases} &1-\alpha, &x=0 \\ &\alpha, &x=1 \end{cases}$.


Now my problem is given a random vector $\boldsymbol{X}$, and $\text{supp}\boldsymbol{X} = [0,1]^n$, and $\mathsf{E}\boldsymbol{X}={\boldsymbol{\alpha}}$. After a linear transformation $\boldsymbol{H} (\boldsymbol{H} \succ \boldsymbol{0})$, I want to know whether the maximum trace of the covaraince matrix $\text{cov}(\boldsymbol{H}\boldsymbol{X})=\mathsf{E}[(\boldsymbol{H}\boldsymbol{X}-\mathsf{E}[\boldsymbol{H}\boldsymbol{X}])(\boldsymbol{H}\boldsymbol{X}-\mathsf{E}[\boldsymbol{H}\boldsymbol{X})^\text{T}]$ can be achived by a discrete random vector whose support $\text{supp}\boldsymbol{X}=\{0,1\}^n$.


The trace can be expanded as $\text{tr}(\text{cov}(\boldsymbol{H}\boldsymbol{X}))=\sum\_{k=1}^{n} h\_{i,k}^2 \mathsf{E}{\bigl(X\_k-\mathsf{E}{X\_k}\bigr)^2} 
 + \sum\_{k=1}^{n} \sum\_{\substack{\ell=1\\\ell\neq k}}^{n}
 2h\_{i,k} h\_{i,\ell} \bigl( \mathsf{E}{X\_{k} X\_{\ell}} -
 \mathsf{E}{X\_{k}}\mathsf{E}{X\_{\ell}}\bigr)$. If we use the similar method as in the random variable case, we can maximize the first term of RHS of above equation, be the change of second term of RHS cannot be determined.



The maximum trace of a covariance can be achieved by a discrete random vector?
The answer is yes. Indeed, let $X:=\boldsymbol{X}$, $H:=\boldsymbol{H}$, and $a:=\boldsymbol{\alpha}$. By approximation and compactness, without loss of generality (wlog), the matrix $H$ is nonsingular, so that the trace in question is
$$\sum\_{i=1}^n Var\,l\_i (X),$$
where the $l\_i$'s are linearly independent linear functionals determined by the matrix $H$. By compactness, the maximum of this trace over all random vectors $X$ with mean $EX=a$ and $P(X\in[0,1]^n)=1$ is attained at some maximizing $X$. In what follows, let $X$ be such a maximizer.


To obtain a contradiction, suppose that there is some point $x\in S\_X\cap[0,1]^n\setminus\{0,1\}^n$, where $S\_X$ is the support of the distribution $\mu\_X$ of the random vector $X$. Then (i) $\{x-h,x+h\}\subset[0,1]^n$ for some nonzero vector $h$ and (ii) $\mu\_X(U\_x)>0$ for some set $U\_x$ relatively open in $[0,1]^n$ and such that $x\in U\_x$. Wlog, the length of the vector $h$ and the diameter of the set $U\_x$ are small enough so that $U\_{x-h}\cup U\_{x+h}\subseteq[0,1]^n$.
Moving now half of the mass $\mu\_X(U\_x)$ by the parallel translation by vector $h$ and moving the remaining half of the mass $\mu\_X(U\_x)$ by the parallel translation by vector $-h$, we obtain a new probability distribution of some random vector $Y$ with values in $[0,1]^n$ such that $EY=a=EX$ and $Var\,l\_i (Y)\ge Var\,l\_i (X)$ for **all** $i$, with at least one of these inequalities being strict (namely, strict for all $i$ with $l\_i(h)\ne0$). This contradicts the assumption that $X$ is a maximizer. $\quad\Box$


