English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I’m stuck on this linear programming math problem. If you could please help point me in the right direction, I would appreciate it.


A farmer has 20 days in which to plant corn and soybeans. The corn can be planted at a rate of 10 acres per day and the soybeans at a rate of 15 acres per day. The farm has 250 acres available for planting. If the profit of corn is $30 per acre, and the profit on soybeans is $25 per acre, how many of each should the farmer plant to maximize profit?

2007-02-08 01:02:13 · 3 answers · asked by OS X Tiger Fan 1 in Science & Mathematics Mathematics

3 answers

let Ts = soybeans time in days
let Tc = corn time in days
let As = soybeans Area
let Ac = corn Area
let Ps = soybeans profit
let Pc = corn profit


Profit = Ps + Pc
Ps = As*25, Pc = Ac*30 ===> Profit = 25As+30Ac
As= Ts*15, Ac=Tc*10

Profit=Ts*15*25+Tc*10*30
=375Ts+300Tc

As+Ac=250 ===> 15Ts+10Tc=250 ===> 3Ts+2Tc=50
===> Tc=25-1.5Ts

Profit= 375Ts+7500-450Ts=7500-75Ts
note: as you minimize Ts the profit increases

Ts+Tc<=20
25-0.5Ts<=20
0.5Ts>=5
Ts>=10

so for maximum profit Ts =10
maximum profit=7500-750=6750$

2007-02-08 01:33:35 · answer #1 · answered by Ceaser 2 · 1 1

This assumes that the farmer will be planting every day so there are 21 combinations of planting (not all of which will work, but bear with me).

The farmer could spend 20 days planting nothing but corn. He could also spend 20 days planting nothing but soyabeans, or any combination in between (19-1, 18-2….10-10…2-18, 1-19)

For each of these combinations (21 combinations in total so a for…next loop of 0-20) you need to calculate the total amount of acres sewn (to see if it fits), and if it does fit you need to calculate the profit.

For example:

Using combination 1, the farmer sews corn for 20 days and doesn’t sew soyabean at all.
This means that he plants a total of 200 acres (which does fit on his farm).

The 200 acres of corn give him a profit of $6000 – but he also has 50 acres lying fallow.

Using combination 2, the farmer sews corn for 19 days and spends 1 day sewing soyabean
.
This means that he plants a total of 205 (19*10 + 15*1) acres which does fit on his farm.

The 190 acres of corn ($5700) and 15 acres of soybean ($375) give him a profit of $6075 – but he also has 45 acres lying fallow.

Run through this loop of all combinations remembering to compare the profit each time through the loop until you find out which combination is most profitable.

p.s. The max profit is $6750, so that you know your code is working correctly.

p.p.s You did ask for pointers, and not some code snippets so I hope this does it for you...

2007-02-08 10:12:26 · answer #2 · answered by mark 7 · 0 0

c and s = the # of acres to be planted in corn and soybeans, respectively.

Maximize the profit formula:
P = 30c + 25s

Subject to the constraints:
c/10 + s/15 <=20 (he has 20 days to plant everything)
c + s <=250 (he has 250 acres to work with)
c>=0, s>=0 (trivial constraints)

That's the setup. Solve away.

2007-02-08 09:35:35 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers