View Full Version : Linear Equation w/ multiple variables
amurray
11-06-2006, 01:48 PM
I have an equation, h*15 + T*15 +YS*28+S*30 = 208. I also have a range of values for each variable: H = 0-12, T = 1-12, YS = 1-6, S = 1-5. I would like to figure out what combinations solve for this equation assuming only whole numbers for the variables.
Here is the story behind the question. I sold some t shirts, sweatshirts & hats that made $208, but don't remember the exact amount I sold of each. I thought it would be a fun little exercise to figure out the combinations possible. Unfortuntely I coud not come up with a way of doing it
If I am posting in the incorrect group I aplogize, just tell where is more appropiate.
Thanks
Andy
OfficeShredder
11-06-2006, 03:41 PM
What is YS? I guessed T was t-shirt, H was hat, and S was sweatshirt.
Anyway, since you have 208 dollars, the 8 must have come from the 28*YS. So we have to look at 8*(1 through 6). 8*1 = 8, so that passes. 8*2 = 16, 8*3 = 24, 8*4 = 32, 8*5 = 40, 8*6 = 48
So you either sold 1 or 6 sets of YS. If you sold six, you have 160 dollars left. Since it doesn't have a 5 at the end, all the 5's in the unit digits of 15 must cancel, meaning you have pairs of 15's summing up, and some 30's. Unfortunately, the pairs of 15's sum to 30, so the whole thing must be divisible by 30. But 160 isn't, so you didn't sell six YS's.
This means you only sold 1 YS. Try to figure out the rest from there
EDIT: It occurs to me that the unit digit could have been a multiple of 8 plus a 5, but that would give us an odd number, so you don't have to worry about that for any case
amurray
11-07-2006, 03:57 PM
Thanks for the reply. The YS = youth sweatshirt, S = adult sweatshirt.
The YS having to be 1 or 6 makes sense, but I think that 6 * YS = 168, leaving $40 which I can not make out of the $15, $30. SO I guess I sold 1. I think that the best I am going to be able to do as there are several combinations of the other items that would equal the remaining $180.
With a problem like this are there any methods (excel, programming) that would give you the different permutation? I played around with the Excel Solver but that only gives me 1 solution.
Thanks again for the feedback.
Andy
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.