1
$\begingroup$

I was taught that there are two different methods for obtaining results for multiplication/division or addition/subtraction with decimals. For multiplication/division the result will have the least amount of significant figures of the multiplicands or the dividends. For addition/subtraction, the addend or the number being subtracted with the least amount of decimal places will be the amount of decimal places for the result. But what if both multiplication AND addition is being used? I guess I haven't gotten up to that yet. If anyone can help I'd appreciate it, thanks!

  • 0
    Please don't use abbreviations like that, and *especially* not in the title. Why put all those people who will be reading your question to all the trouble of figuring out what that means when you can spell it out with only a handful of keystrokes?!2011-09-25
  • 0
    title fixed ...2011-09-25
  • 0
    Well I thought of all people, the ones on this stackexchange network would know! I mean look at all the other titles! I have no freaking idea what they mean at all!!2011-09-25
  • 2
    @David A good title uses standard mathematical vocabulary appropriate for the level of the question, so even if *you* don't know what a 'vertex' and a 'polytope' are (to pick a random example from the front page) an expert in mathematics will. But even an expert in mathematics may not know what 'sig figs' are if they're not a native English speaker (and perhaps even if they are!) If you're unsure, don't abbreviate. No damage done though!2011-09-25

1 Answers 1

2

I'll answer your question by example. We'll work with three numbers

$$a = 52.4$$ $$b = 0.96$$ $$c = 2.193$$

Here $a$ has three significant figures and one decimal place, $b$ has two significant figures and two decimal places, and $c$ has four significant figures and three decimal places.

If we multiply, the number of significant figures of the result is the same as the multiplicand with the least number of significant figures, so although we have $a \times c = 114.9132$ if we keep all the digits of the result, one of the multiplicands only has three significant figures, so you would write

$$a\times c = 115$$

If you are adding, the number of decimal places of the result is the same as the addend with the least number of decimal places, so although we have $a+c = 54.593$ if we keep all the digits, one of the addends only has one decimal place, so you would write

$$a + c = 54.6$$

If you are adding and subtracting in the same calculation you apply the rules sequentially. So to compute $b + a\times c$, the result of $a\times c$ has three significant figures, and no decimal places. Then when adding $b$, one of the numbers in the sum has two decimal places and the other has none, so the result will have zero decimal places of accuracy. You perform the calculation keeping all the digits and round at the end. Keeping all the digits we have $b + a\times c = 115.8732$. Now rounding that result to zero decimal places gives

$$b + a\times c = 116$$

  • 0
    This is brilliant! And one question? Multiplication has higher precedence, so that is why you did it before the addition, right?2011-09-25
  • 0
    Yes, that's the convention - multiplication before addition.2011-09-25
  • 0
    I figured it was that. I thought it was just in programming but i guess i was wrong.2011-09-25
  • 1
    Mathematics is different to coding in that in a given programming language, the expression `a * b + c` has a definite value, and normally the multiplication has higher precedence (though not in all languages! For example, [q](http://en.wikipedia.org/wiki/Q_(programming_language_from_Kx_Systems)) has right-to-left semantics, so that expression would actually return $a\times(b+c)$) whereas in mathematics it's just a convention that you do the multiplication first, and if there's any chance of ambiguity at all you should use parentheses.2011-09-25
  • 0
    So $a + b * c * c + a$ is like $a + ((b * c) *c) + a$?2011-09-25
  • 0
    Yep, exactly right - you'd normally write $a+bcc+a$ or even $2a+bc^2$ which makes it clearer.2011-09-25
  • 0
    Cool. Do the same rules apply for division and subtraction? Or do they bear precedence as well?2011-09-25
  • 0
    The syntax rules in most programming languages (but not all, as Chris points out) are deliberately designed such that the meaning of arithmetic expressions follow the conventions for mathematical formulas (which existed before computers), especially for addition, subtraction and multiplication. So if you know a somewhat mainstream programming language (such as Java, Pascal or Perl), you can use your experience from there directly in mathematics. Division is somewhat different because math favors a horizontal division bar which cannot be written in code at all.2011-09-25
  • 1
    (cont.d) A slash for division can be used in mathematics too, but its precedence is different from those of programming language -- it binds _stronger_ than addition and subtraction but _weaker_ than the invisible multiplication sign. So $a+b/cd$ means $a+\frac{b}{c\times d}$. And in mathematics the slash is non-associative, so "$a/b/cd$" is not meaningful in math.2011-09-25
  • 0
    It wasn't mentioned, but I think it should be: if you are doing a long operation like $a\times c+b$, **don't round too early** (e.g. after the computation of $a\times c$)!! Retain as much precision as you can muster, and worry about the number of figures to retain only after all is said and done. Early rounding is a frequent source of grief and misery.2011-09-26
  • 0
    I think I covered that with "You perform the calculation keeping all the digits and round at the end" but it's definitely worth repeating - thanks!2011-09-26