How to Use Gaussian Elimination to Solve for Vitamin Pills

Click For Summary

Homework Help Overview

The problem involves determining the number of vitamin pills from three brands to meet specific daily requirements for vitamins A, B, and C. The context is set within the framework of Gaussian elimination to solve a system of equations represented by an augmented matrix.

Discussion Character

  • Mixed

Approaches and Questions Raised

  • Participants discuss the formulation of an augmented matrix based on the vitamin requirements and the contents of each brand. There are attempts to manipulate the matrix using Gaussian elimination, with some participants expressing confusion over negative values and the implications of infinite solutions.

Discussion Status

There is an ongoing exploration of the relationships between the variables representing the number of pills from each brand. Some participants have provided guidance on defining variables and setting up equations, while others are questioning the validity of their results and the implications of their findings.

Contextual Notes

Participants note constraints related to the requirement for nonnegative whole numbers of pills and the implications of having three unknowns in two equations. There is also discussion about the limits on the values for the number of pills from brand 3 based on the equations derived from the matrix.

sdoug041
Messages
25
Reaction score
0

Homework Statement



Your doctor has asked you to take 5 units of vitamin A, 13 units of Vitamin B, and 23 units of vitamin C every day. There are three brands available in your local pharmacy which contain the following units of vitamins:-------- vitamin A vitamin B vitamin C
Brand 1 --- 1 ------ 2 ------ 4
Brand 2 --- 1 ------ 1 ------ 3
Brand 3 --- 0 ------ 1 ------ 1

Find all combinations of pills that provide you with the exact daily requirement (no partial pills!).

Homework Equations



Gaussian algorithm / elimination

The Attempt at a Solution



I transposed to create an augmented matrix in which the required amount of each pills could be implemented in the matrix.

ie

---------------Brand 1--------Brand 2-------Brand 3 ------Total
Vitamin A --------1 --------------1 -----------0 -----------5
Vitamin B --------2 --------------1 -----------1 ---------- 13
Vitamin C ------- 4 --------------3 -----------1 ----------23

I tried to use Gaussian Algorithm to solve for each variable but I keep eliminating all the values in row 3 (ie 0 0 0 0). I do believe this implies infinite solutions, but obviously this cannot be true. Please help!

Thanks,

Steve
 
Physics news on Phys.org
Before jumping in and creating an augmented matrix, write the equations that the augmented matrix is supposed to represent. Your equations will involve variables that you need to define.
 
You are right! There are an infinite number of solutions to your equations. But only a finite number of those solutions are nonnegative whole numbers.
 
Thank you for the replies,

I defined the values as x, y, and z. Is this what you meant Mark44?

Dick, I'm not entirely sure how to manipulate the matrix to solve for the whole number, positive solutions. Could you possibly shed some light on this?

Thanks guys.
 
sdoug041 said:
Thank you for the replies,

I defined the values as x, y, and z. Is this what you meant Mark44?

Dick, I'm not entirely sure how to manipulate the matrix to solve for the whole number, positive solutions. Could you possibly shed some light on this?

Thanks guys.

You need to actually solve the equations rather than just row reducing the matrix, as Mark44 suggested. Call b1,b2,b3 the number of pills in each brand and write three equation, solve for say b1 and b2 in terms of b3. Then think about what kind of numbers you can put in for b3.
 
Thanks :). I think I got it now.
 
Hi, i do not understand this question, can somebody help me start this question please?
 
I need to understand this question too.. Can someone please solve it! Cause I tried doing the matrices and I get a negative number for y! Which is not possible!
 
askmenow said:
I need to understand this question too.. Can someone please solve it! Cause I tried doing the matrices and I get a negative number for y! Which is not possible!

Show us what you did and how you got a negative number.
 
  • #10
ok.. I did this:

---------------Brand 1--------Brand 2-------Brand 3 ------Total
Vitamin A --------1 --------------1 -----------0 -----------5
Vitamin B --------2 --------------1 -----------1 ---------- 13
Vitamin C ------- 4 --------------3 -----------1 ----------23

and i solved the matrix and ended up getting:

1 0 1 8
0 1 -1 -3
0 0 0 0

which doesn't make since!
 
  • #11
How do you know it doesn't make sense? Call b1, b2, and b3 the number of pills of each brand. What does your matrix tell you about the relation between them?
 
  • #12
