0% found this document useful (0 votes)
3 views

Solutions

The document contains solutions to various exercises from ORF 307 HW3, covering topics such as linear programming, duality, and the simplex method. It includes detailed explanations and mathematical formulations for each exercise, demonstrating the application of optimization techniques. Additionally, it presents AMPL code for risk minimization problems with corresponding results for different asset categories.

Uploaded by

colin1898.mitbbs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Solutions

The document contains solutions to various exercises from ORF 307 HW3, covering topics such as linear programming, duality, and the simplex method. It includes detailed explanations and mathematical formulations for each exercise, demonstrating the application of optimization techniques. Additionally, it presents AMPL code for risk minimization problems with corresponding results for different asset categories.

Uploaded by

colin1898.mitbbs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Solutions to ORF 307 HW3

Haotian Pang

Spring 2016

Exercise 2.15
You can use the pivot tool to see that from this dictionary, it cannot get to the dictionary
in which the x1 and x2 are non-basic variables. Hence w1 and w2 cannot be initial slack
variables.
To prove it rigorously, there are two arguments you can use:
1. Note that w1 cannot be expressed as a linear combination of x1 and x2 alone, hence x1
and x2 cannot be non-basic variables for any dictionary;
2. In this optimal solution, write the first constraint as x1 = 3 + w1 + 2x2 . Note you can
let w1 enter and x1 leave, and the resulting dictionary has x1 and x2 as non-basic variables.
Now let  approach 0, the coefficients blow up to infinity. Hence such dictionary does not
exist.

Exercise 4.3
The problem is given by

Largest coefficient rule has three pivots in this case:

1
Smallest index rule has two pivots in this case:

2
Exercise 4.3

3
4
Exercise 4.10
Since in the optimal dictionary, there are k nonbasic variables that are original slack variables,
hence the optimal solutions cannot be arrived in less than k pivots. Now we need to prove
that the optimal solution can be arrived in exactly k pivots. We know that there are k x
variables that are basic in the optimal solution. It suffices to prove that in each pivot, we can
let one w variable leave and one x variable enter. As we can ignore feasibility preservation,
the only problem that keeps us from doing this is when the pivot coefficient is zero. We
look at the problem backwards: from the optimal dictionary, we want to show that we can
get back to the initial dictionary in exactly k pivots. Suppose we are at optimal dictionary.
There must exist a non-zero coefficient for w1 , ... ,wk so that we can perform a valid pivot,

5
otherwise we cannot got back to the initial dictionary, by the same argument as Q2.15. We
let one of w1 , ..., wk to enter, and now we have k − 1 nonbasic slack variables. We repeat
the process until all slack variables are basic. This can be done in exactly k pivots.

Exercise 5.1
There are 4 variables and 3 constraints in the primal, so there will be 3 variables and 4
constraints in the dual. Table 5.1 tells that an equality constraint corresponds to a free
variables and an inequality constraint corresponds to a nonnegative variable. Therefore y3
is free and y1 and y2 are nonnegative. x1 and x4 are free variables so that means the first
and the fourth constraints will be equality and the other two will be inequality. Now it is
easy to write down the dual as:

min 3y2 + y3
−y1 + 4y2 −y3 = 1
−2y1 + 3y2 −y3 ≥−2
y1 + 4y2 +2y3 ≥ 0
−y1 − 2y2 +y3 = 0
y1 ≥ 0
y2 ≥ 0

Exercise 5.2
The primal problem is

max 2x1 + 3x2 +4x3


2x2 +3x3 ≤5
x1 + x2 +2x3 ≤4
x1 + 2x2 +3x3 ≤7
x1 ≥ 0
x2 ≥ 0.

6
The optimal solution is found to be x1 = 0, x2 = 3.5 and x3 = 0. The dual problem is

min 5y1 + 4y2 +7y3


y2 +y3 ≥2
2y1 + y2 +2y3 ≥3
3y1 + 2y2 +3y3 ≥4
y1 ≥ 0
y2 ≥ 0
y3 ≥ 0.

The optimal solution is found to be y1 = 0, y2 = 0 and y3 = 1.5. We clearly have cT x∗ =


bT y ∗ = 10.5, and this illustrates Theorem 5.2.

Exercise 5.5
(a)

min 6y1 + 1.5y2 +4y3


2y1 − 2y2 +3y3 ≥ 2
3y1 + 4y2 +2y3 ≥ 8
+ 3y2 −2y3 ≥−1
6y1 −4y3 ≥−2
y1 ≥ 0
y2 ≥ 0
y3 ≥ 0

