Sub topic 10
Opposing Rates: Filling and Draining
This chapter covers problems where one process adds to a job and another takes away from it. The standard example is a tank with a fill pipe and a drain. It assumes you can already express work as a rate (job per unit time) and add rates for workers who cooperate. If "1/6 of the job per hour" feels unfamiliar, review those two chapters first.
The Core Idea: Subtract Rates That Work Against Each Other
When two workers help each other, you add their rates. When one process undoes the other, you subtract. The net rate is the rate of the helper minus the rate of the opposer.
- Fill rate: 1 divided by the hours the pipe needs to fill the tank alone.
- Drain rate: 1 divided by the hours the drain needs to empty a full tank alone.
- Net rate: fill rate minus drain rate, with the sign showing the direction.
Take a pipe that fills a tank in 6 hours and a drain that empties it in 12 hours. The pipe adds 1/6 of the tank per hour. The drain removes 1/12 per hour. The net rate is 1/6 − 1/12 = 2/12 − 1/12 = 1/12 tank per hour. Time equals job divided by rate, so filling one tank takes 1 ÷ (1/12) = 12 hours.
from fractions import Fraction
def time_to_fill(fill_hours, drain_hours):
net_rate = Fraction(1, fill_hours) - Fraction(1, drain_hours)
return 1 / net_rate
print(time_to_fill(6, 12)) # 12The function returns exactly 12 because Fraction avoids rounding errors. This code is a correct model only when the fill pipe is faster than the drain, as the next section explains.
Reading the Sign of the Net Rate
The sign of the net rate tells you what actually happens to the tank.
| Net rate | Meaning | What the question can ask |
|---|---|---|
| Positive | Fill rate is larger, so the tank fills | Time to fill from empty |
| Zero | The rates cancel, so the level never changes | Usually a trap or a "never fills" answer |
| Negative | Drain rate is larger, so the tank empties | Time to empty from full |
If the drain is faster than the pipe, the formula 1 / net_rate gives a negative number. A negative time has no meaning here. The correct response is to flip the question: the tank empties, and you take the absolute value of the net rate. Always check which process is faster before you divide.
from fractions import Fraction
def net_time(fill_hours, drain_hours):
net_rate = Fraction(1, fill_hours) - Fraction(1, drain_hours)
if net_rate == 0:
return "never changes"
if net_rate > 0:
return f"fills in {1 / net_rate} hours"
return f"empties in {1 / -net_rate} hours"
print(net_time(6, 12)) # fills in 12 hours
print(net_time(12, 6)) # empties in 12 hours
print(net_time(8, 8)) # never changesWorked Example 1: A Full Tank With Both Open
A full tank is drained by a pipe in 10 hours. A second pipe fills an empty tank in 15 hours. Both are open at once on a full tank. How long until the tank is empty?
- Drain rate is 1/10 tank per hour. Fill rate is 1/15.
- Put the sign on the direction that matters. Emptying is the goal, so call draining positive: net draining rate = 1/10 − 1/15.
- Use the common denominator 30: 3/30 − 2/30 = 1/30 tank per hour.
- Time to empty one full tank is 30 hours.
Notice that the answer, 30 hours, is longer than either single time. That is a useful sanity check. When two processes oppose each other and the stronger one still wins, the job always takes longer than the stronger process alone. If you got 6 hours here, you would know you added the rates by mistake.
Worked Example 2: Several Pipes and Drains
A tank has two fill pipes and one drain. Pipe A fills it in 4 hours, pipe B fills it in 6 hours, and the drain empties it in 3 hours. If all three are open on an empty tank, what happens?
Add all rates that fill, then subtract all rates that drain:
- Fill: 1/4 + 1/6 = 3/12 + 2/12 = 5/12
- Drain: 1/3 = 4/12
- Net: 5/12 − 4/12 = 1/12 tank per hour
The tank fills in 12 hours. Check: the two pipes together fill it in 12/5 = 2.4 hours, and the drain alone empties it in 3 hours. The drain is slower than the pipes together, so the tank does fill, and slowly. That matches the small net rate.
from fractions import Fraction
def net_rate(fills, drains):
total_fill = sum(Fraction(1, t) for t in fills)
total_drain = sum(Fraction(1, t) for t in drains)
return total_fill - total_drain
rate = net_rate([4, 6], [3])
print(rate) # 1/12
print(1 / rate) # 12Worked Example 3: Finding the Missing Rate
GRE questions often give the combined result and ask for one unknown time. Pipe A fills a tank in 6 hours. With a drain also open, the tank takes 9 hours to fill. How long would the drain take to empty a full tank by itself?
Let the drain take d hours. Then:
1/6 − 1/d = 1/9
Solve for 1/d:
1/d = 1/6 − 1/9 = 3/18 − 2/18 = 1/18
So d = 18 hours. Check by substitution: 1/6 − 1/18 = 3/18 − 1/18 = 2/18 = 1/9, which gives 9 hours. This matches the problem.
The general pattern is to keep everything as rates until the last step. Convert to a time only when you have isolated the unknown rate.
Partial Fills and Changing Conditions
Some problems open or close a valve partway through. Treat each stage as its own rate, then add the work done in each stage.
A tank is empty. Pipe A, which fills it in 6 hours, runs alone for 2 hours. Then a drain that empties a full tank in 12 hours opens as well. How much longer until the tank is full?
- Stage one: 2 hours at 1/6 per hour gives 2/6 = 1/3 of the tank.
- Remaining: 1 − 1/3 = 2/3 of the tank.
- Stage two net rate: 1/6 − 1/12 = 1/12 per hour.
- Time for the remainder: (2/3) ÷ (1/12) = (2/3) × 12 = 8 hours.
The tank is full 8 hours after the drain opens. The total elapsed time is 2 + 8 = 10 hours. Read the question carefully, because "how much longer" and "how long in total" give different answers (8 and 10).
from fractions import Fraction
fill = Fraction(1, 6)
drain = Fraction(1, 12)
done = 2 * fill # stage one
remaining = 1 - done # 2/3
extra_hours = remaining / (fill - drain)
print(extra_hours) # 8
print(2 + extra_hours) # 10Common Errors
- Adding the rates that oppose each other. Adding 1/6 and 1/12 gives 1/4 and a time of 4 hours. That is the answer for two cooperating workers, not for fill and drain.
- Subtracting the times. Taking 12 − 6 = 6 hours is wrong. Times do not subtract. Rates do.
- Averaging the times. The average of 6 and 12 is 9, which is also wrong, and it ignores the direction of the drain.
- Ignoring which process is faster. A drain faster than the fill makes the tank empty. A negative result from your arithmetic is a signal, not an answer.
- Forgetting that the drain only has something to remove. On a partly full tank, a drain still removes the same fraction per hour while water remains. The simple model assumes constant rates. A real tank drains more slowly as the level drops, but GRE problems state or imply constant rates.
- Answering the wrong stage. In multi-stage problems, check whether the question asks for time after the change or total time.
Shortcut for Two Processes
For one fill time f and one drain time d, with f < d, the net time is the product divided by the difference:
time = (f × d) / (d − f)
With f = 6 and d = 12, this gives 72 / 6 = 12 hours. The formula comes from 1/f − 1/d = (d − f)/(f × d), then taking the reciprocal. It is fast for two processes, but it fails to extend to three or more, so keep the rate method as your default.
Where This Appears on the GRE
Quantitative Comparison items may ask you to compare, for instance, the time to fill a tank with a drain open against a fixed number. You rarely need exact values. Compute the net rate, or bound it, and compare. Multiple-choice items frequently include the "add the rates" and "subtract the times" results as wrong answers, so a quick sign and size check removes them.
Exercise
A pool fills in 8 hours through an inlet pipe and empties in 24 hours through a drain. Starting empty, with both open, how many hours does the pool take to fill?
Show answer
Fill rate is 1/8 and drain rate is 1/24. Net rate is 3/24 − 1/24 = 2/24 = 1/12 pool per hour. The pool fills in 12 hours. Check with the shortcut: (8 × 24) / (24 − 8) = 192 / 16 = 12.
Exercise
An inlet pipe fills a tank in 5 hours. When a drain is also open, the tank fills in 8 hours. How long does the drain alone take to empty a full tank?
Show answer
Write 1/5 − 1/d = 1/8. Then 1/d = 1/5 − 1/8 = 8/40 − 5/40 = 3/40, so d = 40/3 hours, which is about 13.33 hours or 13 hours 20 minutes.
Exercise
A full tank has a drain that empties it in 4 hours. An inlet pipe that fills an empty tank in 6 hours is opened at the same time as the drain. How long until the tank is empty?
Show answer
Net draining rate is 1/4 − 1/6 = 3/12 − 2/12 = 1/12 tank per hour. The tank empties in 12 hours.
Exercise
A tank is empty. An inlet that fills it in 10 hours runs alone for 4 hours. Then a drain that empties a full tank in 5 hours opens. What happens to the tank after that, and when is it empty?
Show answer
After 4 hours the tank holds 4/10 = 2/5 of its capacity. With the drain open, the net rate is 1/10 − 1/5 = −1/10 tank per hour, so the tank is emptying. It empties the 2/5 in (2/5) ÷ (1/10) = 4 hours, which is 8 hours after the start. It never fills.