do u see the -ive number in b2?
 
  • #13
Ok i did get the solution: B1=8 and b1-b2=-3 and no solutions for b3 because brand three does not exist due to the fact that there are 0 vitamin A in that brand, and therefore not a solution because the doctor recommended brand 5 units of vitamin A.

I was wondering though what does b1-b2=-3 mean, because it is not possible to have a negative solution.
 
  • #14
Oh wait, B1=8 so B2 is 5 if i did substitution for the 2 equations. Please tell me if I am on the right track.
 
  • #15
askmenow said:
do u see the -ive number in b2?

The numbers in your matrix aren't numbers of pills. They are the coefficients of the number of pills. E.g. the 1 0 1 8 line tells you 1*b1+0*b2+1*b3=8. How about the second line? The coefficients can be negative even though the b's can't.
 
  • #16
memomator said:
Oh wait, B1=8 so B2 is 5 if i did substitution for the 2 equations. Please tell me if I am on the right track.

If you would show what you are doing I could tell you what you are doing wrong. If you don't, I can't.
 
  • #17
b1=8
b1-b2=-3
i sub b1 into b1-b2=-3
i get b2 to be 5
So 8 and 5 are the coefficient of the pills?
 
  • #18
memomator said:
b1=8
b1-b2=-3
i sub b1 into b1-b2=-3
i get b2 to be 5
So 8 and 5 are the coefficient of the pills?

No, I meant the first three rows of the matrix are coefficients. Neither one of your starting equations is right. How did you get them?
 
  • #19
i reduced it to row-echelon form and got

1 0 0 8
0 1 -1 -3
0 0 0 0

so the first column is b1 second is b2 thrid is b3
 
  • #20
memomator said:
i reduced it to row-echelon form and got

1 0 0 8
0 1 -1 -3
0 0 0 0

so the first column is b1 second is b2 thrid is b3

Now I have to ask you how you got that. askmenow got:

1 0 1 8
0 1 -1 -3
0 0 0 0

and I think that's right.
 
  • #21
Oh sorry you are right i made a mistake. Ok so the row echelon becomes
1 0 1 8
0 1 -1 -3
0 0 0 0

the equations become
b1+b3=8
b2-b3=-3

what do i do after this I am really confused right now.
 
  • #22
memomator said:
Oh sorry you are right i made a mistake. Ok so the row echelon becomes
1 0 1 8
0 1 -1 -3
0 0 0 0

the equations become
b1+b3=8
b2-b3=-3

what do i do after this I am really confused right now.

Now it's easy. b3 is a nonnegative integer (as are the other b's). Start trying them out. Set b3=0 and solve for the other variables. Does it work? Can b3=1? You should figure which values work pretty quickly.
 
  • #23
Dick said:
Now it's easy. b3 is a nonnegative integer. Start trying them out. Can b3=0? Can b3=1? You should figure which values work pretty quickly.

But we have 3 unkowns in 2 equations :s
 
  • #24
Ok i found out that b3 must be greater or equal to 3. does this mean that there are infinite solutions if b3 is greater or equal to 3? If so does this mean that there are infinite combination to the pills.
 
  • #25
sdoug041 said:
But we have 3 unkowns in 2 equations :s

I thought we settled the infinite number of solutions thing. Look, you know b3>=0. b1+b3=8 tells you b3<=8 since b1>=0. That's not an infinite number of possibilities.
 
  • #26
memomator said:
Ok i found out that b3 must be greater or equal to 3. does this mean that there are infinite solutions if b3 is greater or equal to 3? If so does this mean that there are infinite combination to the pills.

Can b3 be 9 or greater?
 
  • #27
Oh ok so b3 is between 3 and 8 but if i plug in 0, 1, and 2 i get a negative number for b2.

also what does the number 3 between 8 represent
 
  • #28
memomator said:
Oh ok so b3 is between 3 and 8 but if i plug in 0, 1, and 2 i get a negative number for b2.

also what does the number 3 between 8 represent

b3 is the number of pills of brand 3, right? I'm a little confused why you are asking...
 
  • #29
Dick said:
I thought we settled the infinite number of solutions thing. Look, you know b3>=0. b1+b3=8 tells you b3<=8 since b1>=0. That's not an infinite number of possibilities.

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?
 
  • #30
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.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
Replies
8
Views
2K
  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K