320头牛和20头羊一起,20天吃了20吨草,依此速度,50头牛和50头羊50天吃多少草?
这是来自csdn论坛的一个问题,索性放在这里了
分析:这是一个典型的线性规划问题,可以用工具求解:
设每头牛每天吃X1吨,每头羊每天吃X2吨,
lindo表达式
max 2500X1+2500X2
st
320X1+20X2=1
X1>=0
X2>=0
end
计算结果:
LP OPTIMUM FOUND AT STEP 0
OBJECTIVE FUNCTION VALUE
1) 125.0000
VARIABLE VALUE REDUCED COST
X1 0.000000 37500.000000
X2 0.050000 0.000000
ROW SLACK OR SURPLUS DUAL PRICES
2) 0.000000 125.000000
3) 0.000000 0.000000
4) 0.050000 0.000000
NO. ITERATIONS= 0
RANGES IN WHICH THE BASIS IS UNCHANGED:
OBJ COEFFICIENT RANGES
VARIABLE CURRENT ALLOWABLE ALLOWABLE
COEF INCREASE DECREASE
X1 2500.000000 37500.000000 INFINITY
X2 2500.000000 INFINITY 2343.750000
RIGHTHAND SIDE RANGES
ROW CURRENT ALLOWABLE ALLOWABLE
RHS INCREASE DECREASE
2 1.000000 INFINITY 1.000000
3 0.000000 0.000000 INFINITY
4 0.000000 0.050000 INFINITY
从上面结果可以看出,显然
最优解是125.0000 此时X1=0,X2=0.05吨