-3

I have these 2 equations, found after a bunch of regression analyses studying the relation between the final value and a, b, and c individually. How do I solve them to find the values for a, b, and c?

0.76 = 25a * 15.25b * 11500c

0.70 = 26a * 13b * 6500c

  • 1
    This looks suspiciously like homework... – Nebula Oct 02 '16 at 20:18
  • 2
    You probably can't. This are 2 equations for the one composite quantity `abc`. And even if the equations were compatible, you still only got the product. – Lutz Lehmann Oct 02 '16 at 20:19
  • 1
    This is not directly related to programming and therefore off-topic. – Monkey Supersonic Oct 02 '16 at 20:23
  • This is not homework. – user3201048 Oct 02 '16 at 20:23
  • You can factor out both equations to `1 = (25 * 15.25 * 11500 / 0.76) * abc` and `1 = (26 * 13 * 6500 / 0.7) * abc` and you'll note that this is a contradiction: there is no real/complex solution for `abc`. – BeyelerStudios Oct 02 '16 at 21:05
  • 1
    I'm voting to close this question as off-topic because it is about [math.se] instead of programming or software development. – Pang Oct 03 '16 at 02:27
  • More equations than unknowns means least squares fitting. If you have more unknowns than equations you can use Singular Value Decomposition. It'll do the best it can. Or you can concede that you can only solve for one in terms of the other two. – duffymo Oct 03 '16 at 11:53

1 Answers1

1

For the general case, you can't. You need one equation for each unknown. If you've got one unknown, then trivially a = 123.4 is also the answer. If you've got two, then 3a + 2b = 10, 2a + 3b = 20. So how do we solve? The answer is that if we add them, we get 5a + 5b = 30. That doesn't help. But if we scale one equation so that the a's cancel, that tells us b. So in this case, multiply by two 6a + 4b = 20. Now multiply the other one by minus three -6a -9b = -60. Now add and the a's disappear -5b = -40. So 5b = 40, 1b = 8, and we now simply substitute b back to find a.

This method scales up to any number of variables, as long as you have an independent equation for each variable.

Malcolm McLean
  • 6,258
  • 1
  • 17
  • 18
  • a, b and c are all unknown values. – user3201048 Oct 02 '16 at 21:38
  • So you can only do it if you can eliminate two, if it so happens that there is a scaling factor which makes any two of a, b or c identical in both equations. Then you can find the other variable. But as a general rule, you need three equations for three unknowns. – Malcolm McLean Oct 02 '16 at 21:45