Sub topic 16
Common Mistakes and Why PEMDAS Can Mislead
This chapter assumes you can apply the full order of operations to integers, fractions, and exponents. It also assumes you can read the short Python snippets used to check results. Here you will see where those rules most often go wrong in practice, and why the usual mnemonic causes some of the errors.
Where the mnemonic misleads
PEMDAS stands for Parentheses, Exponents, Multiplication, Division, Addition, Subtraction. The word lists six letters, but the rules have only four levels. Read as a strict sequence, the letters suggest that multiplication always comes before division and addition before subtraction. They do not. Operations on the same level share a rank and are done from left to right.
| Level | Operations | Tie rule |
|---|---|---|
| 1 | Parentheses, brackets, fraction bars | Innermost first |
| 2 | Exponents | Stacked exponents go top-down |
| 3 | Multiplication and division | Left to right |
| 4 | Addition and subtraction | Left to right |
The mnemonic also has no letter for the unary minus (a minus sign in front of a single number). It has no rule for a fraction bar or for implicit multiplication such as 2(3). Many of the mistakes below come from those gaps.
Mistake 1: Treating M before D as a rule
A learner who reads PEMDAS literally multiplies first in 24 ÷ 4 × 3. That gives 24 ÷ 12 = 2. The correct method works left to right: 24 ÷ 4 = 6, then 6 × 3 = 18.
print(24 / 4 * 3) # 18.0: correct, left to right
print(24 / (4 * 3)) # 2.0: the result of the "multiply first" mistakeMistake 2: Treating A before S as a rule
The same error happens with addition and subtraction. In 10 − 4 + 3, adding first gives 10 − 7 = 3. The correct result is 6 + 3 = 9.
print(10 - 4 + 3) # 9: correct
print(10 - (4 + 3)) # 3: the mistaken groupingThe idea that subtraction means "add the opposite" explains why order does not matter here. 10 − 4 + 3 is 10 + (−4) + 3, and addition of three terms can be done in any order. The mistake is changing the sign of the 3 by implicitly grouping it with the 4.
Mistake 3: Losing the base of a negative power
The expression −3² means "the opposite of 3²". The exponent attaches to the 3 only, so the result is −9. Parentheses make −3 the base: (−3)² = 9.
print(-3 ** 2) # -9
print((-3) ** 2) # 9
x = -3
print(x ** 2) # 9: a variable holding -3 behaves like (-3)
print(-x ** 2) # -9: the leading minus is applied after the powerSubstitution is a common source of this error. When you replace x in x² with −3, you must write (−3)². Writing −3² changes the answer. The same applies to even powers in general: −2⁴ = −16 but (−2)⁴ = 16.
Mistake 4: Ignoring the fraction bar
A fraction bar groups everything above it and everything below it. The expression
(3 + 5) / (2 + 2)
equals 8/4 = 2. If you type it as 3 + 5 / 2 + 2 you get 7.5, because only the 5 is divided by 2.
print((3 + 5) / (2 + 2)) # 2.0
print(3 + 5 / 2 + 2) # 7.5: the grouping was lostThe reverse error also occurs. When you copy a fraction onto one line, put parentheses around the whole numerator and the whole denominator whenever either has more than one term.
Mistake 5: Skipping the exponent inside a fraction expression
A common error with fractions is to add before applying the power. Take 1/2 + 3/4 × (2/3)². The power comes first, so (2/3)² = 4/9. Then multiplication gives 3/4 × 4/9 = 1/3. Then addition gives 1/2 + 1/3 = 5/6. Adding 1/2 + 3/4 first would give 5/4, and the final answer would be 5/9. That is wrong.
from fractions import Fraction
right = Fraction(1, 2) + Fraction(3, 4) * Fraction(2, 3) ** 2
wrong = (Fraction(1, 2) + Fraction(3, 4)) * Fraction(2, 3) ** 2
print(right) # 5/6
print(wrong) # 5/9Remember that the exponent applies to the whole fraction only when it is written outside parentheses around it. (2/3)² is 4/9. Writing 2/3² means 2/9, because the exponent attaches to the 3 alone.
Mistake 6: Distributing an exponent over a sum
The power of a product splits: (2 × 3)² = 2² × 3². The power of a sum does not. (2 + 3)² = 25, while 2² + 3² = 13.
print((2 + 3) ** 2) # 25
print(2 ** 2 + 3 ** 2) # 13: not the same expressionThe grouping symbols are evaluated first, and the exponent then applies to the single value 5.
Mistake 7: Misreading negative and zero exponents
A negative exponent does not make the result negative. It takes a reciprocal. 2⁻² = 1/2² = 1/4, not −4. For a fraction, (2/3)⁻² = (3/2)² = 9/4.
A zero exponent gives 1 for any nonzero base. The same bracket rule from Mistake 3 still applies. (−5)⁰ = 1, but −5⁰ = −1.
from fractions import Fraction
print(2 ** -2) # 0.25
print(Fraction(2, 3) ** -2) # 9/4
print((-5) ** 0) # 1
print(-5 ** 0) # -1Mistake 8: Evaluating stacked exponents from the bottom
The expression 2^3^2 is evaluated from the top down. That means 2^(3²) = 2⁹ = 512. Working from the left gives (2³)² = 64, which is a different number.
print(2 ** 3 ** 2) # 512
print((2 ** 3) ** 2) # 64This rule is the one exception to "ties go left to right". It applies only to exponents. Calculators differ here, and some spreadsheet programs evaluate left to right. Add parentheses whenever a reader could be unsure.
Mistake 9: Treating ambiguous notation as settled
Consider 8 ÷ 2(2 + 2). Some textbooks treat 2(2 + 2) as a single unit, which gives 8 ÷ 8 = 1. Others treat the implicit multiplication as ordinary multiplication, which gives 4 × 4 = 16. The strict left-to-right rule gives 16, but the expression is poorly written.
print(8 / 2 * (2 + 2)) # 16.0
print(8 / (2 * (2 + 2))) # 1.0Do not try to win this argument. Rewrite the expression so that only one reading is possible.
A checking routine
Use these steps when an answer looks suspicious.
- Underline each level of the expression: grouping first, then exponents, then the multiplication and division chain, then the addition and subtraction chain.
- Rewrite the expression after each single step, so every line has one fewer operation.
- Look for a leading minus, a fraction bar, and a stacked exponent. These are the three places where mistakes cluster.
- Check the final value in Python, and compare against the version with the suspected wrong grouping.
Exercise
Evaluate 2 − 3 × (−2)² and then evaluate −2⁴ + (−2)⁴. Show which level of the order of operations you apply at each step.
Show answer
First expression: the parentheses are already there, so (−2)² = 4 (exponent level). Then 3 × 4 = 12 (multiplication level). Then 2 − 12 = −10 (subtraction level). Second expression: −2⁴ = −16 because the exponent applies to 2 first, and (−2)⁴ = 16. So −16 + 16 = 0.
Exercise
A student computes 18 ÷ 3 × 2 as 3 and (1 + 2)² as 5. Explain each mistake and give the correct values.
Show answer
The first answer divides 18 by the product 3 × 2, but division and multiplication share a rank and go left to right: 18 ÷ 3 = 6, then 6 × 2 = 12. The second answer squares each term separately (1² + 2² = 5), but the parentheses are evaluated first: 3² = 9.