From her experience, she can tell how much fixing up each room
Is important to her clients by listening to what they say. She
knows that for her current client, opening up the main floor is
really important and it has a coefficient of 50 happy point per
dollar spent in that room. Fixing the kitchen gets 30 happy points
per dollar spent. Bathroom 1 has 20 happy points per dollar spent
and Bathroom 2 has 12 happy points per dollar spent. She is given a
budget of $70,000 to fix up the house. If she spends all the money
on fixing up those 4 rooms, and decides she has to spend a minimum
of $6,000 on each bathroom, $12,000 on the kitchen and $18,000 to
open up the first floor:
Suppose that the contractor finds a major structural issue and it is going to cost $30,000 to fix. This money comes from her budget. Now that her budget is $30,000 less than before:
Bathroom 1= |
Bathroom 2 = |
Kitchen = |
Open Up = |
Happy Points = |
Bathroom 1=6000 |
Bathroom 2 =6000 |
Kitchen =10000 |
Open Up =18000 |
Happy Points =1392000 |
First save the data matrix in excel in this form:
Then use R or R-Studio.
Here is the code for R-Studio:
d=read.csv(file.choose(),header = F)
d
m=length(d[,1])
n=length(d[1,])
constr.coeff=data.matrix(d[-m,-c(n,n-1)])
constr.coeff
constr.sign=d[-m,n-1]
constr.sign
constr=d[-m,n]
constr
obj=c(d[m,-c(n,n-1)])
obj
opt=lpSolve::lp("max",obj,constr.coeff,constr.sign,constr)
opt$objval
opt$solution
Get Answers For Free
Most questions answered within 1 hours.