TExcelTAD
Home › Basic Math & Pre-Algebra › Comparing Fractions

Comparing Fractions

Is 58\frac{5}{8} bigger than 35\frac{3}{5}? This lesson gives four reliable ways to compare fractions: same denominators, same numerators, a common denominator, and cross multiplication. It also shows how to sort fractions in Python, and why comparing them as floats can go wrong.

Same denominator: compare the tops

If the parts are the same size, more parts means more: 37<57\frac{3}{7} < \frac{5}{7}. Only the numerators matter.

Same numerator: compare the bottoms (reversed)

If you have the same number of parts, the parts that are bigger win. Bigger denominator means smaller parts, so 38<35\frac{3}{8} < \frac{3}{5}. One fifth of a pizza is a bigger slice than one eighth.

Different numerators and denominators

Method 1: a common denominator

Rewrite both fractions with the same denominator, then compare the numerators. The least common multiple of the denominators is the smallest choice:

58 vs 35LCM⁡(8,5)=4058=254035=244025>24, so 58>35\begin{aligned} &\frac{5}{8} \text{ vs } \frac{3}{5} && \operatorname{LCM}(8, 5) = 40 \\ &\frac{5}{8} = \frac{25}{40} \quad \frac{3}{5} = \frac{24}{40} && 25 > 24,\ \text{so } \frac{5}{8} > \frac{3}{5} \end{aligned}

Method 2: cross multiplication

To compare ab\frac{a}{b} with cd\frac{c}{d} (positive denominators), compare a×da \times d with c×bc \times b:

58 ? 355×5=253×8=2425>24→58>35\frac{5}{8} \ ?\ \frac{3}{5} \qquad 5 \times 5 = 25 \qquad 3 \times 8 = 24 \qquad 25 > 24 \to \frac{5}{8} > \frac{3}{5}

This is Method 1 in disguise: using b×db \times d as the common denominator, the new numerators are a×da \times d and c×bc \times b.

Method 3: benchmarks

Often you can compare with 12\frac{1}{2} or 1 in your head. 49\frac{4}{9} is less than a half (4.5 would be half of 9), and 611\frac{6}{11} is more than a half, so 49<611\frac{4}{9} < \frac{6}{11}. No arithmetic needed.

Pair Quick reason Result
29\frac{2}{9} vs 79\frac{7}{9} same denominator 29<79\frac{2}{9} < \frac{7}{9}
45\frac{4}{5} vs 47\frac{4}{7} same numerator 45>47\frac{4}{5} > \frac{4}{7}
37\frac{3}{7} vs 59\frac{5}{9} benchmark 12\frac{1}{2} 37<59\frac{3}{7} < \frac{5}{9}
78\frac{7}{8} vs 89\frac{8}{9} each is 1 minus a piece: 18>19\frac{1}{8} > \frac{1}{9} 78<89\frac{7}{8} < \frac{8}{9}
1112\frac{11}{12} vs 1314\frac{13}{14} cross: 11×14=15411\times 14 = 154, 13×12=15613\times 12 = 156 1112<1314\frac{11}{12} < \frac{13}{14}

Comparing in Python

Fraction supports <, >, ==, min, max and sorted exactly, and you can mix it with integers:

python · try it yourself
from fractions import Fraction as F

pairs = [(F(5, 8), F(3, 5)), (F(7, 8), F(8, 9)), (F(11, 12), F(13, 14))]
for a, b in pairs:
    sign = "<" if a < b else (">" if a > b else "=")
    print(f"{a} {sign} {b}")

def cross_compare(a, b, c, d):
    return (a * d > c * b) - (a * d < c * b)   # 1, 0 or -1

print(cross_compare(5, 8, 3, 5))

scores = [F(2, 3), F(5, 9), F(7, 10), F(3, 5), F(4, 6)]
print(sorted(scores))
print("largest:", max(scores), " bigger than 1/2?", min(scores) > F(1, 2))
5/8 > 3/5
7/8 < 8/9
11/12 < 13/14
1
[Fraction(5, 9), Fraction(3, 5), Fraction(2, 3), Fraction(2, 3), Fraction(7, 10)]
largest: 7/10  bigger than 1/2? True

Note that 23\frac{2}{3} and 46\frac{4}{6} sort next to each other: they are equal, and Fraction stored 46\frac{4}{6} as 23\frac{2}{3}. Inside a list, Python shows each item with repr, which is why you see Fraction(5, 9) rather than 5/9.

Why not just compare floats?

Converting to decimals works for everyday numbers, but floats have limited precision. Two different fractions that are extremely close can turn into the same float:

python · try it yourself
from fractions import Fraction as F

