Linear Programming - using percentages in constraints

kone

New member
Joined
Nov 4, 2007
Messages
4
Hi all,

I have a small problem with a linear programming assignment and I was wondering if someone could point me in the right direction.

I have grasped the basics of LP but this question contains %s and I am confused

The question states

"A company produces 2 snacks, Snack A and Snack B, each snack contains chocolate, biscuit and raisins, The company has 100kg of Chocolate, 250kg of biscuit and 300kg of raisins in stock. Snack A must contains at least 40% Chocolate and Snack B must contains at least 20% Biscuit and at least 20% Raisin, each kg of Snack A sells for 40cents and each kg of Snack B sells for 60 cents"

I have come up with the following but I am not sure if it is correct.

X = Snack A
Y = Snack B

Max Z = 40X + 60Y

Subject to

1) .4X + .6Y <= 100 (Chocolate Constaint)
2) .6X + .2Y <= 250 (Biscuit Constraint)
3) .6X + .2Y <= 300 (Raisin Constraint)

X and Y are non-negative

My thinking behind this is that Snack A must have at least 40% Chocolate so the Biscuit and Raisin content can up to 60%, similarly Snack B must contains at least 20% Biscuit and at least 20% Raisin so Chocolate content can up to 60%

As I have said I have no idea whether I am on the right track or not.

Any help would be greatly appreciated.

thanks,
Kone
 
Have you stated the problem in full?
The way it is, X can be all chocolate : 100 @ .40 = $40;
and Y can be the remainder: 550 @ .60 = $330 : total of $370

And what are you trying to get: the maximum revenue?
If so, then it's obviously the above $370, since the 40 cents snacks
have been minimized and the 60 cents snacks have been maximized.

> I have grasped the basics of LP but this question contains %s and I am confused

Ok; 40% means 4 out of 10; I think easiest way to handle is a change to units:
change on hand supplies to: 1000, 2500, and 3000 units;
change the 40% requirement to 4 units, the 20% to 2 units.

That's all you get from me: Phoenix Suns' game half-time break just over!
 
Hi Denis, thanks for the reply.

Yes, that is the problem in full.

"A company produces 2 snacks, Snack A and Snack B, each snack contains chocolate, biscuit and raisins"

So X cannot be 100% chocolate, the Snacks must contains all 3 ingredients, Choclate, Biscuit and Raisin.

I am trying to get the maximum revenue.

I don't see how changing the units will make a difference though, it seems to me that we are just moving the decimal place?
 
kone said:
> "A company produces 2 snacks, Snack A and Snack B, each snack contains
> chocolate, biscuit and raisins"

Shucks; I entirely missed that!

> I don't see how changing the units will make a difference though,
> it seems to me that we are just moving the decimal place?

True. But easier to "handle"; take one Asnack produced with 40% chocolate;
then chocolate supply left is:
100 - .4 = 99.6, or
1000 - 4 = 996
I was thinking programming, where the units would be restricted to integers;
as example:
X : 4 to 8 chocolate units (at least 1 biscuit and 1 raisin unit)

But of course that eliminates stuff like a 57%-23%-20% snack!

Using percentages could result in stuff like 52.123456....% chocolate ....

Since you stated you had problems using percentages, I was trying to suggest
setting up the problem like this:

A company produces 2 snacks, Snack A and Snack B; each snack contains chocolate, biscuit and raisins.
The company has 1000 units of chocolate, 2500 units of biscuit and 3000 units of raisins in stock.
All snacks are made up of 10 units each.
Snack A must contains at least 4 units of chocolate.
Snack B must contains at least 2 units of biscuit and at least 2 units of raisin.
Each Snack A sells for 40 cents and each Snack B sells for 60 cents.
Calculate the maximum revenue.

I was trying to tell you that it's probably much easier for you to start by solving
that one (about the same as the original with percentages), then once you do,
use the procedure and apply it to the original problem.

Twas really "food for thought".
 
Once again thanks for the reply.

So If I use maximize z = 40x + 60y

subject to

4x + 6y <= 1000
6x + 2y <= 2500
6x + 2y <= 3000

I get

z = 10000
x = 0
y = 166.667

I still don't know if I am correct.

The issue I have is am I setting up the constraints correctly?

I think I may have that bit wrong. Is it correct, for constraint 1, to set it was 4x (or .4x) when the question states that it's "At Least 40%"
 
For now, I'm not sure, plus don't want to guess and give you something wrong.

There are no "minimums" given, like:
can you have an X that has 99.999998% chocolate,
plus .000001% biscuit (a biscuit crum!)
plus .000001% raisins (half a raisin!)

That's a reason that going with units is easier: we can "assume" 1 unit as minimum
(although percentages would work, of course, but messier).

So maximum X = (1000 - Y) / 4 : each Y requires 1 unit of chocolate
and minimum X = (1000 - Y) / 8 : 8 + 1 unit of each of biscuit/raisin = 10

That's the way I see it.
 
I guess one way is to see what happens if only SnackB's are produced;
y = number of SnackB's, c = chocolate, b = biscuit, r = raisin
Since at least 2 units of b and r are required, we can represent
the r units with 2+u and the b units with 2+v;
then that forces the c units to be 10-4-u-v;
so we have these 3 resulting equations:

y(2 + u) = 3000 : 2y + uy = 3000 [1]
y(2 + v) = 2500 : 2y + vy = 2500 [2]
y(6 - u - v) = 1000 : 6y - uy - vy = 1000 [3]

Solving for y gives y = 650 (expected, since 650 is 1/10 of 6500);
and u = 34/13, so 2 + u = 60/13;
and v = 24/13, so 2 + v = 50/13;
resulting in 6 - u - v = 20/13
(adding 'em up we get 130/13 = 10)

So we now know that the minimums have been accomodated,
and we have c's available for each of the 650.

So max profit = 650 * .6 = $390

And we know that's max profit because if we rearrange to get only
1 SnackA, we'll get a 40 cents sale, but will lose a 60 cents sale.

Kone:
your problem is further unclear, since it is not stated that the resulting
batch of snacks are to be alike; theoretically, you can have batches of Y's
with, as example, (1c, 4b, 5r), some with (3c, 5b, 2r) and on and on...
 
I think I am making a bit complicated. :oops:

thanks a lot for your help Denis, I really do appreciate it.
 
Top