If A+B+C+D=16 and A+B+C+A=10 and A+B+D+B=14 and B+C+C+D=20 w

Started by Rakhal, March 09, 2004, 12:42:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rakhal

As requested my solution to that maths problem

Problem: If A+B+C+D=16 and A+B+C+A=10 and A+B+D+B=14 and B+C+C+D=20 what is D+A+B+D?

My answer:
A+B+C+D=16 and A+B+C+A=10. Taking a D away and adding an A subtracts 6 from the total, so D=A+6
B+C+C+D=20, so B+C+C+A=14
B+C+A+A=10, so C=A+4
A+B+D+B=14, so A+A+B+B=8, B+C+C+D=20, so B+A+A+A=6, so B=A+2
So A=1, B=3, C=5, D=7 and D+A+B+D =18
isit the Penultimate Ranma Fanfic Index at www.rakhal.com/ranmalst.html for more Ranma fanfics than you can shake a stick at.

Lalandil

Here is my solution:

A + B + C + D = 16

A + B+ C + A = 10   -> A + B + C = 10 - A
A + B + D + B = 14  -> A + B + D = 14 - B
B + C + C + D = 20  -> B + C + D = 20 - C
D + A + B + D = X    -> A + B + D = X -D

Next, I substitute the left side of the transformed equations in the very first one, and get:

10 - A + D = 16   -> D = 6 + A
C + 14 - B = 16   -> C = 2 + B
A + 20 - C = 16   -> A = C - 4
C + X - D = 16    -> C = 16 - X + D -> X = 16 - C + D

Next, A is substituted in first equation to get:

D = 6 + C - 4 = 2 + C

and D is substituted in last equation:

X = 16 - C + 2 + C
X = 18

yukatado

Hmm . . . I seem to have done it the overly complicated way . . .

A + B + C + D = 16
A + B + C + A = 10 = 2A + B + C
A + B + D + B = 14 = A + 2B + D
B + C + C + D = 20 = B + 2C + D
D + A + B + D = ?? = A + B + 2D

Dividing the first three by 2 eliminates the extra variable:
A + B + C = 5
A + B + D = 7
B + C + D = 10

If we substitute X for A + B, then we get:

X + C = 5
X + D = 7 and therefore
D = C + 2

If we then substitute Y for B + D, then we get:

A + Y = 7
C + Y = 10
A = C - 3

Therefore:

( C - 3 ) + B + C + ( C + 2 ) = 16
B + ( 2C - 1 ) = 16
( 2C - 1 ) = 16 - B
2C = 17 - B
C = ( 17 - B ) / 2

Therefore:

[ ( ( 17 - B ) / 2 ) - 3 ] + B + [ ( 17 - B ) / 2 ] + [ ( ( 17 - B ) / 2 ) + 2 ] = 16
B = 17

Therefore:

[ ( ( 17 - 17 ) / 2 ) - 3 ] + 17 + ( 2 [ ( ( 17 - 17 ) / 2 ) + 2 ] ) = 18

Kwokinator

Here's my solution.  Mine's pretty simple ^_^

A+B+C+D=16 and A+B+C+A=10.  Since the three other variables are the same, I ignored that, so D = A + 6

Then go to A+B+D+B=14. Replacing the D, it becomes A+B+A+B+6=14, so 2A+2B=8, and A+B=4.

B+C+C+D=20.  Replacing the D again, I get B+C+C+A+6, which works out to A+B+2C = 14.  Since A+B=4, I can just replace that and get 2C+4=14, so 2C=10, and C=5.

Take that back to the first equation, A+B+C+D=16, that can be turned into 4+5+D=16, so D=7

Go back to B+C+C+D=20.  Now that becomes B+5+5+7, so B=3.

Then if A+B=4 and B=3, A must be 1.

So D+A+B+D is just 7+1+3+7, so the answer is 18 ^_^

Dracos

You know, Yukatado, I consider myself relatively skilled at math, but at a brief overview I cannot see how the fuck you got to a right answer.  Seeing Rak's solution for a starter, which is clearly correct and a clever manipulation of equation minimization inclusive of the correct numbers for each variable, it's obvious several of the equation middle-steps are wrong in your formula.  Inclusive of your description, it's obvious parts are wrong...yet you got to a right answer.  Did you perhaps utilize a calculator to hold the middle steps (Therefore having the correct effects of the manipulations within the calculator and therefore removing the errors that are evident in the middle steps of the algebra)?  I mean, just look at the formulas, your 'divide by two' step, for example, states you are taking the first three lines, when you are not only clearly taking lines 2-4 but only dividing the right hand side and the instance of a double variable by 2 instead of properly both sides of the equation (If you are, you neglected to show the halfs).

