How to Use Gaussian Elimination to Solve for Vitamin Pills

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
35 replies · 7K views
sdoug041 said:
Ok I see.

If b3 >= 0 , and say b3 was indeed 0, then b2 would have to be -3 to satisfy the equation. Does this mean b3 should be 3<=b3<=8, and 0<=b1<= 5?

Yes, yes, yes. What about b2? Now how many total solutions are there to your pill taking needs?
 
Physics news on Phys.org
memomator said:
The question states. Find all combination of pills that provide you with the exact daily requirement(no partial pill). How will I find all the combination of pills, knowing only the number of pills in brand 1, 2, and 3.

"the number of pills in brand 1, 2, and 3" is what you need to specify a "combination of pills". For example, from your equations I see 3 pills of brand 3, 5 pills of brand 1 and 0 pills of brand 2 is one solution. How many more are there?
 
Ok so 0<=b2<=5

I've found 6 possible solutions for the equations :D

Thanks a lot, Dick.
 
Ok i understand that now, is there an easier way to find out how many solutions there are other than plugging into numbers.
 
memomator said:
Ok i understand that now, is there an easier way to find out how many solutions there are other than plugging into numbers.

Sure, b1+b3=8 tells you you need b3<=8 to make b1 nonnegative. b2-b3=(-3) tells you you need b3>=3 to make b2 nonnegative. Put them together and you have 3<=b3<=8 with the other values being b1=8-b3 and b2=(-3)+b3. You could also write the answer that way instead of spelling out the explicit values of b1 and b2.
 
Thank you very much Dick, I finally understand. You have 6 solutions. Because B3 is between 3 and 8 and the numbers between 3 and 8 are solutions and you take those number and sub them into the other equation to find out b1 and b2.