Pipes and Cisterns Model 1: Filling Together, and Filling Against a Drain

Pipes and Cisterns · 25 min

Aptitude · Pipes and Cisterns · Model 1

Twenty and thirty: twelve minutes, or sixty

The same two numbers give wildly different answers depending on which way the second pipe points. This model is the drill that makes that sign automatic, in both the unit method and the two shortcuts worth memorising.

Flip B between filling and draining
Two inlets take ab/(a+b). One inlet against a slower drain takes ab/(b−a). Same product on top; the sign underneath is the whole question.

01 The idea

One pair of numbers, two completely different answers

Pipe A clears a tank in 20 minutes and pipe B clears it in 30. If both are filling, they finish together in 12 minutes. If B is an outlet instead, the tank still fills — but it takes 60 minutes. One word in the question, and the answer moves by a factor of five.

Both answers come out of the same three lines. Take the tank as LCM(20, 30) = 60 units, so A is 3 units a minute and B is 2. If both fill, the net is 3 + 2 = 5 and the time is 60/5 = 12. If B drains, the net is 3 − 2 = 1 and the time is 60/1 = 60.

Two things are worth noticing about the second answer. It is much longer than A’s own 20 minutes, which is the sanity check — a drain can only ever slow the fill down, never speed it up. And it is not the average of anything: nothing in the question is 60 except the answer, so there is no shortcut that skips the rates.

For exactly two pipes there is a product shortcut. Two inlets: ab/(a+b) = 20×30/50 = 12. Inlet against drain: ab/(b−a) = 20×30/10 = 60. Both are just the unit method with the algebra done in advance, and both stop working the moment a third pipe appears.

Write every pipe as a signed number of units a minute, add them, and divide the tank by the total. Whether a pipe fills or empties only changes its sign.
Combined rateThe signed sum of every open pipe. With A at +3 and B at +2 it is 5 units a minute; with B as an outlet it is 1. The tank divided by this is always the answer.
Two-pipe product ruleab/(a+b) for two inlets, ab/(b−a) for an inlet a against a slower outlet b. Valid for two pipes only.
Sanity windowWith inlets only, the joint time is below the fastest pipe’s own time. With a drain open, it is above every inlet’s own time. An answer outside its window is arithmetic gone wrong, not a hard question.

02 Worked example

20 and 30, read both ways

One pair of numbers, two questions. (i) Pipes A and B fill a tank in 20 and 30 minutes. Both are opened — how long? (ii) Now B empties the tank in 30 minutes instead. Both are opened on an empty tank — how long?

1
Fix the tank once, for both partsThe tank does not change between the two questions, so neither do the two rates. Only the sign in front of B does.tank = LCM(20, 30) = 60 units  ⇒  A = 3/min, B = 2/min
2
Part (i): both fillingTwo inlets push the same way, so the rates add.3 + 2 = 5 units/min  ⇒  60 / 5 = 12 minutes
3
Check part (i) against the product ruleFor two inlets the whole thing collapses to a product over a sum.ab/(a+b) = 20×30 / 50 = 600/50 = 12 ✓
4
Part (ii): B now drainsSame two rates, but B’s carries a minus, so it comes off instead of on.3 − 2 = 1 unit/min  ⇒  60 / 1 = 60 minutes
5
Check part (ii), and sanity-check the sizeThe sum becomes a difference. And 60 minutes is longer than A’s own 20, which is exactly what a drain should do.ab/(b−a) = 20×30 / 10 = 600/10 = 60 ✓

The drain is only two thirds of A’s speed, yet it tripled the filling time. That is because what matters is not the ratio of the two rates but their difference: 3 − 2 leaves 1, so the tank creeps up at a third of the rate A manages alone. Push the drain a little faster — to 20 minutes, matching A — and the net becomes zero and the tank never fills at all.

03 The method

The signed sum, and the two products

The general method first, then the two-pipe shortcuts and the exact conditions under which they hold.

