Tuesday, September 1, 2015

Evaluation

Problem:

how to evaluate using the order of operation

Solution:

Rule 1: You always evaluate expression inside the parenthesis first
Rule 2: You always evaluate multiplication and division before plus or minus
Rule 3: If you have multiplication or division together, evaluate from left to right.
Rule 4: If you have plus or minus together, evaluate from left to right.

Example

$ ( 1 + 2 - 3) \times 5 \div 4 - 7 $

Rule 1 applies, now you focus on the expression inside the parenthesis

$ 1 + 2 - 3 $

Now you have plus and minus, so rule 4 applies, from left to right

$ 3 - 3 $

Now it is clear this is 0, put it back and replace the parenthesis

$ 0 \times 5 \div 4 - 7 $

Now rule 2 applies, you do multiplication and division first, rule 3 also apply, from left to right.

$ 0 \div 4 - 7$

$ 0 - 7 $

The final result is 7.

No comments:

Post a Comment