intermediate20 min

Time and Work

Modeling work as a daily rate, combining multiple workers' rates, and applying the same idea to pipes filling and draining a tank.

What you'll learn

  • Express a worker's output as a fraction of the job completed per day
  • Compute the time needed for multiple workers to complete a job together by combining their rates
  • Solve a pipes-and-cisterns problem by treating an outlet as a negative rate

Prerequisites

Explanation

The single idea underlying every time-and-work problem: if a worker can finish a job alone in n days, they complete 1/n of the job per day — that's their work rate. Everything else follows from combining rates, exactly the way you'd combine speeds.

Combining workers. When multiple people work together, their rates simply add, because in one day they collectively produce the sum of what each produces alone: combined rate = 1/d₁ + 1/d₂ + … Once you have the combined rate, the time to finish the whole job together is the reciprocal: time = 1 / combined rate.

Worked example. Worker A can finish a job alone in 10 days, worker B in 15 days. A's rate is 1/10 of the job per day, B's rate is 1/15. Combined rate = 1/10 + 1/15. Using a common denominator of 30: 3/30 + 2/30 = 5/30 = 1/6. So together they finish 1/6 of the job per day, meaning the whole job takes 6 days — noticeably faster than either alone, but not simply the average of 10 and 15 (which would incorrectly suggest 12.5 days).

Pipes and cisterns are the same rate-combining idea, with one twist: an inlet pipe fills the tank (a positive rate, like a worker), while an outlet pipe or a leak empties it (a negative rate, subtracting from the combined rate). If a tank has both open at once, net rate = (sum of inlet rates) − (sum of outlet rates).

Worked example. A tap can fill a tank alone in 6 hours; a drain can empty a full tank alone in 8 hours. If both are open together, net rate = 1/6 − 1/8. Common denominator 24: 4/24 − 3/24 = 1/24. So the tank fills at a net rate of 1/24 per hour, taking 24 hours to fill — much slower than the tap alone, because the drain is constantly working against it. If the outlet's rate were ever larger than the inlet's rate, the net rate would be zero or negative, and the tank would never fill at all (or would stay empty/draining forever) — a case worth checking for before trusting a "time to fill" answer.

The pattern to hold onto: never average "days to finish alone" directly. Always convert to rates (1/days), combine the rates (add for teammates and inlets, subtract for outlets/leaks), and only convert back to time — as a reciprocal — at the very last step.

Example

Combined work rates add; the time to finish together is the reciprocal of the combined rate.

function timeToFinish(daysList) {
  const combinedRate = daysList.reduce((sum, d) => sum + 1 / d, 0);
  return Math.round((1 / combinedRate) * 100) / 100;
}
// Example: timeToFinish([10, 15]) -> 6

Guided exercise

Guided exercise

Write combinedWorkDays(daysList) where daysList is an array of the number of days each worker would take to finish the job alone. Return the number of days for all of them working together to finish the job, rounded to 2 decimal places, by summing their rates (1/days each) and taking the reciprocal.

Checks: Combines two workers' rates correctly · Combines three workers' rates, with a non-integer result · plus 1 hidden check

Code editor. Press Escape then Tab to leave the editor if keyboard focus becomes trapped. Press Control+Shift+M inside the editor to toggle Tab-key focus trapping.

Loading editor…

Stuck? Get a hint.

Independent exercise

Independent exercise

Write pipeFillTime(inletHours, outletHours) modeling a tank with one inlet pipe (fills it alone in inletHours) and one outlet pipe (empties it alone in outletHours), both open together. Return the hours to fill the tank, rounded to 2 decimal places, using net rate = 1/inletHours - 1/outletHours. If the net rate is zero or negative, return null (the tank never fills).

Checks: Computes fill time for a slower outlet than inlet · Computes fill time for a different inlet/outlet pair · plus 1 hidden check

Code editor. Press Escape then Tab to leave the editor if keyboard focus becomes trapped. Press Control+Shift+M inside the editor to toggle Tab-key focus trapping.

Loading editor…

Stuck? Get a hint.

Common mistakes

  • Averaging the number of days each worker takes alone (like (10+15)/2) instead of combining their rates and taking the reciprocal of the sum.
  • Adding an outlet or leak's rate instead of subtracting it, which overstates how fast the tank fills.
  • Confusing 'days to finish the job alone' with 'fraction of the job completed per day' -- these are reciprocals of each other, not the same number.

Knowledge check

Knowledge check

1. If a worker can complete a task alone in 8 days, what fraction of the task does she complete in one day?
2. Machine X can pack a batch of orders alone in 12 hours, and Machine Y can pack the same batch alone in 6 hours. Working together, how long will they take?
3. A tap can fill a tank alone in 5 hours, while a leak can empty the full tank alone in 20 hours. If both act together on an empty tank, how long does it take to fill?

Takeaway

Time-and-work problems always convert to rates (1/days) before combining anything, adding rates for teammates and inlets and subtracting for outlets, only converting back to time at the very end.

Summary

A worker's daily output is 1 divided by the days they'd take alone, and combined work is found by adding individual rates, then taking the reciprocal for the combined time. Pipes and cisterns follow the identical logic, with an outlet or leak's rate subtracted rather than added -- and if the net rate is zero or negative, the tank never actually fills.

Your notes

Notes save automatically.

Finished this lesson?

Mark it complete to track your progress and schedule a future review.