Beginner to intermediate

Aptitude and Reasoning for Campus Placements

Thirteen chapters of quantitative aptitude, data interpretation, logical reasoning and verbal ability with worked problems, shortcuts, common traps and answer-checked practice sets.

Chapter 4 of 13Quantitative aptitude · Ratio, Proportion, Averages and Mixtures

Ratio, Proportion, Averages, Mixtures and Alligation

Ratios, averages and mixtures are the connective tissue of quantitative aptitude: they appear on their own and inside almost every word problem. The central habit is to turn a messy statement into parts (a ratio) or into a weighted average, then do one clean calculation. Every worked answer is checked by computation.

1. Ratio

A ratio compares two quantities of the same kind. It is unchanged when both terms are multiplied or divided by the same non-zero number.

  • Compound ratio of and is .
  • Duplicate ratio of is ; sub-duplicate is .
  • If and , to chain them make the common term equal: and have LCM 12, so scale: , , giving .
  • To divide a quantity in the ratio : the parts are and .
from fractions import Fraction
from math import lcm

def chain(ab, bc):
    (a, b), (b2, c) = ab, bc
    m = lcm(b, b2)
    return (a * m // b, m, c * m // b2)

assert chain((3, 4), (6, 7)) == (9, 12, 14)
assert [Fraction(2, 5) * 1500, Fraction(3, 5) * 1500] == [600, 900]

Example 1. Rs 7,200 is divided among A, B, C in the ratio 2 : 3 : 4. Shares? Total parts 9, each part Rs 800: Rs 1,600, 2,400, 3,200.

Example 2. The ratio of boys to girls is 5 : 3. After 12 more girls join, it becomes 5 : 4. Find the number of boys. Let boys , girls : , so , , . Boys .

Example 3. Two numbers are in the ratio 3 : 5, and if 9 is subtracted from each the ratio becomes 12 : 23. Find the numbers. gives , so , . Numbers: 33 and 55.

assert [800 * p for p in (2, 3, 4)] == [1600, 2400, 3200] and 7200 // 9 == 800
assert 5 * 12 == 60 and Fraction(5 * 12, 3 * 12 + 12) == Fraction(5, 4)
assert (3 * 11, 5 * 11) == (33, 55) and Fraction(33 - 9, 55 - 9) == Fraction(12, 23)

Proportion

means . Direct proportion: one rises as the other rises ( constant). Inverse proportion: one rises as the other falls ( constant).

Example 4. 15 men can build a wall in 24 days. How many days will 20 men take? Inverse: , so .

Example 5. A car travels 180 km using 12 litres. Fuel for 450 km? Direct: litres.

assert 15 * 24 / 20 == 18
assert 450 / 180 * 12 == 30

Partnership

Profit is shared in proportion to capital × time.

Example 6. A invests Rs 6,000 for 12 months and B invests Rs 8,000 for 9 months. Profit Rs 13,200. Shares? and : equal, so each gets Rs 6,600.

assert 6000 * 12 == 8000 * 9 and 13200 / 2 == 6600

2. Averages

. The sum is the useful quantity: sum = average × count.

  • Adding or removing an item: new sum = old sum the item.
  • Average of consecutive integers or an arithmetic progression = the middle value = (first + last)/2.
  • Average of the first natural numbers ; of the first even numbers ; of the first odd numbers .
  • If every value is changed by (added, multiplied), the average changes the same way.
  • Weighted average: .
nums = list(range(1, 21))
assert sum(nums) / len(nums) == (20 + 1) / 2
assert sum(range(2, 41, 2)) / 20 == 20 + 1
assert sum(range(1, 40, 2)) / 20 == 20
assert (30 * 40 + 20 * 25) / 50 == 34                          # weighted average of two groups

Example 7. The average of 5 numbers is 24. If one number is removed, the average becomes 22. Which number was removed? Old sum , new sum , so removed .

Example 8. The average age of 30 students is 14 years. When the teacher's age is included, the average becomes 15. Teacher's age? Total with teacher ; students' total ; teacher .

Example 9. The average of 11 numbers is 50. The average of the first six is 49 and of the last six is 52. Find the sixth number. Sum of first six , last six , together , which counts the sixth twice. Sixth .

Example 10. A batsman has an average of 40 after 20 innings. How many must he score in the 21st to raise the average to 42? Needed total ; current total ; score .

assert 5 * 24 - 4 * 22 == 32
assert 31 * 15 - 30 * 14 == 45
assert 6 * 49 + 6 * 52 - 11 * 50 == 56
assert 21 * 42 - 20 * 40 == 82

Average speed over equal distances is the harmonic mean, not the arithmetic mean: for speeds and over equal distances, . Over equal times it is the arithmetic mean.

Example 11. A man goes at 40 km/h and returns at 60 km/h. Average speed? km/h.

assert 2 * 40 * 60 / (40 + 60) == 48
d = 120
assert abs(2 * d / (d / 40 + d / 60) - 48) < 1e-9

3. Mixtures and alligation

Alligation finds the ratio in which two ingredients at different values must be mixed to reach a target. If the cheaper has value , the dearer value , and the mean is :

<!--fig:alligation-->
Alligation: mix rice at Rs 40 and Rs 60 to get a mixture worth Rs 52 CheaperRs 40 per kg DearerRs 60 per kg Mean priceRs 52 per kg 60 - 52 = 8parts of the cheaper 52 - 40 = 12parts of the dearer Cheaper : dearer= 8 : 12 = 2 : 3 Figure 1. The cross rule: each ingredient's quantity is proportional to the other's distance from the mean.

(The cheaper's quantity is proportional to the distance of the dearer from the mean: the cross rule.)

Example 12. In what ratio must rice at Rs 40/kg be mixed with rice at Rs 60/kg to get a mixture worth Rs 52/kg? Cheaper : dearer .

Example 13. 20 litres of a 30% milk solution is mixed with 30 litres of a 45% solution. Milk percentage of the mixture? Milk litres in 50 litres .

Example 14. How much water must be added to 40 litres of a 25% alcohol solution to make it 20%? Alcohol litres. For 20%, total litres, so add 10 litres of water.

def alligation(cheap, dear, mean):
    return (dear - mean, mean - cheap)

assert alligation(40, 60, 52) == (8, 12)
assert (20 * 30 + 30 * 45) / 50 == 39.0
assert 40 * 0.25 / 0.20 - 40 == 10

Replacement problems

If a vessel holds litres of a liquid and litres are removed and replaced with water, times, the quantity of the original liquid left is

Example 15. A 40-litre vessel is full of milk. 4 litres are removed and replaced with water; the process is repeated once more. How much milk remains? litres.

assert abs(40 * (1 - 4 / 40) ** 2 - 32.4) < 1e-9

# simulate it step by step
milk, total = 40.0, 40.0
for _ in range(2):
    milk -= 4 * (milk / total)          # remove 4 litres of the current mixture, taking milk in proportion
assert abs(milk - 32.4) < 1e-9

Mixtures with cost and profit

Example 16. A shopkeeper mixes 15 kg of sugar at Rs 40/kg with 25 kg at Rs 48/kg and sells the mixture at Rs 50/kg. Profit %? Cost for 40 kg, i.e. Rs 45 per kg. Selling at 50: profit .

cost = 15 * 40 + 25 * 48
assert cost == 1800 and cost / 40 == 45
assert round((50 - 45) / 45 * 100, 2) == 11.11

4. Age problems

Convert the statement into equations with ages now, then adjust by the same number of years for everyone.

Example 17. The sum of the ages of a father and son is 60. Six years ago the father was 5 times as old as the son. Their present ages? Let son , father : , so , , . Son 14, father 46.

Example 18. The ratio of A's and B's present ages is 4 : 5; after 8 years it will be 5 : 6. Present ages? gives , so : A = 32, B = 40.

s = 14
assert 60 - s - 6 == 5 * (s - 6) and (s, 60 - s) == (14, 46)
k = 8
assert Fraction(4 * k + 8, 5 * k + 8) == Fraction(5, 6) and (4 * k, 5 * k) == (32, 40)

5. Quick shortcuts

  • Sum fixed, ratio given: find the value of one part by dividing the total by the sum of the ratio terms.
  • Percentage to ratio: 20% of A = 25% of B means .
  • Average of two groups: the combined average lies between the group averages, closer to the larger group's average (use the weighted average, or alligation).
  • Equal costs and different rates: the average rate is the harmonic mean.
  • Mixture of the same total: use the cross rule for the ratio, and multiply by the total divided by the sum of the ratio terms.
assert Fraction(25, 20) == Fraction(5, 4)               # 0.20 A = 0.25 B means A : B = 5 : 4
a, b = 5, 4
assert 0.20 * a == 0.25 * b

6. Common traps

  • Adding ratios instead of keeping parts consistent.
  • Using the arithmetic mean for average speed over equal distances.
  • Mixing up which side the cross rule takes in alligation (cheaper's quantity is proportional to the dearer's distance from the mean).
  • Forgetting that "after years" changes both ages by the same number.
  • Percentage versus percentage points when comparing concentrations.
  • Removing a different amount each time in replacement problems: the formula needs the same amount.

7. Practice set with answers

  1. Divide Rs 5,200 in the ratio .
  2. The average of 8 numbers is 30. Two of them, 18 and 22, are replaced by 28 and 36. What is the new average?
  3. A mixture of milk and water is in the ratio 7 : 3. How much water must be added to 40 litres of it to make the ratio 7 : 5?
  4. Two vessels contain milk and water in the ratios 2 : 3 and 4 : 1. In what ratio should they be mixed so that the result has equal quantities of milk and water?
  5. The average age of a class of 40 students is 12. When 5 new students join, the average becomes 13. What is the average age of the new students?
  6. The ratio of the ages of A and B is 5 : 3, and the sum of their ages 4 years ago was 32. Find A's present age.
  7. A person buys oranges at 4 for Rs 30 and sells them at 3 for Rs 30. What is the profit percentage?
  8. In what ratio must water be mixed with milk costing Rs 60 per litre to get a mixture worth Rs 48 per litre?
# 1: the ratio 1/2 : 1/3 : 1/4 is 6 : 4 : 3, with 13 parts of Rs 400 each
parts = [Fraction(1, 2), Fraction(1, 3), Fraction(1, 4)]
assert [5200 * x / sum(parts) for x in parts] == [2400, 1600, 1200]
# 2: replace 40 with 64 in a total of 240
assert (8 * 30 - 18 - 22 + 28 + 36) / 8 == 33
# 3: 40 litres in 7 : 3 hold 28 milk and 12 water; adding 8 litres gives 28 : 20 = 7 : 5
assert Fraction(28, 12 + 8) == Fraction(7, 5)
# 4: milk fractions 2/5 and 4/5, target 1/2
low, high, mean = Fraction(2, 5), Fraction(4, 5), Fraction(1, 2)
assert (high - mean) / (mean - low) == 3                       # first : second = 3 : 1
# 5: 45 students at 13 total 585; the old 40 total 480
assert (45 * 13 - 40 * 12) / 5 == 21
# 6: the present sum is 32 + 8 = 40, split 5 : 3
assert 40 * 5 // 8 == 25 and 40 * 3 // 8 == 15 and (25 - 4) + (15 - 4) == 32
# 7: cost Rs 7.50 each, selling price Rs 10 each
assert round((10 - 7.5) / 7.5 * 100, 2) == 33.33
# 8: water is worth 0; water : milk = (60 - 48) : (48 - 0)
assert alligation(0, 60, 48) == (12, 48) and Fraction(12, 48) == Fraction(1, 4)

Answers: 1) Rs 2,400, Rs 1,600 and Rs 1,200; 2) 33; 3) 8 litres; 4) 3 : 1; 5) 21 years; 6) 25 years; 7) ; 8) 1 : 4.

Header Logo