This can for example be seen in modern portfolio theory (Harry Markowitz, William Sharpe)
As an example consider a two asset portfolio with a full investment constraint ($w_1+w_2=1$) so we can write the proportion in asset 1 as $w_1=w$ and in asset 2 as $1-w$
The expected portfolio return $E[R_p]=wE[R_1]+(1-w)E[R_2]$
And variance $\sigma_p^2 = w^2\sigma_1^2+(1-w)^2\sigma_2^2+2w(1-w)\rho_{12}\sigma_1 \sigma_2$
Where $\sigma_i$ is asset $i$'s standard deviation and $\rho_{12}$ is the correlation between the two.
If the investor tries to optimize a mean variance tradeoff, where the variance is interpreted as risk. For example where there could be some risk preference parameter included if desired other than the $\frac{1}{2}$ which is included for convinience:
$\min_w L(w) = \min_w (\frac{1}{2}\sigma_p^2 - E[R_p])$
Taking first order conditions by $dL(w)/dw=0$ gives
$\frac{1}{2}\bigl(2w\sigma_1^2+2(w-1)\sigma_2^2+2(1-2w)\rho_{12}\sigma_1 \sigma_2\bigr) - \bigl(E[R_1]-E[R_2]\bigr)=0$
$w(\sigma_1^2+\sigma_2^2-2\rho_{12}\sigma_1 \sigma_2 )-\sigma_2^2+\rho_{12}\sigma_1 \sigma_2 - \bigl(E[R_1]-E[R_2]\bigr)=0$
$w = \frac{E[R_1]-E[R_2]+\sigma_2^2-\rho_{12}\sigma_1 \sigma_2 }{\sigma_1^2+\sigma_2^2-2\rho_{12}\sigma_1 \sigma_2}$
The minimum variance portfolio is found by $\min_w(\frac{1}{2}\sigma_p^2)$ and has first asset weight $w^*$:
$w^* = \frac{\sigma_2^2-\rho_{12}\sigma_1 \sigma_2 }{\sigma_1^2+\sigma_2^2-2\rho_{12}\sigma_1 \sigma_2}$
Now calculating the minimum variance portfolio weight for a couple of cases:
s1=0.1;s2=0.1;rho=-1;print s1, s2, rho, (s2**2-rho*s1*s2)/(s1**2+s2**2-2*rho*s1*s2)
So you can see the minimum variance portfolio weights.
s1 s2 rho w*
0.1 0.1 -1 0.5 // equal risk, perfect negative corr -> equal weight
0.2 0.1 -1 0.333 // asset 1 riskier -> lower weight
0.2 0.1 0 0.2 // asset 1 riskier and no hedge -> even lower weight
0.2 0.1 0.2 0.142 // asset 1 riskier and positive corr -> STILL POSITIVE W ! (no negative correlation required for a hedge!)
0.2 0.1 0.5 0.0 // asset 1 riskier and higher pos corr -> everything in asset 2
0.2 0.1 0.8 -0.33 // asset 1 riskier and high corr -> short asset 1
0.2 0.1 1 -1.0 // asset 1 riskier and perfect corr -> fully short ass 1
for example the case $\sigma_1=0.2,\sigma_2=0.1,\rho_{12}=0.2,w^*=0.142$ gives portfolio variance:
w**2*s1**2+(1-w)**2*s2**2+2*w*(1-w)*rho*s1*s2
$\sigma_p^2 = 0.91\%$ which is less than both individual asset variances $\sigma_1^2 = 4\%$ and $\sigma_2^2 = 1\%$ .