When two ingredients of different prices (or concentrations) are mixed, the mixture's value lies between the two. Alligation is a quick way to find the ratio in which they must be mixed.
Rule of alligation: with cheaper value c, dearer value d and mean value m,
Cheaper : Dearer = (d − m) : (m − c)
The same rule works for any weighted average: prices, percentages of milk or alcohol, marks of two groups, speeds over equal times.
Worked example 1: Rice at ₹40/kg and ₹55/kg is mixed so that the mixture costs ₹45/kg. Ratio = (55 − 45) : (45 − 40) = 10 : 5 = 2 : 1. Check: (2 × 40 + 1 × 55)/3 = 135/3 = 45 ✓.
Worked example 2 (changing a ratio): 20 litres of milk and water are in the ratio 3 : 1, so 15 L milk and 5 L water. How much water makes it 3 : 2? Milk stays 15, so water must be 10 → add 5 litres.
Repeated replacement: a vessel holds x litres of pure liquid; y litres are taken out and replaced with water, n times. Liquid left = x(1 − y/x)ⁿ.
Worked example 3: 40 L of milk; 4 L removed and replaced with water twice. Milk left = 40 × (1 − 4/40)² = 40 × 0.81 = 32.4 L.
Common traps: writing the ratio the wrong way round (the cheaper quantity goes with d − m), using a mean that is not the cost price (if a profit is mentioned, first find the CP of the mixture), and treating repeated replacement as simple subtraction (4 L twice does not remove 8 L of milk).