Sub topic 1
Ratios: meaning, simplification and equivalent forms
Prerequisites
This chapter assumes you can work with fractions, decimals and percentages, find the highest common factor (HCF) of two numbers, and solve simple linear equations. The code needs Python 3.9 or later.
Ratios, simplification and equivalent forms
A ratio compares quantities in the same unit. The ratio a:b means that for every a units of the first quantity, there are b units of the second. To simplify a ratio, divide every term by their HCF. For example, 36:48 becomes 3:4, because the HCF of 36 and 48 is 12.
Equivalent ratios come from multiplying every term by the same nonzero number. So 3:4, 6:8 and 9:12 express the same comparison.
Chaining and comparing ratios
To chain a:b = 2:3 with b:c = 4:5, the shared term b must take one common value. The LCM of 3 and 4 is 12, so scale the first ratio to 8:12 and the second to 12:15. The result is a:b:c = 8:12:15.
from math import lcm
a1, b1 = 2, 3 # a:b
b2, c2 = 4, 5 # b:c
b = lcm(b1, b2) # 12
a = a1 * (b // b1) # 8
c = c2 * (b // b2) # 15
print(a, b, c) # 8 12 15To compare two ratios, cross-multiply. a:b is larger than c:d when a × d > b × c. For 3:4 and 5:7, 3 × 7 = 21 and 4 × 5 = 20, so 3:4 is larger.
Proportion, direct variation and inverse variation
In direct variation, x and y rise together, and x/y stays constant. If 4 kg costs 60 rupees, then 7 kg costs 60 ÷ 4 × 7 = 105 rupees.
In inverse variation, x and y move in opposite directions, and x × y stays constant. If 4 workers finish a job in 6 days, then 8 workers need 3 days, because 4 × 6 = 8 × 3.
Ratios after adding, removing or transferring a quantity
Suppose A:B = 5:3, with A = 50 and B = 30. If 10 units move from A to B, the new values are 40 and 40, so the ratio becomes 1:1. The total stays 80.
Exercise
Two quantities are in the ratio 5:3, and their sum is 96. What is the larger quantity?
Show answer
The parts total 8, so each part is 96 ÷ 8 = 12. The larger quantity is 5 × 12 = 60.