Jump to content
BrainDen.com - Brain Teasers
  • 0


superprismatic
 Share

Question

A store is selling 6 new kinds of candy

bars, call them A,B,C,D,E,and F. My

4 friends, bought some of the bars.

Each friend remembered how many of each

kind of bar he bought and the total

price he paid (there's no sales tax

in this ficticious state). Of each of

A,B,C,D,E,and F, my first friend bought

2,5,10,7,8,and 1 at a cost of $36.90;

my second friend got 1,9,3,1,0,and 4 at

a cost of $20.05; my third friend got

6,1,3,2,4,and 5 for $24.70; my fourth

friend got 3,2,5,12,8,and 1 for $37.75.

I'm more frugal than any of my friends,

so I would like to buy 1 of each of the

six bars to see which I like best.

How much would that cost me?

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

:Throws his linear algebra book at superprismatic:

Is there a way to solve this without using determinants? I almost gave myself an embolism when I wrote down the system of equations and started to solve using Kramer's rule. Nice problem.

Link to comment
Share on other sites

  • 0

:Throws his linear algebra book at superprismatic:

Is there a way to solve this without using determinants? I almost gave myself an embolism when I wrote down the system of equations and started to solve using Kramer's rule. Nice problem.

Well, I know the answer because I made up the problem. To be honest, I don't know a good way to go about solving it. Part of the reason I put the problem out was to find out if anyone comes up with a nice approach to it.

Basically, the problem asks if (1,1,1,1,1,1) is in the vector space spanned by the 4 basis vectors and, if so, what linear combination of those basis vectors gives you (1,1,1,1,1,1).

Ain't Linear Algebra grand?

Sorry, I know an easy way to do it. It just didn't occur to me until now.

Edited by superprismatic
Link to comment
Share on other sites

  • 0

Do you mind telling us how you approached the problem? Is it the straightforward linear algebra approach?

My pleasure. Again, that is a nice puzzle that you posted.

Here's a detailed approach

Let c = [ A, B, C, D, E, F]', and let C = [ 36.90, 20.05, 24.70, 37.75]'

Let A =


[ 2 5 10 7 8 1

1 9 3 1 0 4

6 1 3 2 4 5

3 2 5 12 8 1]

So far the information we have can be summed in the matrix equation A c = C. if we need to solve for c, we can't do it because we have 4 equations for 6 variables. Fortunately, we only need to find a sum of the variable, which requires less information.

Assume that there exist 4 row multipliers (a,b,c,d), such that

a* (2 5 10 7 8 1) + b*(1 9 3 1 0 4 ) + c*(6 1 3 2 4 5) + d*(3 2 5 12 8 1) = (1 1 1 1 1 1)

We can rewrite this as a matrix equation

(a b c d ) * A = (1 1 1 1 1 1)

This time, we have enough information for solve for (a, b, c, d), since we have 6 equations with 4 variables. The quick way is to do the QR decomposition. The slow way is to do the Gauss-seidel business. The solution for (a,b,c,d) is ( 0.015625, 0.078125, 0.125000, 0.046875 ). Multiply this with the prices and sum, and there you have it.

Edited by bushindo
Link to comment
Share on other sites

  • 0

My pleasure. Again, that is a nice puzzle that you posted.

Here's a detailed approach

Let c = [ A, B, C, D, E, F]', and let C = [ 36.90, 20.05, 24.70, 37.75]'

Let A =


[ 2 5 10 7 8 1
1 9 3 1 0 4
6 1 3 2 4 5
3 2 5 12 8 1]

So far the information we have can be summed in the matrix equation A c = C. if we need to solve for c, we can't do it because we have 4 equations for 6 variables. Fortunately, we only need to find a sum of the variable, which requires less information.

Assume that there exist 4 row multipliers (a,b,c,d), such that

a* (2 5 10 7 8 1) + b*(1 9 3 1 0 4 ) + c*(6 1 3 2 4 5) + d*(3 2 5 12 8 1) = (1 1 1 1 1 1)

We can rewrite this as a matrix equation

(a b c d ) * A = (1 1 1 1 1 1)

This time, we have enough information for solve for (a, b, c, d), since we have 6 equations with 4 variables. The quick way is to do the QR decomposition. The slow way is to do the Gauss-seidel business. The solution for (a,b,c,d) is ( 0.015625, 0.078125, 0.125000, 0.046875 ). Multiply this with the prices and sum, and there you have it.

Yeah, that's the straightforward linear algebra approach I meant. I don't know why it didn't hit me when I made up the problem.

It took Kriil to jog the old cobwebs from the old thinkin' machine. Thanks to both of you.

Link to comment
Share on other sites

  • 0

Ah, of course. It's been so long since linear algebra I have wiped it completely. I forgot that you needed 6 equations to solve for 6 variables using Kramer's rule. I've never even heard of the methods you used. So glad I was never a math major...

Link to comment
Share on other sites

  • 0

Ah, of course. It's been so long since linear algebra I have wiped it completely. I forgot that you needed 6 equations to solve for 6 variables using Kramer's rule. I've never even heard of the methods you used. So glad I was never a math major...

Don't feel bad. I forgot everything I learned in linear algebra as soon as I got my grade. Sad thing is my teacher nominated me for Who's who, and that is how I repayed her.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...