The Q appears as 36/37 depending upon the PM edition you have.
Visualize the problem like this: The person wants to invest Rs.4,000 out of Rs.8,000 in A this amounts to 0.5 of the total funds. You are now trying to create portfolio Z where you know only the weight of security A and that is 0.5.
WA WB WC
Portofolio X 0.30 0.40 0.30 (given)
Portofolio Y 0.20 0.50 0.30 (given)
Portofolio Z 0.50 ? ?
First we will try to find the weight of security B by taking the pairs of weights of WA & WB as minimum varinace combinations. A portfolio is a minimum variance set because of the covariance between the securities in the portfolio. From the two portfolios, X & Y, we observe that the two optimal mix combinations between security A & B are: (0.30 & 0.40) as well as (0.20 & 0.50). There must be other combinations of the mix which reduce varince but we don't know them yet like (0.50, ?). These two weights can be considered as two variables 'x' & 'y' and their combination pairs can be plotted on a graph to obtain a line which will have an equation. If we know the value of one then we can find the other using the equation of the line. Equation of a line is given by: y = mx + c. Where 'x' will be the weight of A and 'y' will be the weight of B. From the information given in the problem we see that in portfolio X the weight of B is 0.40 when the weight of A is 0.30, thus
0.40 = m(0.30) + c
Similarly, from portfolio Y
0.50 = m(0.20) + c
solving we have: m = -1 and c = 0.7
The equation of the line is thus y = -x + 0.7
If 0.5 is the weight of A we now can find the weight of B from the line of the equation.
y = -0.5 + 0.7 = 0.2
If 0.5 & 0.2 are the weights of A & B then obviously weight of C = 1 - (0.5 + 0.2) = 0.3