(b) Nonbasics: w1 . x2 , w3 and x4 . Basics: x1 , w2 and x3 .


(c) x1 = 3, w2 = 0 x3 = 2.5, w1 = 0. x2 = 0, w3 = 0 and x4 = 0. It is feasible and it is
degenerate.

7
(d)

ξ = −3.5 − 3z1 − 2.5z3


y1 = 0.25 + 0.5z1 −1.25y2 + 0.75z3
z2 =−6.25 + 1.5z1 +3.25y2 + 1.25z3
y3 = 0.5 +1.5y2 − 0.5z3
z4 = 1.5 + 3z1 −13.5y2 + 6.5z3

(e) No, it is not dual feasible.


(f) Yes, Simplex method always satisfies complementary slackness.
(g) No, there are positive coefficient on the objective, you can pivot a few more steps. The
optimal objective values is 8.73.
(h) x2 will enter and w2 will leave. The pivot will be degenerate.

AMPL Expercise
a) Since we want to minimize the risk subject to a lower bound on reward, the problem
becomes:
T
1X
min yt
T t=1
X
−yt ≤ xj (Rj (t) − rewardj ) ≤ yt
j
T
1 XX
xj Rj (t) ≥ µ
T t=1 j
X
xj = 1
j

xj ≥ 0.
We have the AMPL code as the following:

reset;
set A; # asset categories
set T; # dates
param n := card(T);

8
param reward;

param R {T,A};
param mean {j in A} := ( sum{i in T} R[i,j] )/n;
param Rtilde {i in T, j in A} := R[i,j] - mean[j];
var x{A} >=0;
var y{T} >= 0;
minimize risk: sum{i in T} y[i];
s.t. reward_bound: sum{j in A} mean[j]*x[j] >= reward;
s.t. tot_mass: sum{j in A} x[j] = 1;
s.t. y_lo_bnd {i in T}: -y[i] <= sum{j in A} Rtilde[i,j]*x[j];
s.t. y_up_bnd {i in T}: sum{j in A} Rtilde[i,j]*x[j] <= y[i];

data;
set A := HairProducts Cosmetics Cash;
set T := 2007-01 2007-02 2007-03 2007-04;
param R: HairProducts Cosmetics Cash:=
2007-01 0.5 2.0 1.0
2007-02 2.0 0.5 1.0
2007-03 2.0 2.0 1.0
2007-04 1.0 2.0 1.0;

let reward := 1.4;


solve;
printf {j in A: x[j] > 0.001}: "%45s %6.3f \n", j, x[j];
printf: "Reward: %10.7f\n",
sum{j in A} mean[j]*x[j];
printf: "Risk: %10.5f\n",
sum{i in T} abs(sum{j in A} Rtilde[i,j]*x[j]) / n;

The result is
HairProducts 0.400
Cosmetics 0.400
Cash 0.200
Reward: 1.4000000
Risk: 0.20000.

9
b) We change the mean-absolute-deviation back into mean-square-deviation and got the
following problem:
T
1XX
min ( xj (Rj (t) − rewardj ))2
T t=1 j
T
1 XX
xj Rj (t) ≥ µ
T t=1 j
X
xj = 1
j

xj ≥ 0.
reset;
set A; # asset categories
set T; # dates
param n := card(T);
param reward;

param R {T,A};
param mean {j in A} := ( sum{i in T} R[i,j] )/n;
param Rtilde {i in T, j in A} := R[i,j] - mean[j];
var x{A} >=0;
var y{T} >= 0;
minimize risk: sum{i in T} (sum{j in A} Rtilde[i,j]*x[j])^2;
s.t. reward_bound: sum{j in A} mean[j]*x[j] >= reward;
s.t. tot_mass: sum{j in A} x[j] = 1;

data;
set A := HairProducts Cosmetics Cash;
set T := 2007-01 2007-02 2007-03 2007-04;
param R: HairProducts Cosmetics Cash:=
2007-01 0.5 2.0 1.0
2007-02 2.0 0.5 1.0
2007-03 2.0 2.0 1.0
2007-04 1.0 2.0 1.0;

let reward := 1.4;

10
solve;
printf {j in A: x[j] > 0.001}: "%45s %6.3f \n", j, x[j];
printf: "Reward: %10.7f\n",
sum{j in A} mean[j]*x[j];
printf: "Risk: %10.5f\n",
sum{i in T} y[i]/n;

The result is
HairProducts 0.365
Cosmetics 0.421
Cash 0.214
Reward: 1.4000000
Risk: 0.05895.

11

You might also like