Two pipes fill a cistern in 36 and 45 minutes. A waste pipe can empty it in 30 minutes. If all three are opened together, how long does the cistern take to fill?
60 minutes. With 180 units: the inlets add 5 and 4 a minute and the waste pipe removes 6, so the net is 3 units a minute and 180/3 = 60 minutes.
Explain it simply
Here the waste pipe on its own is faster than either inlet, but slower than both inlets together, so the cistern still fills, just slowly. Before dividing, always check that the net rate is positive; if it were negative, the cistern would never fill.
Example
Question: Inlets: 36 min and 45 min. Waste pipe: 30 min. All open.
- Cistern = LCM(36, 45, 30) = 180 units.
- Inlet 1 = 180/36 = +5, inlet 2 = 180/45 = +4, waste = 180/30 = -6.
- Net = 5 + 4 - 6 = +3 units per minute.
- Time = 180 / 3 = 60 minutes.
Fraction check: 1/36 + 1/45 - 1/30 = 5/180 + 4/180 - 6/180 = 3/180 = 1/60.
const c = 180;
console.log(c / (c / 36 + c / 45 - c / 30)); // Output: 60Follow-up: if the waste pipe could empty it in 20 minutes instead (9 units a minute), the net rate would be 0. The water level would never rise.
What to say in the interview
"With 180 units, the inlets add 5 and 4 a minute and the waste pipe removes 6, so it gains 3 a minute and fills in 60 minutes. I check the net is positive before dividing."
Common mistakes
- Picking an LCM that is not divisible by all three times.
- Not noticing when the net rate is zero or negative.