time = tank / (sum of signed rates). In fractions, two inlets give 1/a + 1/b and an inlet against a drain gives 1/a − 1/b; the time is the reciprocal either way. This works for any number of pipes.
Two pipes only: ab/(a+b) if both fill, ab/(b−a) if b drains. The second one needs b > a — the drain has to be the slower pipe. If it is not, the formula returns a negative time, which is the algebra telling you the tank never fills. Three or more pipes have no product rule at all, so go back to units.
Question shapeWhat to doOn 20 and 30
Both fillab/(a+b)600/50 = 12 min
A fills, B drains, b > aab/(b−a)600/10 = 60 min
A fills, B drains, b < anever fillsdrain wins outright
Three or more pipessigned unit sumno product rule exists
Joint time given, one pipe unknownnet − known ratesreverse the sum
Adding the timesnever20 + 30 = 50 is not an answer
Averaging the timesnever25 is not an answer either

05 Cheat sheet

Model 1 on one page

Everything here is checked against the 20-and-30 pair, so you can verify each row in your head as you read it.

CaseFormula20 and 30
Two inlets, unitstank / (rA + rB)60/5 = 12 min
Two inlets, productab/(a+b)600/50 = 12 min
Inlet vs slower drainab/(b−a)600/10 = 60 min
Inlet vs equal drainnet 020 vs 20 holds level
Inlet vs faster drainno answer30 in vs 20 out drains
Fractions route1/a ± 1/b1/20 + 1/30 = 1/12
Three pipesunits only8, 12, drain 6 → 24 min
The product rule is two pipes onlyWith three pipes there is no ab/(a+b) analogue, and students who try to apply it pairwise get answers that are close enough to look right. Use units for three.
The drain must be the slower pipeab/(b−a) needs b > a. At b = a the tank holds level forever and below it the tank drains — the formula returns a negative time in that case rather than failing loudly.
Check the answer against its windowTwo inlets: below 20 minutes here. Inlet against drain: above 20 minutes. Getting 25 minutes for either version means a sign or a division went wrong.

06 Where & why

Where this shows up

This is the most-set shape in the chapter, and the version with a hidden third pipe is the standard way of making it harder without making it longer.

TCS NQT · Cognizant
Two pipes, one line of working

Times chosen so ab/(a+b) is clean. Memorising the product rule genuinely saves ten seconds here, which matters in a timed section.

SSC CGL
Find the outlet from the joint time

“A and B fill in 24 and 30 minutes; with C open all three take 20. Find C.” The inlets total 9 units, the joint time forces a net of 6, so C is 3 and takes 40 minutes.

Bank PO
Filled or emptied?

Three pipes with a net that could go either way, as in 25, 40 and a drain at 30. Compute the net sign first; the answer is 600/19 minutes and it fills.

Any capacity model
Supply against demand

A queue with arrivals and departures, or a bank balance with income and spending, is this arithmetic. The interesting cases are all near a net rate of zero.

Every remaining model in this module keeps this signed sum and adds a complication on top: a pipe that shuts part-way, pipes that take turns, or rates given as ratios rather than times. If the sign habit is not automatic yet, it is worth doing the practice set before moving on.

07 Interview questions

What gets asked

Ten, ordered the way an interviewer escalates: the direct sum, then the shortcuts, then the reverse question, then the case with no answer.

