# Thread: How do I change . . . .

1. ## How do I change . . . .

How do I change this equation with 28 variables

W:= 0.003000000000 x(1) + 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.1120000000 = 0.

to either an equation with only 1 variable or to a 28 separate equations?

2. Well, guess you could multiply this halloween thing by 1000 to get a more manageable:
W = 3x(1) + 4x(2) + 6x(3) - 6x(4) + 4x(5) + 1x(6) + 1x(7) + 4x(9) + 8x(10) + 6x(11)
+ 17x(12) + 2x(13) + 13x(14) + 12x(15) + 6x(16) + 1x(17) + 2x(18) + 1x(19) + 12x(20)
- 1x(21) + 4x(22) + 17x(23) + 4x(24) + 9x(25) + 6x(26) + 10x(27) + 16x(28) - 112 = 0

...and then send it to the Editor of Guiness World Records!

Btw, if the last term was 162 instead of 112, then all 28 variables could each equal 1.

QUESTIONS:
1: are you joking?
2: if not, where does this come from?
3: why all the meaningless zeroes?

3. Originally Posted by Turloughmack
How do I change this equation with 28 variables

W:= 0.003000000000 x(1) + 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.1120000000 = 0.

to either an equation with only 1 variable or to a 28 separate equations?
You have posted a single equation with 28 variables in it. Without further relevant information, there is no way to answer your question. (The equation looks like computer output that you have not given much thought to)

4. 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.

5. 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.
First your notation is obscure (read: incomprehensible given the amount of effort a helper on MHF is likely to devote to it). Secondly you should have 30 equations in your 28 variables and two multipliers, and where did V and W come form (for that matter you could try explaining the what the other symbols are).

CB