Pipes & Cisterns

RoadmapsAptitude

Scenario

Think of an AWS server scaling up (inlet) while memory leaks crash instances (outlet). Pipes & Cisterns is just Time & Work with negative efficiency.

Mental model

Inlets add work (+), outlets destroy work (-).

The core logic is identical to Time & Work. The only difference is that a leakage or emptying pipe has a negative rate of work. Net rate = sum of all inlets minus sum of all outlets.

Formula

Net rate = sum(inlet rates) - sum(outlet rates). Time to fill = Total Capacity / Net rate. If net rate is negative, Time to empty = Total Capacity / |Net rate|. Inlet rate = 1/T_fill. Outlet rate = 1/T_empty. LCM method: assume capacity = LCM of all times; assign each pipe its units per minute with sign (+/-). Combined time = Capacity / Net rate.

If net rate is positive, the tank fills. If net rate is negative, the tank empties. For problems mixing known fill/empty times with known flow rates (liters/min), convert: Capacity = time x flow rate.

Pattern discovery

Track the net filling rate when an inlet and an outlet work together.

If the outlet were faster than the inlet, what would happen to the net rate?

Rule: Add the rates of filling pipes and subtract the rates of emptying pipes. If net rate is negative, the tank empties rather than fills.

Worked example

Problem: Pipe A fills a tank in 20 hours, Pipe B fills it in 30 hours, and Pipe C empties it in 15 hours. If all three are opened simultaneously when the tank is empty, how long will it take to fill?

  1. Use LCM method: Capacity = LCM(20, 30, 15) = 60 units.
  2. Pipe A fills 60/20 = 3 units/hr (positive). Pipe B fills 60/30 = 2 units/hr (positive). Pipe C empties 60/15 = 4 units/hr (negative).
  3. Net rate = 3 + 2 - 4 = 1 unit/hr.
  4. Time to fill = 60 / 1 = 60 hours.
  5. Sanity-check: 1/20 + 1/30 - 1/15 = 3/60 + 2/60 - 4/60 = 1/60. Time = 60 hours. Matches.

Answer: 60 hours.

Shortcuts

Common mistakes

Glossary

inlets
Pipes that let water or liquid flow in.
outlets
Pipes that let water or liquid flow out.
impossibly
Something that cannot realistically happen.

Recall questions

Questions & answers

Two pipes can fill a tank in 15 and 20 hours. A third pipe can empty it in 30 hours. If all three are opened, how long to fill the tank?

12 hours

Approach: LCM(15, 20, 30) = 60 units. Pipe1 = +4 units/hr, Pipe2 = +3 units/hr, Pipe3 = -2 units/hr. Net = 5 units/hr. Time = 60/5 = 12 hours.

A leak in the bottom of a tank can empty it in 8 hours. An inlet pipe fills water at 6 liters a minute. When both are open, the tank empties in 12 hours. Find the capacity of the tank.

8640 liters

Approach: Leak takes 8h (-1/8 per hr). Let inlet take x hrs (+1/x per hr). Net = 1/x - 1/8 = -1/12. So 1/x = 1/8 - 1/12 = 1/24. Inlet fills in 24 hours. Capacity = 24 hrs x 60 min/hr x 6 L/min = 8640 L.

Continue learning

Previous: Time & Work

Return to Aptitude Roadmap