TExcelTAD
Home › Basic Math & Pre-Algebra › Adding and Subtracting Fractions

Adding and Subtracting Fractions

You can only add parts of the same size, so adding fractions is all about finding a common denominator. This lesson covers like denominators, unlike denominators with the least common denominator, mixed numbers, and exact sums in Python with Fraction.

Same denominator

When the parts are the same size, just count them. Add (or subtract) the numerators and keep the denominator:

29+59=79710−310=410=25(simplify at the end)\begin{aligned} &\frac{2}{9} + \frac{5}{9} = \frac{7}{9} \\ &\frac{7}{10} - \frac{3}{10} = \frac{4}{10} = \frac{2}{5} && \text{(simplify at the end)} \end{aligned}

Note: Never add the denominators. 12+12\frac{1}{2} + \frac{1}{2} is 22=1\frac{2}{2} = 1, not 24\frac{2}{4}. Two halves make a whole, not a half.

Different denominators

13+14\frac{1}{3} + \frac{1}{4} adds thirds and quarters, which are different sizes. First rewrite both as equivalent fractions with a common denominator. The smallest one is the least common denominator (LCD), which is the LCM of the denominators.

13+14LCD=LCM⁡(3,4)=12=412+3121×43×4 and 1×34×3=712\begin{aligned} &\frac{1}{3} + \frac{1}{4} && \text{LCD} = \operatorname{LCM}(3, 4) = 12 \\ &= \frac{4}{12} + \frac{3}{12} && \frac{1 \times 4}{3 \times 4} \text{ and } \frac{1 \times 3}{4 \times 3} \\ &= \frac{7}{12} \end{aligned}

A worked subtraction with a less obvious LCD:

56−38LCD=LCM⁡(6,8)=24=2024−924=1124\begin{aligned} &\frac{5}{6} - \frac{3}{8} && \text{LCD} = \operatorname{LCM}(6, 8) = 24 \\ &= \frac{20}{24} - \frac{9}{24} \\ &= \frac{11}{24} \end{aligned}

You may also use the product of the denominators (6×8=486 \times 8 = 48) as a common denominator. It always works, but the numbers get bigger and you must simplify more at the end: 4048−1848=2248=1124\frac{40}{48} - \frac{18}{48} = \frac{22}{48} = \frac{11}{24}.

Problem LCD Rewritten Result
12+13\frac{1}{2} + \frac{1}{3} 6 36+26\frac{3}{6} + \frac{2}{6} 56\frac{5}{6}
34+16\frac{3}{4} + \frac{1}{6} 12 912+212\frac{9}{12} + \frac{2}{12} 1112\frac{11}{12}
25−110\frac{2}{5} - \frac{1}{10} 10 410−110\frac{4}{10} - \frac{1}{10} 310\frac{3}{10}
78−512\frac{7}{8} - \frac{5}{12} 24 2124−1024\frac{21}{24} - \frac{10}{24} 1124\frac{11}{24}

The general formula

For any ab+cd\frac{a}{b} + \frac{c}{d}:

ab+cd=a⋅d+c⋅bb⋅dthen simplify\frac{a}{b} + \frac{c}{d} = \frac{a \cdot d + c \cdot b}{b \cdot d} \qquad \text{then simplify}

This is what a program does, and simplifying with the GCD keeps the numbers small:

python · try it yourself
import math

def add(a, b, c, d):
    top = a * d + c * b
    bottom = b * d
    g = math.gcd(top, bottom)
    return top // g, bottom // g

print("1/3 + 1/4 =", add(1, 3, 1, 4))
print("5/6 - 3/8 =", add(5, 6, -3, 8))
print("3/4 + 1/4 =", add(3, 4, 1, 4))
1/3 + 1/4 = (7, 12)
5/6 - 3/8 = (11, 24)
3/4 + 1/4 = (1, 1)

Mixed numbers

Turn mixed numbers into improper fractions first; that avoids "borrowing" mistakes:

312−134=72−74=144−74=74=134\begin{aligned} &3\frac{1}{2} - 1\frac{3}{4} \\ &= \frac{7}{2} - \frac{7}{4} \\ &= \frac{14}{4} - \frac{7}{4} \\ &= \frac{7}{4} = 1\frac{3}{4} \end{aligned}

With Fraction

Fraction finds the common denominator and simplifies for you. A recipe needs 34\frac{3}{4} cup of milk, 23\frac{2}{3} cup of water and 1121\frac{1}{2} cups of stock; how much liquid is that, and how much is left from a 4-cup jug?

python · try it yourself
from fractions import Fraction as F

liquids = [F(3, 4), F(2, 3), 1 + F(1, 2)]
total = sum(liquids)
print("total:", total, "cups =", float(total))
print("left in a 4-cup jug:", 4 - total)

# three tenths: exact with Fraction, slightly off with float
print(F(1, 10) + F(1, 10) + F(1, 10), 0.1 + 0.1 + 0.1)
total: 35/12 cups = 2.9166666666666665
left in a 4-cup jug: 13/12
3/10 0.30000000000000004

3512\frac{35}{12} is 211122\frac{11}{12} cups, and 1312=1112\frac{13}{12} = 1\frac{1}{12} cups are left. The last line shows why exact fractions matter: adding 110\frac{1}{10} three times as a float does not give exactly 310\frac{3}{10} (more in Floating Point).

