1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Linear Algebra Problem

  1. Jan 15, 2010 #1
    1. The problem statement, all variables and given/known data

    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!).


    2. Relevant equations

    Gaussian algorithm / elimination

    3. 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
     
  2. jcsd
  3. Jan 15, 2010 #2

    Mark44

    Staff: Mentor

    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.
     
  4. Jan 15, 2010 #3

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  5. Jan 16, 2010 #4
    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.
     
  6. Jan 16, 2010 #5

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  7. Jan 16, 2010 #6
    Thanks :). I think I got it now.
     
  8. Jan 17, 2010 #7
    Hi, i do not understand this question, can somebody help me start this question please?
     
  9. Jan 17, 2010 #8
    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!
     
  10. Jan 17, 2010 #9

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    Show us what you did and how you got a negative number.
     
  11. Jan 17, 2010 #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!
     
  12. Jan 17, 2010 #11

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    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?
     
  13. Jan 17, 2010 #12
    do u see the -ive number in b2???
     
  14. Jan 17, 2010 #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.
     
  15. Jan 17, 2010 #14
    Oh wait, B1=8 so B2 is 5 if i did substitution for the 2 equations. Please tell me if im on the right track.
     
  16. Jan 17, 2010 #15

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
  17. Jan 17, 2010 #16

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    If you would show what you are doing I could tell you what you are doing wrong. If you don't, I can't.
     
  18. Jan 17, 2010 #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 coefficent of the pills?
     
  19. Jan 17, 2010 #18

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    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?
     
  20. Jan 17, 2010 #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
     
  21. Jan 17, 2010 #20

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Linear Algebra Problem
  1. Linear algebra problem (Replies: 1)

Loading...