Sub topic 10
Order of Operations with Fractions
This chapter assumes you can add, subtract, multiply, and divide whole numbers and work with negative integers. It also assumes you know a fraction is a numerator over a denominator, and that you know the basic order of operations: grouping, then exponents, then multiplication and division, then addition and subtraction. Here you apply that order to fractions.
The order does not change
Fractions follow the same order as whole numbers. What changes is the work inside each step, because each operation on fractions has its own procedure.
| Operation | Procedure | Example |
|---|---|---|
| Add or subtract | Rewrite with a common denominator, then combine the numerators | 1/2 + 1/3 = 3/6 + 2/6 = 5/6 |
| Multiply | Multiply numerators together and denominators together | 3/4 × 4/9 = 12/36 = 1/3 |
| Divide | Multiply by the reciprocal of the divisor | 3/4 ÷ 3/8 = 3/4 × 8/3 = 2 |
| Raise to a power | Apply the exponent to the numerator and the denominator | (2/3)² = 4/9 |
The divisor is the number right after the ÷ sign. Only that number is flipped. The number before the sign stays as it is.
A full worked example
Evaluate 1/2 + 3/4 × (2/3)².
- There are no grouping symbols to simplify first. The parentheses only wrap the base of the exponent.
- Evaluate the exponent: (2/3)² = 4/9.
- Multiply: 3/4 × 4/9 = 12/36 = 1/3.
- Add: 1/2 + 1/3 = 3/6 + 2/6 = 5/6.
Python's Fraction type does exact fraction arithmetic and uses the same precedence rules, so you can compare it with your hand work.
from fractions import Fraction
result = Fraction(1, 2) + Fraction(3, 4) * Fraction(2, 3) ** 2
print(result) # 5/6If you typed 1/2 + 3/4 * (2/3) ** 2 instead, Python would use floating-point numbers. You would get a decimal close to 0.8333, not the exact fraction 5/6. Use Fraction when you want to compare exact values.
Multiplication comes before addition
A common slip with fractions is to add first because the addition appears first on the page. Compare these two expressions.
- 1/2 + 3/4 × 2/3 multiplies first: 3/4 × 2/3 = 1/2, and then 1/2 + 1/2 = 1.
- (1/2 + 3/4) × 2/3 adds first because of the parentheses: 1/2 + 3/4 = 5/4, and then 5/4 × 2/3 = 10/12 = 5/6.
The same numbers and the same operations give 1 in one case and 5/6 in the other. Only the grouping differs.
from fractions import Fraction
a = Fraction(1, 2) + Fraction(3, 4) * Fraction(2, 3)
b = (Fraction(1, 2) + Fraction(3, 4)) * Fraction(2, 3)
print(a, b) # 1 5/6Division and multiplication, left to right
Division and multiplication share a rank, so you work from left to right. Consider 3/4 ÷ 3/8 × 2.
- Go left to right. First divide: 3/4 ÷ 3/8 = 3/4 × 8/3 = 2.
- Then multiply: 2 × 2 = 4.
A frequent mistake is to flip everything after the ÷ sign, which treats 3/8 × 2 as the divisor. That computes 3/4 ÷ (3/8 × 2) = 3/4 ÷ 3/4 = 1. This is a different expression, and it needs parentheses to be written that way.
from fractions import Fraction
print(Fraction(3, 4) / Fraction(3, 8) * 2) # 4
print(Fraction(3, 4) / (Fraction(3, 8) * 2)) # 1Subtraction and addition, left to right
Addition and subtraction also share a rank. Take 1/2 − 3/4 + 1/4.
- Subtract first: 1/2 − 3/4 = 2/4 − 3/4 = −1/4.
- Then add: −1/4 + 1/4 = 0.
If you add 3/4 + 1/4 first, you get 1/2 − 1 = −1/2. That is the value of 1/2 − (3/4 + 1/4), which is a different expression.
from fractions import Fraction
print(Fraction(1, 2) - Fraction(3, 4) + Fraction(1, 4)) # 0
print(Fraction(1, 2) - (Fraction(3, 4) + Fraction(1, 4))) # -1/2Subtracting a fraction is the same as adding its negative, so you can think of the first expression as 1/2 + (−3/4) + 1/4. Under that view the order of the additions no longer matters. The left-to-right rule is what keeps the subtraction sign attached to the correct number.
Working method for mixed expressions
Use the same routine each time.
- Simplify anything inside grouping symbols, starting with the innermost.
- Evaluate exponents, including powers of fractions.
- Go left to right through multiplication and division.
- Go left to right through addition and subtraction.
- Rewrite the whole expression after every step, so each line has exactly one change.
Reduce fractions to lowest terms as you go. Smaller numbers make later common denominators easier and make errors easier to spot. Before adding, check that every term has the same denominator. Fractions with different denominators cannot be combined directly.
Common errors
- Adding across denominators. 1/2 + 1/3 is not 2/5. Find a common denominator first.
- Flipping the wrong number. In a ÷ b, only b becomes the reciprocal.
- Adding before multiplying. Multiplication ranks higher than addition, whatever the order on the page.
- Dropping a sign. In 1/2 − 3/4 + 1/4, the minus belongs to 3/4 only. It does not apply to 1/4.
- Stopping partway. After the multiplication step, an addition or subtraction still remains.
Where this leads
When a fraction is written with a horizontal bar, the bar also acts as a grouping symbol, which the next chapter covers. Powers of fractions and negative exponents get fuller treatment later too. Here you only needed the idea that an exponent applies to the whole fraction in parentheses.
Exercise
Evaluate 2/3 + 1/2 ÷ 3/4 and give the result as a fraction in lowest terms.
Show answer
Division comes before addition. 1/2 ÷ 3/4 = 1/2 × 4/3 = 4/6 = 2/3. Then 2/3 + 2/3 = 4/3.
Exercise
Evaluate 5/6 − 1/3 × 3/2. Then write the value of (5/6 − 1/3) × 3/2 and say why the two answers differ.
Show answer
In the first expression, multiply first: 1/3 × 3/2 = 1/2, and 5/6 − 1/2 = 5/6 − 3/6 = 1/3. In the second, the parentheses force the subtraction first: 5/6 − 2/6 = 1/2, and 1/2 × 3/2 = 3/4. The answers differ because the parentheses change which operation happens first.
Exercise
Evaluate 1/2 ÷ 1/4 ÷ 2 from left to right. What is the value of 1/2 ÷ (1/4 ÷ 2)?
Show answer
Left to right: 1/2 ÷ 1/4 = 1/2 × 4 = 2, then 2 ÷ 2 = 1. With the parentheses, 1/4 ÷ 2 = 1/8, and 1/2 ÷ 1/8 = 4.