4. Given the equation in terms of $x$
$$
x^{2}+k x+\frac{3}{4} k^{2}-3 k+\frac{9}{3}=0 \quad (k \text { is a real number })
$$

the two real roots are $x_{1}$ and $x_{2}$. Then the value of $\frac{x_{1}^{2011}}{x_{2}^{2012}}$ is
$\qquad$
4. $-\frac{2}{3}$.

According to the problem, we have $\Delta=k^{2}-4\left(\frac{3}{4} k^{2}-3 k+\frac{9}{2}\right) \geqslant 0$. Thus, $(k-3)^{2} \leqslant 0$.
Also, $(k-3)^{2} \geqslant 0$, so $(k-3)^{2}=0$.
Solving this, we get $k=3$.
At this point, the equation becomes $x^{2}+3 x+\frac{9}{4}=0$.
Solving this, we get $x_{1}=x_{2}=-\frac{3}{2}$.
Therefore, $\frac{x_{1}^{2011}}{x_{2}^{2012}}=\frac{1}{x_{2}}=-\frac{2}{3}$.