Gender: digging holes (person/day), planting trees (person/day) and watering (person/day)
Male 6 20 30 25
Female 5 10 20 15
There are boys digging holes, boys planting trees x2, boys watering x3, girls digging holes y 1, girls planting trees y2 and girls watering y3.
The objective function is to plant as many trees as possible, z=25x3+ 15y3.
So the mathematical model of this problem is
3. Model solving
This is a linear optimization problem, which can be solved by MATLAB software. The best solution is as follows
x 1 = 3.75 x2 = 0x 3 = 2.25y 1 = 0 y2 = 3.75 y3 = 2.25
(Note: The quota allocated to a certain labor force is not necessarily an integer; If 10.5 male students dig holes, it means that 10 male students dig holes all day, 1 male students dig holes for half a day)
4.MATLAB program
c =[0 0-25 0 0- 15];
a =[];
b =[];
aeg=[ 1 1 1 0 0 0
0 0 0 1 1 1
-2 3 0 - 1 2 0
-4 0 5 -2 0 3];
beg =[6; 5; 0; 0];
vlb =[0; 0; 0; 0; 0; 0];
vub =[];
[x,fval]=linprog(c,a,b,aeg,beg,vlb,vub)
x =
3.7500
0.0000
2.2500
0.0000
3.7500
1.2500
fval =
-75.0000