As a general rule with multi-equation linear algebra, every single middle step should remain a correct equation in and of itself.  If it is not a correct equation when you plug in the true values of the unknowns, then it's obviously an invalid step that, if followed, would skew the results towards incorrect values.  We know, as verified by two separate people in this thread, that A=1, B=3, C=5.  Which fits the logic of these types of problems and how they tend to be created (A lazy distribution of data).  Anyhow, we take one of your middle steps:
A+B+C=5

...And just looking at it can see it's clearly erroneous.  1+3+5 != 5.

So...how the fuck did you get to a correct answer with that?

Dracos
Well, Goodbye.

Rezantis

Rin, your process here is kinda screwed up.  I'll explain . . .

Quote
Hmm . . . I seem to have done it the overly complicated way . . .

A + B + C + D = 16
A + B + C + A = 10 = 2A + B + C
A + B + D + B = 14 = A + 2B + D
B + C + C + D = 20 = B + 2C + D
D + A + B + D = ?? = A + B + 2D

OK, good so far . . .

Dividing the first three by 2 eliminates the extra variable:
A + B + C = 5
A + B + D = 7
B + C + D = 10

OK, you've messed up here. If you divide an entire equation, you divide -every- term in this equation.  So if:

2A + B + c  = 10

You have to divide the entire expression, not one term. So you need (2A + B + C) / 2 = 10 / 2

Which comes out to A + B/2 + C/2 = 5, not A + B + C = 5

Here's the major, major problem with your logic:

If 2A + B + C = 10, and A + B + C = 5 . . .

(2A + B + C) - (A + B + C) = 10 - 5
(2A - A) + (B - B) + (C - C) = 5
A = 5

OK.

Now on your next equation . . .

If 2A + B + D = 14, and A + B + C = 7 . . .

(2A + B + D) - (A + B + D) = 14 - 7
(2A - A) + (B - B) + (D - D) = 7
A = 7

So A = 5 and A = 7, meaning that 5 = 7.

When balancing equations, to apply something to one term, you have to apply it blanketly to the entire equation.  Your main misconception there was that (X + Y + Z) / 2 = X/2 + Y + Z, when in fact it should be X/2 + Y/2 + Z/2.

Quote
If we substitute X for A + B, then we get:

X + C = 5
X + D = 7 and therefore
D = C + 2

If we then substitute Y for B + D, then we get:

A + Y = 7
C + Y = 10
A = C - 3

Therefore:

( C - 3 ) + B + C + ( C + 2 ) = 16
B + ( 2C - 1 ) = 16
You also messed up on this line. That should come out to B + (3C - 1) = 16  <--- You had three Cs in the above arithmetic expression.

Quote
( 2C - 1 ) = 16 - B
2C = 17 - B
C = ( 17 - B ) / 2

Therefore:
[ ( ( 17 - B ) / 2 ) - 3 ] + B + [ ( 17 - B ) / 2 ] + [ ( ( 17 - B ) / 2 ) + 2 ] = 16
B = 17

That's horror. Please show another line of working in between, just for clarity. :)

Quote
Therefore:
[ ( ( 17 - 17 ) / 2 ) - 3 ] + 17 + ( 2 [ ( ( 17 - 17 ) / 2 ) + 2 ] ) = 18

You're contradicting yourself here. As far as I can tell, A = -3, B = 17, C = 0, and D = 2.  This works for A+B+C+D = 16, but none of the other equations.  By using that to figure that the last equation hit 18 (apparently the right answer, I haven't followed the question through fully myself) . . . you apparently got real lucky in getting the right answer. Either that or you made the mistake of knowing the answer before you started. ^^;;  Correct answer doesn't always mean correct process.
Hangin' out backstage, waiting for the show.

Rezantis

Quote from: "Dracos"We know, as verified by two separate people in this thread, that A=1, B=3, C=5.  Which fits the logic of these types of problems and how they tend to be created (A lazy distribution of data).

Consider yourself bapped for OOC knowledge. :)
Hangin' out backstage, waiting for the show.

Bjorn

Given equations produce the augmented matrix:

[1 1 1 1 | 16]
[2 1 1 0 | 10]
[1 2 0 1 | 14]
[0 1 2 1 | 20]

Then the following sequence of row operations (where R(n) is the n'th row of the matrix):

R(2) <- R(2)-2R(1)
R(3) <- R(3)-R(1)
R(1) <- R(1)+R(2)
R(3) <- R(3)+R(2)
R(4) <- R(4)+R(2)
R(2) <- R(2)-R(3)/2
R(4) <- R(4)+R(3)/2
R(2) <- -R(2)
R(3) <- -R(3)/2
R(4) <- -R(4)/2
R(1) <- R(1)+R(4)
R(2) <- R(2)+R(4)
R(3) <- R(3)-R(4)

Produces the reduced matrix:

[1 0 0 0 | 1]
[0 1 0 0 | 3]
[0 0 1 0 | 5]
[0 0 0 1 | 7]

(It would have been simpler to settle for row echelon form, rather than going all the way to a diagonal matrix, but the numbers weren't hard to work with, and I'm obsessive.)

So A=1, B=3, C=5, D=7, and thus A+B+2D= 18.

Love the matrix.  And now I'm done showing off, so I'll shut up. ;)

