Sub topic 10
Net Filling and Emptying Time
This chapter assumes you are comfortable with fractions and reciprocals, with the work = rate × time relation, and with the LCM method for choosing a total amount of work. Here you apply them to a cistern (a tank) with several pipes. Each pipe is a rate, and the net rate decides how long the tank takes to fill or empty.
The model: pipes are signed rates
A pipe that fills a tank in t hours has a rate of 1/t of the tank per hour. We call it an inlet and give it a positive sign. A pipe that empties a full tank in t hours is an outlet, and its rate is -1/t.
When several pipes run together, add the signed rates:
- net rate = sum of inlet rates − sum of outlet rates
- time to fill (or empty) a whole tank = 1 / |net rate|
The sign of the net rate tells you what happens:
| Net rate | What happens | Time to complete | Column | Column |
|---|---|---|---|---|
| Positive | The tank fills | 1 / net rate | ||
| Negative | The tank empties | 1 / \ | net rate\ | |
| Zero | The level never changes | Never |
This is the same "add the rates" rule as for workers. The only new idea is that some workers undo work.
Worked example 1: one inlet and one outlet
An inlet fills a tank in 6 hours. An outlet empties the full tank in 10 hours. With both open, how long does the empty tank take to fill?
Net rate = 1/6 − 1/10 = 5/30 − 3/30 = 2/30 = 1/15 of the tank per hour. The tank fills in 15 hours.
from fractions import Fraction
inlet = Fraction(1, 6) # fills the tank in 6 hours
leak = Fraction(-1, 10) # empties the tank in 10 hours (negative rate)
net = inlet + leak
print(1 / net) # 15The answer (15 h) is longer than the inlet alone (6 h). That is the first sanity check: adding an outlet can only slow filling down.
Worked example 2: LCM units
Use the LCM method when there are three or more pipes. Pipes A and B fill a tank in 12 and 20 hours. Pipe C empties it in 30 hours. How long does it take to fill the empty tank with all three open?
- The LCM of 12, 20 and 30 is 60. Take the capacity as 60 units.
- A fills 60/12 = 5 units per hour. B fills 60/20 = 3 units per hour. C removes 60/30 = 2 units per hour.
- Net rate = 5 + 3 − 2 = 6 units per hour.
- Time = 60 / 6 = 10 hours.
from math import lcm
capacity = lcm(12, 20, 30)
rates = [capacity // 12, capacity // 20, -(capacity // 30)]
net = sum(rates)
print(capacity / net) # 10.0The capacity of 60 units is an invented number. Any common multiple gives the same time, because the capacity cancels in the division.
Two pipes, one formula
For two inlets with times a and b, the combined time is ab/(a + b). For one inlet with time a and one outlet with time b, where b > a, the time is ab/(b − a).
Check with example 1: a = 6, b = 10, so 60 / 4 = 15 hours. This matches.
The condition b > a matters. If the outlet is faster than the inlet (b < a), the formula gives a negative number. That negative sign means the tank never fills. It empties instead, and the time to empty is ab/(a − b).
Direction of the answer: filling versus emptying
Read the question to see what the starting state is and what it asks for:
- An empty tank with a positive net rate: the question is "how long to fill".
- A full tank with a negative net rate: the question is "how long to empty".
- An empty tank with a negative net rate: nothing happens. The outlet has nothing to remove, and a question that asks for a fill time is a trap or a mistake.
Here is an example. A full tank has an inlet that fills it in 8 hours and an outlet that empties it in 5 hours. With both open, how long does it take to empty?
Net rate = 1/8 − 1/5 = 5/40 − 8/40 = −3/40. The tank loses 3/40 of its volume per hour, so it empties in 40/3 = 13⅓ hours.
from fractions import Fraction
net = Fraction(1, 8) - Fraction(1, 5)
print(net) # -3/40
print(1 / abs(net)) # 40/3Several outlets and mixed pipes
The rule stays the same with any number of pipes. Add every inlet as positive and every outlet as negative, then take the reciprocal of the absolute value.
Take three pipes. P fills in 4 hours, Q fills in 6 hours, and R empties in 3 hours. The net rate is 1/4 + 1/6 − 1/3 = 3/12 + 2/12 − 4/12 = 1/12. The empty tank fills in 12 hours.
A common error is to find the time for P and Q together (12/5 h) and then subtract R's time (3 h). Times are not additive. Only rates are.
from fractions import Fraction
rates = {"P": Fraction(1, 4), "Q": Fraction(1, 6), "R": Fraction(-1, 3)}
net = sum(rates.values())
print(net) # 1/12
print(1 / net) # 12Finding a missing pipe
Many CAT questions give the combined result and ask for one pipe. Rearrange the same equation.
Pipe A fills a tank in 9 hours. With a second pipe B also open, the tank fills in 6 hours. How long does B alone take to fill it?
B's rate = combined rate − A's rate = 1/6 − 1/9 = 3/18 − 2/18 = 1/18. So B alone takes 18 hours.
If B had turned out negative, B would be an outlet. For example, if A fills in 6 hours and the combined time is 9 hours, then B's rate = 1/9 − 1/6 = −1/18. B is an outlet that empties a full tank in 18 hours. The sign of the answer tells you which kind of pipe it is.
from fractions import Fraction
def missing_pipe(known, combined_time):
"""Return the signed rate of the unknown pipe."""
return Fraction(1, combined_time) - Fraction(1, known)
b = missing_pipe(9, 6)
print(b, "->", 1 / b) # 1/18 -> 18
b = missing_pipe(6, 9)
print(b, "->", 1 / abs(b), "h") # -1/18 -> 18 hPartial fills and partial emptying
Often the tank starts partly full, or the question asks for part of a tank. Use the same net rate and scale the time by the fraction that must change:
time = (fraction of the tank to change) / |net rate|
Take the earlier tank with a net rate of 1/15 per hour. If it is already 1/3 full, it needs 2/3 more. The time is (2/3) / (1/15) = 10 hours. If it should be filled only to 3/5 of its capacity from empty, the time is (3/5) × 15 = 9 hours.
For an emptying tank, use the amount that has to leave. A tank that is half full and has a net rate of −1/20 per hour empties in (1/2) / (1/20) = 10 hours.
Flow chart of the method
Sanity checks
Run these checks after you get an answer.
- Inlets only. The combined time must be shorter than the fastest inlet's own time.
- One inlet and one outlet. If the outlet is slower than the inlet, the fill time must be longer than the inlet's own time. If the outlet is faster, the tank cannot fill.
- Units. If pipe times are in minutes and the answer is asked in hours, convert at the end. Mixing the units in the middle is the most common arithmetic slip.
- Equal rates. An inlet and an outlet with the same time cancel exactly. The tank does not fill.
Common errors
- Subtracting times. Writing 6 − 10 for an inlet of 6 hours and an outlet of 10 hours has no meaning. Convert to rates first.
- Forgetting the sign of an outlet. Adding all the fractions as positive gives a fill time that is too short.
- Treating "never" as an answer to compute. A zero or negative net rate with an empty tank needs a sentence, not a division.
- Using the wrong total. The "1" in the rate stands for the whole tank. If a question gives a capacity in litres, you can use it, but it cancels out. Only use litres when the answer is requested in litres.
Litres per minute
Sometimes the question gives flow in litres per minute. Then rates are already in useful units, and you do not need the LCM method.
An inlet delivers 40 L/min and an outlet removes 25 L/min. A tank holds 900 L. The net rate is 15 L/min, so the empty tank fills in 900 / 15 = 60 minutes.
capacity = 900
net = 40 - 25 # litres per minute
print(capacity / net) # 60.0If the question gives both the time of each pipe and a capacity, then the capacity and times together give the litres per minute of each pipe. A pipe that fills 900 L in 30 minutes delivers 30 L/min.
Summary of formulas
| Situation | Formula | Column | Column |
|---|---|---|---|
| Inlet rate | 1 / (time to fill) | ||
| Outlet rate | −1 / (time to empty) | ||
| Net rate | Sum of signed rates | ||
| Time to fill or empty a whole tank | 1 / \ | net rate\ | |
| Inlet a, outlet b (b > a) | ab / (b − a) | ||
| Two inlets a and b | ab / (a + b) | ||
| Part of the tank | fraction / \ | net rate\ |
Exercise
Pipes A and B fill a tank in 15 and 20 hours. Pipe C empties a full tank in 12 hours. The tank is empty, and all three pipes are opened together. How long does the tank take to fill?
Show answer
Use a capacity of 60 units. A adds 60/15 = 4 units per hour, B adds 60/20 = 3 units per hour, and C removes 60/12 = 5 units per hour. The net rate is 4 + 3 − 5 = 2 units per hour, so the time is 60 / 2 = 30 hours.
Exercise
A tank is full. An inlet fills it in 8 hours and an outlet empties it in 5 hours. With both open, how long does it take to empty the tank? Why is the question not about filling?
Show answer
The net rate is 1/8 − 1/5 = −3/40 of the tank per hour. The tank empties in 40/3 hours, which is 13 hours 20 minutes. The net rate is negative, so the outlet wins and the level falls. The tank cannot fill.
Exercise
Pipe A fills a tank in 12 hours. With pipe B also open, the empty tank fills in 8 hours. What does B do alone, and how long does it take?
Show answer
B's rate is 1/8 − 1/12 = 3/24 − 2/24 = 1/24. It is positive, so B is an inlet that fills the tank alone in 24 hours.