Sub topic 1
Why the Same Expression Needs One Answer
Prerequisites
This chapter assumes you can add, subtract, multiply, and divide whole numbers. You should know what positive and negative integers mean on the number line, and you should understand a fraction as a numerator over a denominator.
Why one answer matters
Consider 2 + 3 × 4. Read left to right, the expression gives 5 × 4 = 20. Multiply first, and it gives 2 + 12 = 14. Without an agreed rule, both readings are possible, so the expression has no single value. Mathematicians therefore agreed on an order of operations so that everyone evaluates the same expression to the same result.
Quick review: negative integers
Adding a negative number moves left on the number line: 4 + (-7) = -3. Subtracting a negative number is the same as adding its positive: 4 - (-7) = 11. Two negatives multiply to a positive: (-2) × (-5) = 10. Apply these rules whenever a sign appears inside a larger expression.
What an exponent means
An exponent counts how many times a base multiplies itself. In 4³, the base is 4 and the exponent is 3, so 4³ = 4 × 4 × 4 = 64. Exponents are evaluated before multiplication, division, addition, or subtraction.
Multiplication and division: left to right
Multiplication and division have equal rank, so work from left to right. In 24 ÷ 4 × 3, divide first: 6 × 3 = 18. Multiplying first gives 24 ÷ 12 = 2, which is wrong.
Addition and subtraction: left to right
Addition and subtraction also share a rank. In 10 - 4 + 3, subtract first: 6 + 3 = 9. Adding first gives 10 - 7 = 3, which is also wrong.
Check these results with Python:
print(2 + 3 * 4 ** 2) # 50
print(24 / 4 * 3) # 18.0
print(10 - 4 + 3) # 9Exercise
Evaluate 10 - 2 * 3 + 8 / 4 using the order of operations.
Show answer
Multiply and divide first: 2 * 3 = 6 and 8 / 4 = 2. Then 10 - 6 + 2 = 6. The answer is 6.