Parentheses from the Inside OutDate: 03/03/2003 at 19:26:51 From: Kaila Subject: I don't understand evaluating expressions Here is one of the problems. 2a + b - 1 = The things that I find most difficult are following PEMDAS and multiplying the fractions by the whole numbers without using a calculator. Here's a problem from my homework. 2b divided by a+2 to the second power. b = 1.5, a = 3 1. 2(1.5)divided by 3 + 2 to the second power. 2. 3.5 divided by3 +2 to the 2 power 3. 1.5+4 4. 5.5 is this right? Date: 03/04/2003 at 13:26:30 From: Doctor Ian Subject: Re: I don't understand evaluating expressions Hi Kaila, Let's look at an expression like 2 + 3 * (4 - 5 * (6 / 3)) - 4 The parentheses are like an envelope that we have to open to find out what's inside. The first parentheses we run into are (4 - 5 * (6 / 3)) so we forget about everything else while we work this out: 4 - 5 * (6 / 3) Oops! We have more parentheses. So let's forget about everything else until we work out 6 / 3 Okay, there's just one operation, so we do it: 6/3 = 2, so we can go back and replace the parentheses (and everything inside) with the result: 4 - 5 * 2 Now we have no parentheses, so we look for multiplications and divisions. There is just one multiplication, so we do it: 4 - 10 And now we just have a subtraction, so we do that: -6 So now -6 replaces what was in the original parentheses: 2 + 3 * -6 - 4 Again, we have just one multiplication, so we do it: 2 + -18 - 4 And now we have additions and subtractions, so we do them left to right: 2 + -18 - 4 -16 - 4 -20 And that's our result. Note that doing operations right to left (instead of left to right) can give you the wrong answer. For example, consider 72 / 6 / 3 Doing the operations right to left would give us 72 / 2 which is 36; while doing them left to right gives us 12 / 3 which is 4. Also, if we do 10 - 5 - 3 from right to left, we get 10 - 2 which is 8; but if we do it from left to right, we get 5 - 3 which is 2. Now, is there anything magic about these rules? No, it's just that we like to be able to write expressions as simply as possible, and writing 3 + 4 * 5 - 6 * 7 / 3 + 8 is simpler than writing ((3 + (4 * 5)) - ((6 * 7) / 3)) + 8 If we all follow the PEMDAS conventions, though, the two expressions have exactly the same meaning. So one the one hand, we all have to memorize a small set of rules. But on the other hand, over the course of a lifetime, we don't have to write thousands or millions of extra parentheses. Doesn't that seem like a reasonable trade-off? Now, let's stop a moment and look at what I did there. How did I get from the simple expression to the one with all the parentheses? I started with 3 + 4 * 5 - 6 * 7 / 3 + 8 and I looked for each multiplication or division, from left to right. And I put them in parentheses: 3 + 4 * 5 - 6 * 7 / 3 + 8 ------ 3 + (4 * 5) - 6 * 7 / 3+ 8 ----- 3 + (4 * 5) - (6 * 7) / 3 + 8 ----------- 3 + (4 * 5) - ((6 * 7) / 3) + 8 Note that once I've got parentheses around some stuff, it's just like a single number. When I run out of those, I do the same thing with additions and subtractions: 3 + (4 * 5) - ((6 * 7) / 3) + 8 ----------- (3 + (4 * 5)) - ((6 * 7) / 3) + 8 ----------------------------- ((3 + (4 * 5)) - ((6 * 7) / 3)) + 8 Now, this is a lot of extra work, but it has this advantage: Once you've done it, the parentheses tell you, step by step, what you have to do. Just look for any set of parentheses with no other parentheses inside, and do the operation. As long as you do them from the inside out, you don't even have to pay attention to order: ((3 + (4 * 5)) - ((6 * 7) / 3)) + 8 ------- ((3 + 20) - ((6 * 7) / 3)) + 8 -------- (23 - ((6 * 7) / 3)) + 8 ------- (23 - (42 / 3)) + 8 -------- (23 - 14) + 8 --------- 9 + 8 17 So in a sense, these rules are a little like deciding that the letters of the alphabet will go in a certain order. It's not really all that important what the actual order is, but it's VERY important that we all use the same order! Otherwise, we'd never be able to find anything. > Here's a problem from my homework. > 2b divided by a+2 to the second power. Note that the phrase 2b divided by a+2 to the second power could be interpreted in more than one way. It might mean 2b 2 (2b divided by a+2) to the second power --> ( --- ) a+2 or 2b 2b divided by ((a+2) to the second power) --> -------- 2 (a+2) or 2b 2b divided by (a+(2 to the second power)) --> ---------- 2 a + (2 ) And in fact, with no parentheses, following the PEMDAS order, the phrase would be interpreted this way: 2b divided by a+(2 to the second power) E (2b) divided by a+(2 to the second power) M or D ((2b) divided by a)+(2 to the second power) M or D that is, 2b 2 ---- + (2 ) a So if they really wrote it in symbols, as o 2 2b --- a + 2 o instead of using words, then this last interpretation is the conventional one. Note that a fraction bar acts like two pairs of parentheses with a division sign in between: blah blab blah -------------- = (blah blah blah) / (yadda yadda) yadda yadda > 2b divided by a+2 to the second power. b = 1.5, a = 3 > 1. 2(1.5)divided by 3 + 2 to the second power. > 2. 3.5 divided by3 +2 to the 2 power > 3. 1.5+4 > 4. 5.5 is this right? Let's follow the PEMDAS order, and see if we get the same thing. There is an exponent, so we want to evaluate that first. Then we want to do multiplications and divisions, from left to right. Finally, we want to do additions and subtractions from left to right. 2 * 1.5 / 3 + 2^2 --- Exponent 2 * 1.5 / 3 + 4 ------- Multiplication 3 / 3 + 4 ------- Division 1 + 4 ----- Addition 5 Result Why is this different from your answer? For one thing, it looks as if you multiplied 2 by 1.5 and got 3.5, instead of 3. That may have been a slip, or it might indicate that you need to work on your multiplication skills. To check, I'd probably think about money. If two of us have $1.50 each, how much money do we have? Two dollars and two half dollars is three dollars, so 2 * 1.50 must be 3. But everyone thinks about math a little differently from everyone else, so you have to find out what works for you. Anyway, I hope this has helped you see why we have these conventions, and what can happen if you do operations out of order. Write back if you'd like to talk more about this, or anything else. - Doctor Ian, The Math Forum http://mathforum.org/dr.math/ |
Search the Dr. Math Library: |
[Privacy Policy] [Terms of Use]
Ask Dr. Math^{TM}
© 1994-2013 The Math Forum
http://mathforum.org/dr.math/