Two pipes fill a tank in 20 and 30 minutes. How long together?
12 minutes. Take the tank as 60 units, so the pipes are 3 and 2 a minute, giving 5 together and 60/5 = 12. The product rule agrees: 20×30/50 = 12.
Same two numbers, but the second pipe empties the tank. Now how long?
60 minutes. The rates are still 3 and 2, but the second is negative, so the net is 1 unit a minute and 60/1 = 60. Notice it is longer than the inlet’s own 20 minutes — a drain can only ever slow the fill down.
When can you use ab/(a+b)?
For exactly two pipes, both filling. It is the unit method with the algebra pre-done. With three pipes there is no equivalent, and with one pipe emptying the sum becomes a difference: ab/(b−a).
Why does ab/(b−a) need b to be bigger than a?
Because b is the drain and a the inlet, so b > a means the drain is the slower pipe and the tank gains ground. If b is smaller the denominator goes negative and the formula returns a negative time — which is the algebra saying the tank never fills.
Pipes A and B fill in 24 and 30 minutes, and with outlet C all three fill it in 20. Find C.
40 minutes. Tank 120 units, so A is 5 and B is 4, giving 9 together. Filling in 20 minutes means a net of 120/20 = 6, so C must be removing 9 − 6 = 3 units a minute, and 120/3 = 40 minutes.
Taps fill in 25 and 40 minutes and a third empties in 30. All three open — does it fill or empty?
It fills, in 600/19 minutes, about 31.6. Tank 600 units: the inlets are 24 and 15, so 39 in, against 20 out, leaving a net of +19. Checking the sign of the net first is the whole question; the division is incidental.
Why can you not add or average the times?
Because time is not the additive quantity — rate is. Adding 20 and 30 gives 50 minutes, slower than either pipe alone, which is absurd for two pipes helping each other. Averaging gives 25, still slower than A on its own.
Is 12 minutes for the two-inlet case reasonable, without checking the arithmetic?
Yes, and here is the test. It must be under 20 minutes, the faster pipe’s own time, because help cannot slow you down. And it must be over 10 minutes, that time divided by the number of pipes, because the slower pipe is not as good as a second copy of the fast one. 12 sits in that window.
Two inlets and a drain that exactly cancels them — what is the answer?
There is no filling time. The net rate is zero, so the level holds wherever it started, forever. Pipes at 10 and 15 hours with a drain at 6 do this: 3 + 2 − 5 = 0. The mark is for saying “never”, not for producing a number.
Which method would you actually use under exam time pressure?
Units for anything with three pipes or an unknown pipe, and the product rule for two clean inlets. The fraction route is worth knowing because it is how you would explain the method, but in a timed section it is the slowest of the three.

08 Practice problems

Six on the sign

Two of these are the same numbers with one word changed. Work them in units first, then confirm with the product rule wherever it applies.

Two inlets

Easy
Pipes A and B can fill a tank in 12 and 18 minutes. Both are opened together. Find the time to fill it.
Follow-up
The times share no obvious factor pair, so the product rule gives a fraction. Getting a non-integer answer and not panicking is part of the point.
Show the hint
Tank 36 units: +3 and +2.

Same numbers, one drains

Easy
A pipe fills a tank in 10 hours and an outlet empties the full tank in 15 hours. Both are opened on an empty tank. Find the time to fill it.
Follow-up
The drain is slower than the inlet, so the tank does fill — and the answer is bigger than either number in the question, which is unusual enough to be worth checking twice.
Show the hint
Tank 30 units: +3 and −2, so the net is 1.

Two in, one out

Medium
Pipes A and B fill a tank in 8 and 12 minutes and pipe C empties the full tank in 6 minutes. All three are opened on an empty tank. Find the time to fill it.
Follow-up
Three pipes, so the product rule is unavailable. The net comes out very small, which makes the answer far larger than any single time in the question.
Show the hint
Tank 24 units: +3, +2, −4.

The unknown outlet

Medium
Pipes A and B fill a cistern in 24 and 30 minutes. There is also an outlet C. With all three open the cistern fills in 20 minutes. How long does C alone take to empty the full cistern?
Follow-up
You are given a joint time and asked for a rate, so the sum has to be run backwards. The trap is reading 20 minutes as C’s time rather than as the net.
Show the hint
Turn the 20 minutes into a net rate first, then compare it with what A and B manage between them.

Filled or emptied?

Medium
Tap A fills a tank in 25 minutes, tap B in 40 minutes and tap C empties it in 30 minutes. All three are opened together on an empty tank. Say whether it fills or empties, and in how long.
Follow-up
The question is written to make you assume it fills. Deciding that from the sign of the net, before dividing, is the actual skill being tested — and the LCM here is not small.
Show the hint
LCM(25, 40, 30) = 600. Compare the inlets’ total against the outlet before going further.

How slow must the drain be?

Hard
An inlet fills a tank in 20 minutes. With an outlet also open the tank fills in 60 minutes instead. Find the outlet’s own emptying time. Then find the fastest whole number of minutes the outlet could take and still let the tank fill at all.
Follow-up
The second half turns the never-fills condition into an inequality rather than a yes-or-no check, and the boundary case is excluded rather than included — which is the part people get wrong.
Show the hint
For the tank to fill you need the drain strictly slower than the inlet, so its time must be strictly greater than 20 minutes.