a = F(10**17 + 1, 10**17)
b = F(10**17 + 2, 10**17)
print("as floats:", float(a), float(b), float(a) == float(b))
print("exactly:  ", a < b)

# cross multiplication with integers never loses precision
print((10**17 + 1) * 10**17 < (10**17 + 2) * 10**17)
as floats: 1.0 1.0 True
exactly:   True
True

Python integers have no size limit, so cross multiplication is always exact. In languages with fixed-size integers (C, Java, Rust), a * d can overflow, which is a real bug in naive comparison code.

In software

  • Ranking by ratio. "Sort products by rating" or "sort players by win rate" compares fractions like winsgames\frac{\text{wins}}{\text{games}}. Sorting with cross multiplication (or Fraction keys) avoids float ties.
  • Computational geometry decides "is this point left of that line?" with cross products of integer coordinates for the same reason: exact answers, no rounding.
  • Scheduling. Proportional-share schedulers pick the task with the smallest "used/allowed\text{used} / \text{allowed}" ratio next.

Exercises

Exercise 1: Pick the bigger one

Compare 47\frac{4}{7} and 59\frac{5}{9} using cross multiplication.

Answer

47>59\frac{4}{7} > \frac{5}{9}.

Solution
4×9=365×7=3536>35 → 47>594 \times 9 = 36 \qquad 5 \times 7 = 35 \qquad 36 > 35 \ \to\ \frac{4}{7} > \frac{5}{9}

Check with a common denominator: 47=3663\frac{4}{7} = \frac{36}{63} and 59=3563\frac{5}{9} = \frac{35}{63}.

Exercise 2: Order them

Put 23\frac{2}{3}, 35\frac{3}{5}, 58\frac{5}{8} and 712\frac{7}{12} in order from smallest to largest.

Answer

712<35<58<23\frac{7}{12} < \frac{3}{5} < \frac{5}{8} < \frac{2}{3}.

Solution

The LCM of 3, 5, 8 and 12 is 120. Rewrite each:

23=8012035=7212058=75120712=70120\begin{aligned} \frac{2}{3} &= \frac{80}{120} \\ \frac{3}{5} &= \frac{72}{120} \\ \frac{5}{8} &= \frac{75}{120} \\ \frac{7}{12} &= \frac{70}{120} \end{aligned}

Order the numerators: 70<72<75<8070 < 72 < 75 < 80.

Exercise 3: Benchmark only

Without any multiplication, decide which is bigger: 910\frac{9}{10} or 1011\frac{10}{11}.

Answer

1011\frac{10}{11} is bigger.

Solution

Each is one piece short of 1: 910=1−110\frac{9}{10} = 1 - \frac{1}{10} and 1011=1−111\frac{10}{11} = 1 - \frac{1}{11}. Since 111\frac{1}{11} is a smaller piece than 110\frac{1}{10}, 1011\frac{10}{11} is closer to 1, so it is bigger.

Exercise 4: Rank players by win rate

Players: Ana won 7 of 12, Bo won 11 of 19, Cy won 4 of 7. Rank them from best to worst win rate with exact fractions in Python.

Answer

Ana (712\frac{7}{12}), Bo (1119\frac{11}{19}), Cy (47\frac{4}{7}).

Solution

The rates are very close, so compare exactly. Ana vs Bo: 7×19=1337 \times 19 = 133 and 11×12=13211 \times 12 = 132, so 712>1119\frac{7}{12} > \frac{11}{19}. Bo vs Cy: 11×7=7711 \times 7 = 77 and 4×19=764 \times 19 = 76, so 1119>47\frac{11}{19} > \frac{4}{7}. In code, use Fraction as the sort key:

python · try it yourself
from fractions import Fraction

players = {"Ana": (7, 12), "Bo": (11, 19), "Cy": (4, 7)}
ranked = sorted(players, key=lambda p: Fraction(*players[p]), reverse=True)
for p in ranked:
    print(p, Fraction(*players[p]), round(float(Fraction(*players[p])), 4))
Ana 7/12 0.5833
Bo 11/19 0.5789
Cy 4/7 0.5714

Test yourself

Which is larger: 34\frac{3}{4} or 57\frac{5}{7}?

  1. 34\frac{3}{4}
  2. 57\frac{5}{7}
  3. They are equal
  4. Cannot tell

Which of these is smallest?

  1. 23\frac{2}{3}
  2. 25\frac{2}{5}
  3. 27\frac{2}{7}
  4. 24\frac{2}{4}

Using the benchmark 12\frac{1}{2}, which comparison is correct?

  1. 512>47\frac{5}{12} > \frac{4}{7}
  2. 512<47\frac{5}{12} < \frac{4}{7}
  3. 512=47\frac{5}{12} = \frac{4}{7}
  4. Benchmarks never work