Many small fractions

A sum like 12+14+18+…\frac{1}{2} + \frac{1}{4} + \frac{1}{8} + \ldots gets closer and closer to 1 without reaching it. With Fraction you can watch the exact gap shrink:

python · try it yourself
from fractions import Fraction as F

total = F(0)
for k in range(1, 9):
    total += F(1, 2**k)
    print(f"after {k} terms: {total}   gap to 1: {1 - total}")
after 1 terms: 1/2   gap to 1: 1/2
after 2 terms: 3/4   gap to 1: 1/4
after 3 terms: 7/8   gap to 1: 1/8
after 4 terms: 15/16   gap to 1: 1/16
after 5 terms: 31/32   gap to 1: 1/32
after 6 terms: 63/64   gap to 1: 1/64
after 7 terms: 127/128   gap to 1: 1/128
after 8 terms: 255/256   gap to 1: 1/256

Each step halves the gap. You will meet sums like this again as geometric series in calculus.

In software

  • Music timing. A DAW checks that the note lengths in a bar add up exactly: 14+18+18+12=1 bar\frac{1}{4} + \frac{1}{8} + \frac{1}{8} + \frac{1}{2} = 1 \text{ bar}. With floats, triplet lengths like 112\frac{1}{12} of a bar would leave tiny errors that accumulate.
  • Animation timelines add fractional durations of frames at rates like 24 or 300001001\frac{30000}{1001} fps; keeping them as fractions avoids audio/video drift.
  • Probability: the chances of separate outcomes add (see First Probability), and exact fractions make tests easy to write.

Exercises

Exercise 1: Like denominators

Compute 512+1112\frac{5}{12} + \frac{11}{12} and write the answer as a mixed number in lowest terms.

Answer

1131\frac{1}{3}

Solution
512+1112=1612=43=113(GCF of 16 and 12 is 4)\frac{5}{12} + \frac{11}{12} = \frac{16}{12} = \frac{4}{3} = 1\frac{1}{3} \qquad \text{(GCF of 16 and 12 is 4)}

Exercise 2: Unlike denominators

Compute 34+56−13\frac{3}{4} + \frac{5}{6} - \frac{1}{3}.

Answer

54=114\frac{5}{4} = 1\frac{1}{4}

Solution
LCD=LCM⁡(4,6,3)=1234+56−13=912+1012−412=1512=54=114\begin{aligned} &\text{LCD} = \operatorname{LCM}(4, 6, 3) = 12 \\ &\frac{3}{4} + \frac{5}{6} - \frac{1}{3} = \frac{9}{12} + \frac{10}{12} - \frac{4}{12} = \frac{15}{12} = \frac{5}{4} = 1\frac{1}{4} \end{aligned}

Exercise 3: Mixed-number subtraction

A plank is 5145\frac{1}{4} feet long. You cut off 2232\frac{2}{3} feet. How long is the rest?

Answer

27122\frac{7}{12} feet

Solution
514−223=214−83=6312−3212=3112=2712\begin{aligned} 5\frac{1}{4} - 2\frac{2}{3} &= \frac{21}{4} - \frac{8}{3} \\ &= \frac{63}{12} - \frac{32}{12} \\ &= \frac{31}{12} = 2\frac{7}{12} \end{aligned}
python · try it yourself
from fractions import Fraction as F
print(F(21, 4) - F(8, 3))
31/12

Exercise 4: Does the bar add up?

A bar in 4/4 time holds notes of length 14\frac{1}{4}, 18\frac{1}{8}, 18\frac{1}{8}, then an eighth-note triplet (three notes of 112\frac{1}{12} each) and one more note. Using Fraction, find the length of the last note so the bar adds up to exactly 1.

Answer

14\frac{1}{4} (a quarter note)

Solution
14+18+18=28+18+18=48=12triplet: 3×112=312=14so far: 12+14=34missing: 1−34=14\begin{aligned} &\frac{1}{4} + \frac{1}{8} + \frac{1}{8} = \frac{2}{8} + \frac{1}{8} + \frac{1}{8} = \frac{4}{8} = \frac{1}{2} \\ &\text{triplet: } 3 \times \frac{1}{12} = \frac{3}{12} = \frac{1}{4} \\ &\text{so far: } \frac{1}{2} + \frac{1}{4} = \frac{3}{4} && \text{missing: } 1 - \frac{3}{4} = \frac{1}{4} \end{aligned}
python · try it yourself
from fractions import Fraction as F
notes = [F(1, 4), F(1, 8), F(1, 8), F(1, 12), F(1, 12), F(1, 12)]
print("so far:", sum(notes), " missing:", 1 - sum(notes))
so far: 3/4  missing: 1/4

Test yourself

What is 25+13\frac{2}{5} + \frac{1}{3}?

  1. 38\frac{3}{8}
  2. 1115\frac{11}{15}
  3. 315\frac{3}{15}
  4. 215\frac{2}{15}

What is the least common denominator of 16\frac{1}{6} and 19\frac{1}{9}?

  1. 54
  2. 3
  3. 18
  4. 15

What is 78−14\frac{7}{8} - \frac{1}{4}?

  1. 58\frac{5}{8}
  2. 64\frac{6}{4}
  3. 34\frac{3}{4}
  4. 12\frac{1}{2}