Explore BrainMass
Share

# integer linear program

(See attached file for full problem description)

---
The following table is a list of all of the stocks that you have in your stock portfolio. The original purchase price, current price and your best guess for the "anticipated" price (one year into the future) is given below:
Share Price (\$)
Stock # Shares Owned Purchase Current Expected In One Year
1 234 20 30 36
2 272 25 34 39
3 106 30 43 42
4 452 35 47 45
5 486 40 49 51
6 359 45 53 55
7 345 50 60 63
8 419 55 62 64
9 255 60 64 66
10 264 65 66 70

Assume that the capital gains tax rate on long term profits is 20%. In addition, selling shares incurs a transaction cost of 1% of the sale proceeds.
Suppose that you need at least \$30,000 in cash today. As such, you must sell off some of your stocks.
Create an integer linear program that tells you how many shares of which stock to sell in order to get the cash you need such that the anticipated future portfolio value of the remaining stocks is maximized.
Let xi be the number of shares of stock I sell

MODEL:
! The objective;
[OBJECTIVE] MAX = (36-20)*(234-x1)+ (39-25)*(272-x2)+ (42-30)*(106-x3)+(45-35)*(452-x4)+ (51-40)*(486-x5)
+(55-45)*(359-x6)+(63-50)*(345-x7)+(64-55)*(419-x8)+ (66-60)*(255-x9)+ (70-65)*(264-x10);

!Constraints;
30*x1+34*x2+43*x3+47*x4+49*x5+53*x6+60*x7+62*x8+64*x9+66*x10
-0.21*(30*x1+34*x2+43*x3+47*x4+49*x5+53*x6+60*x7+62*x8+64*x9+66*x10)
>=30000;
x1<=234;
x2<=272;
x3<=106;
x4<=452;
x5<=486;
x6<=359;
x7<=345;
x8<=419;
x9<=255;
x10<=264;

@GIN (x1);
@GIN (x2);
@GIN (x3);
@GIN (x4);
@GIN (x5);
@GIN (x6);
@GIN (x7);
@GIN (x8);
@GIN (x9);
@GIN (x10);

END
---

#### Solution Preview

See attached

Let xi be the number of shares of stock I sell
The objective we want to maximize is the value of remaining stocks, therefore for stock i, its value = (number of stocks left) * (the difference between expected price and the purchase price). So we have the following objective:
(36-20)*(234-x1)+ (39-25)*(272-x2)+ (42-30)*(106-x3)+(45-35)*(452-x4)+ (51-40)*(486-x5)+(55-45)*(359-x6)+(63-50)*(345-x7)+(64-55)*(419-x8)+ (66-60)*(255-x9)+ (70-65)*(264-x10), which can be simplified as:
16 (234-x1)+ 14 (272-x2)+ 12 (106-x3)+ 10 (452-x4)+ 11 (486-x5)
+10 (359-x6)+13 (345-x7)+ 9 (419-x8)+ 6 (255-x9)+ 5 (264-x10), or by adding the constants ...

#### Solution Summary

The solution creates an integer linear program from a general linear model.

\$2.19