Originally Posted by

**Turloughmack** To clear things up. . . the problem is from maple.

It has to do with markowitz portfolio theory.

Ok Initially I have the risk and return from a given portfolio of 28 stocks.

I have defined both the return and the risk. Next I defined the covariance of the stocks also.

Next I defined some Lagrange multiplier where a and b are lambda1 and 2.

u:= j -> sum (x(i) s(i) s(j) - a - b f(i))

I then defined the next two Lagrange equations as

V:= sum(x(1)-1 = 0, i = 1 .. 28);

&

W:=sum(x(i)*f(i)-r(p) = 0, i = 1 .. 28)

Now this is where the problem starts. The result I get for v is

= x(2) + x(3) + x(4) + x(5) + x(6) + x(7) + x(8) + x(9) + x(10) + x(11) + x(12) + x(13) + x(14) + x(15) + x(16) + x(17) + x(18) + x(19) + x(20) + x(21) + x(22) + x(23) + x(24) + x(25) + x(26) + x(27) + x(28) - 27.997 = 0

and for w I got

= 0.004000000000 x(2) + 0.006000000000 x(3) - 0.006000000000 x(4) + 0.004000000000 x(5) + 0.001000000000 x(6 + 0.001000000000 x(7) + 0.004000000000 x(9) + 0.008000000000 x(10) + 0.006000000000 x(11)+ 0.01700000000 x(12) + 0.002000000000 x(13) + 0.01300000000 x(14) + 0.01200000000 x(15) + 0.006000000000 x(16) + 0.001000000000 x(17) + 0.002000000000 x(18) + 0.001000000000 x(19) + 0.01200000000 x(20) - 0.001000000000 x(21) + 0.004000000000 x(22) + 0.01700000000 x(23)+ 0.004000000000 x(24) + 0.009000000000 x(25) + 0.006000000000 x(26) + 0.01000000000 x(27) + 0.01600000000 x(28) - 0.1119910000 = 0.

The next thing I wanted to do is to solve for each x. I wanted to solve for each x because this then can help me evaluate a final equation so I can plot my efficient frontier.