2
$\begingroup$

So here is a HW problem I was assigned:

*Thriftem Bank is in the process of devising a loan policy that involves a maximum of $12 million. The following table provides the pertinent data about the available types of loans.

Type of Loan/Interest Rate/Bad-Debt Ratio

Personal/0.14/0.1

Car/0.13/0.07

Home/0.12/0.03

Farm/0.125/0.05

Commercial/0.1/0.02

Bad debts are unrecoverable and produce no interest revenue.

Competition with other financial institutions requires that the bank allocate at least 40% of the funds to farm and commercial loans. To assist the housing industry in the region, home loans must equal at least 50% of the personal, car, and home loans. The bank also has a stated policy of not allowing the overall ratio of bad debts on all loans to exceed 4%.*

Now, I can solve it with the command Maximize

(*Constraints*)

constraints = {farm + commercial >= 
 0.4 (personal + auto + farm + commercial + home) &&
home >= personal + auto &&
0.1 personal + 0.07 auto + 0.03 home + 0.05 farm + 
  0.02 commercial <= 
 0.04 (personal + auto + farm + commercial + home) &&
personal + auto + home + farm + commercial <= 12 &&
personal >= 0 &&
home >= 0 &&
auto >= 0 &&
farm >= 0 &&
commercial >= 0};

(*Objective function*)

loanPolicy = 
 Simplify[0.14*0.9 personal + 0.13*0.93 auto + 0.12*0.97 home + 
0.125*0.95 farm + 
0.1*0.98 commercial - (0.1 personal + 0.07 auto + 0.03 home + 
0.05 farm + 0.02 commercial)];

(*Optimal loan strategy*)

Maximize[{loanPolicy, constraints},
 {auto, commercial, farm, home, personal}]

And my output is

{0.99648, {auto -> 0., commercial -> 4.8, farm -> 0., home -> 7.2, 
personal -> 0.}}

But I want to use the command LinearProgramming, but I can't seem to get the hang of it. Here's what I wrote

LinearProgramming[{0.0509, 0.078, 0.06875, 0.0864, 0.026},
 {{1, 1, 1, 1, 1}, {0.07, 0.02, 0.05, 0.03, 0.1}, {-1, 0, 0, 
   1, -1}, {0, 1, 1, 0, 0}},
 {12, 0.48, 0, -4.8}]

^I know the above command finds a vector that minimizes the objective function, but I'm trying to find a vector that will maximize it and I don't how to go about doing so. I tried flipping the values in front of the coefficients but that didn't work. Any ideas?

$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – user9660 Nov 20 '14 at 3:57
2
$\begingroup$

I haven't checked if your solution is the right solution for the problem, but this is the linear programming equivalent of your program:

LinearProgramming[-{0.0509, 0.078, 0.06875, 0.0864, 0.026}, 
                  {{-.4, .6, .6, -.4, -.4},      {-1, 0, 0, 1, -1}, 
                   {-.03, .02, -.01, .01, -.06}, {-1, -1, -1, -1, -1}},
                  {0, 0, 0, -12}]

(*
 {0., 4.8, 0., 7.2, 0.}
*)

I've derived the coefficients by doing:

clist = Flatten[List @@@ constraints] /. a__ <= b__ :> b >= a /. a__ >= b__ :> a - b >= 0;
clist1 = clist[[All, 1]] // Expand;
CoefficientArrays[clist1[[;; -6]]] // Normal
(*
{{0., 0., 0., 12.},
{{-0.4, 0.6, 0.6, -0.4, -0.4},     {-1., 0, 0, 1., -1.}, 
{-0.03, 0.02, -0.01, 0.01, -0.06}, {-1., -1., -1., -1., -1.}}}
*)
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.