Bjorn

Kwokinator

Holy crap, I have no idea what you just did ^_^

I feel... stupidly crappy and crappily stupid ;_;

Rezantis

Heh. High school math. ;) It's not as scary as it looks.

Basically, in the matrix:


[1 1 1 1 | 16]
[2 1 1 0 | 10]
[1 2 0 1 | 14]
[0 1 2 1 | 20]
A B C D


He's just rewritten the equations.  You've basically got yea-many As, Bs, Cs and Ds to make the result (the right hand side of the matrix).

Now what he's actually -doing- is he's adding and subtracting rows from each other.

Say, his first step . . .

R(2) <- R(2)-2R(1)

What that means is 'Replace Row 2 with (Row 2 - (2 x Row 1))

So,

R2 = [2 1 1 0 | 10] - (2 x [1 1 1 1 | 16])
R2 = [2 1 1 0 | 10] - [2 2 2 2 | 32]
R2 = [0 -1 -1 -2 | -22]


So the new matrix is

[1  1  1  1 |  16]
[0 -1 -1 -2 | -22]
[1  2  0  1 |  14]
[0  1  2  1 |  20]


Basically, the idea of what he's doing is to keep doing operations on the matrix until he gets the it to the final state, where it's:

[1 0 0 0 | 1]
[0 1 0 0 | 3]
[0 0 1 0 | 5]
[0 0 0 1 | 7]


So, say the first line says 1A + 0B + 0C + 0D = 1. So A = 1.

Matrixes are a -nice- way of doing it for harder solutions, I always found. But it's also more complicated, and you probably don't need to know it (I had it drilled into me in high school, and forgot the process until Bjorn gave this nice example to remind me. ;)

If I didn't make sense with this, say so and I'll try explaining it a little better. <_<
Hangin' out backstage, waiting for the show.

Kwokinator

Cool, I get it now ^_^

That's a lot of steps for what can be solved in like 5, 6 steps ^_^;;

Arigatou, tankoushoku no sensei ^^

Rezantis

Quote
That's a lot of steps for what can be solved in like 5, 6 steps ^_^;;

As Bjorn said, he was showing off. ;)

Quote
Arigatou, tankoushoku no sensei ^^

Tell me what the hell 'tankoushoku' means and we're even. ;P
Hangin' out backstage, waiting for the show.

Bjorn

Quote from: "Rezantis"As Bjorn said, he was showing off. ;)

Well, partly.  ;)  I was also reviewing for myself.  Been a long time since I solved a linear system this way.  It also looks like more steps because of the way I wrote it down.  There's only four intermediate matrices on my scrap sheet.  And had I used row echelon form (that is, gotten zeros below the diagonal, but not above), I would have had to do only 6 row operations (for a total of 2 intermediate matrices), rather than the 13 I listed.

Now, if you want a fast solution.... ;)

Let M be the matrix

[1 1 1 1]
[2 1 1 0]
[1 2 0 1]
[0 1 2 1]

X the column vector [A B C D], and Y = [16 10 14 20], such that

MX=Y.

det(M)=-4 (computed with Matlab, or matrix manipulation software of your choice).  Thus, the inverse of M exists, and so:

X=(M^-1)Y, and you're done.

Computing the determinant and the inverse is tedious by hand, but trivial with software, which is why I didn't use it before -- but it is the fastest way to solve the problem.  You could even use eigenvalues to solve the problem, instead, but that's kinda overkill.  (Plus the eigenvalues of this matrix turn out to be complex, which makes it more of a pain in the ass unless you're taking a "without loss of generality assume the eigenbasis" type mathematician approach.)

Anyways.  Like I said, "love the matrix."  It turns out that any linear system (i.e., any set of equations where no term is squared, cubed, etc.) can be represented by a single matrix -- and, in fact, is much easier to work with if you do.  Even in my first solution, which is arguably the most basic and tedious way to go about this problem (and, in fact, more or less identical to Kwok's), I don't have to worry about any of the half-dozen or so simple errors that people often make using the substitution method.  All I have to do is add and subtract rows from each other until the matrix I've got left is all zeros below the lower diagonal.  From personal experience (both doing and grading), it's much easier to avoid mistakes this way.

Quote
Tell me what the hell 'tankoushoku' means and we're even. ;P

It means "pink."  Personally, I think "tankoushokuna sensei" (pink teacher) is probably a little more appropriate than "tankoushoku no sensei" (teacher of pink), but hey, it probably all means the same.

Rezantis

You enjoyed that, didn't you?

Don't worry. Kwok's gonna get his, oh yes he is . . .
Hangin' out backstage, waiting for the show.

Bjorn

Quote from: "Rezantis"You enjoyed that, didn't you?

Yes.

Yes, I did.