Recall from Probability Theory that
Variance (aX + bY) = a^2 Var(X) + b^2 Var(Y) + 2*a*b*Cov(X,Y)
In this type of problem, X is the return of a risky portfolio, Y is the return on risk-free securities, and a, and b are the percentages invested in them.
If we let
R = expected return of the risky portfolio,
r_f = expected return of the risk-free security
x = percent of your funds invested in the portfolio, with the remaining funds invested in the risk-free securities.
note: I’m calling x what S2000magician is calling 1-w
Then the variance of this
Variance (xR + (1-x)r_f) = x^2Var(R) + (1-x)^2Var(Rf) + 2x(1-x)Cov(R, Rf)
Now, because risk-free securities have no risk, its variance is zero, which means the last two terms drops out. This means:
Variance (xR + (1-x)r_f) = x^2Var(R)
or Volatility(xR + (1-x)r_f) = x*Volatility(R)
The left hand side is the resulting volatility of the portfolio with x percent invested in risky portfolio.
This problem gives Volatility® = .18
and is asking for (1-x) such that Volatility(xR + (1-x)r_f) is .14 or .23.
All you have to do is solve for x.
For example, to get a volatility of .14:
.14 = x*.18
thus x = 14/18. therefore you need to invest 1-x = 4/18 of your funds in risk-free securities.
If you try to solve .23 = x*.18, you will find that 1-x is negative. This means that you have to borrow funds to achieve the desired volatility.
on a side note, maybe I’m still half-awake, but the 1st line in @s2000magician’s derivation doesn’t seem quite right. It just happens to give the correct result because the risk-free has zero volatility.