Beginner to intermediate

Aptitude and Reasoning for Campus Placements

Thirteen chapters of quantitative aptitude, data interpretation, logical reasoning and verbal ability with worked problems, shortcuts, common traps and answer-checked practice sets.

Chapter 5 of 13Quantitative aptitude · Time and Work, Pipes and Cisterns

Time and Work, Pipes and Cisterns

Time-and-work questions look varied, but they share one idea: work done = rate × time. If you pick the total work as a convenient number (usually the LCM of the given times), every rate becomes a whole number and the algebra disappears. Pipes and cisterns are the same problem with taps in place of workers. Every answer here is checked by computation.

1. The core idea

If a worker finishes a job in days, their rate is of the job per day. Rates of people working together add. So if A takes days and B takes days, together they take

The LCM method. Let the total work be the LCM of the times; then each person's daily work is an integer.

Example 1. A can do a job in 12 days and B in 18 days. How long together? Total work units. A does 3 per day, B does 2 per day, together 5 per day. Time days.

from fractions import Fraction
from math import lcm, gcd

def together(*days):
    return 1 / sum(Fraction(1, d) for d in days)

assert together(12, 18) == Fraction(36, 5)
assert lcm(12, 18) == 36 and 36 // 12 + 36 // 18 == 5
assert together(10, 15) == 6 and together(6, 6, 6) == 2

Example 2. A and B together can do a job in 10 days; A alone in 15 days. How long would B alone take? B's rate , so 30 days.

Example 3. A is twice as efficient as B, and together they finish in 12 days. How long would each take alone? Rates , combined 3 units per day for a total units: A alone days, B alone days.

assert Fraction(1, 10) - Fraction(1, 15) == Fraction(1, 30)
total = 12 * 3
assert (total / 2, total / 1) == (18, 36) and together(18, 36) == 12

2. Three or more workers

Example 4. A and B can do a job in 12 days, B and C in 15 days, and C and A in 20 days. How long if all three work together? And how long would A alone take? Add the three rates: . So : 10 days. A's rate , so A alone takes 30 days.

ab, bc, ca = Fraction(1, 12), Fraction(1, 15), Fraction(1, 20)
abc = (ab + bc + ca) / 2
assert abc == Fraction(1, 10)
assert 1 / (abc - bc) == 30                      # A's time
assert 1 / (abc - ca) == 20 and 1 / (abc - ab) == 60     # B alone 20 days, C alone 60 days

3. Workers joining or leaving

Work out what is done in each stage, subtract from the total, and continue.

Example 5. A can do a job in 20 days and B in 30 days. They work together for 6 days, then A leaves. How many more days will B need? Total 60 units; A does 3 per day, B does 2. Together 5 per day for 6 days . Remaining 30 units at 2 per day: 15 days.

Example 6. A starts a job alone and works for 5 days. Then B joins, and together they finish it in 4 more days. A alone would take 15 days. How long would B take alone? A's 5 days complete . The remaining takes 4 days together, so their combined rate is per day. B's rate : 10 days.

done_by_a = Fraction(5, 15)
combined = (1 - done_by_a) / 4
assert combined == Fraction(1, 6) and 1 / (combined - Fraction(1, 15)) == 10
assert 5 * Fraction(1, 15) + 4 * Fraction(1, 6) == 1                 # the stages add up to exactly one job

4. Alternate days

If two people work on alternate days, one cycle of two days completes the sum of their daily work. Find how many full cycles fit, then handle the remainder carefully.

Example 7. A can finish a job in 10 days and B in 15 days. They work on alternate days, A first. When is the job finished? Total 30; A does 3, B does 2. Two days complete 5 units. After 5 cycles (10 days) 25 units are done. Day 11: A does 3, taking the total to 28. Day 12: B needs 2 more units, which is the whole of his day, so the job ends at the end of day 12.

def alternate(total, rates):
    done, day = 0, 0
    while done < total:
        done += rates[day % len(rates)]
        day += 1
    return day

assert alternate(30, [3, 2]) == 12
assert alternate(30, [2, 3]) == 12 and alternate(30, [3, 2, 1]) == 15

5. Efficiency, wages and men-days

Wages are shared in proportion to work done (rate × days), not just to days.

Example 8. A can do a piece of work in 8 days and B in 12 days. They complete it together and earn Rs 5,000. Shares? Rates 3 : 2 (LCM 24 units; A does 3, B does 2 per day), so shares are : Rs 3,000 and Rs 2,000.

Example 9. A, B and C complete a job for Rs 7,800. A does it in 6 days, B in 8 days, C in 12 days. Shares if all three work throughout? LCM 24: rates 4, 3, 2 so shares in 4 : 3 : 2, each part : A = Rs 3,466.67, B = Rs 2,600, C = Rs 1,733.33.

assert (5000 * 3 // 5, 5000 * 2 // 5) == (3000, 2000)
parts = [Fraction(24, d) for d in (6, 8, 12)]
assert parts == [4, 3, 2] and [round(float(7800 * p / sum(parts)), 2) for p in parts] == [3466.67, 2600.0, 1733.33]

Men-days relation. If men working hours a day for days do work, and men for hours for days do :

Example 10. 12 men working 8 hours a day complete a road in 15 days. How many days will 20 men working 6 hours a day take? man-hours; , so .

Example 11. 15 men can reap a field in 28 days. After 7 days, 5 men leave. How long will the rest take to finish? Total man-days; used ; left with 10 men more days.

assert 12 * 8 * 15 / (20 * 6) == 12
assert (15 * 28 - 15 * 7) / 10 == 31.5

6. Pipes and cisterns

An inlet pipe fills a tank; an outlet (or leak) empties it. Treat filling rate as positive and emptying rate as negative; rates add as before.

Example 12. Pipe A fills a tank in 6 hours and pipe B in 9 hours. An outlet C empties the full tank in 18 hours. If all three are open, how long to fill the empty tank? Net rate , so 4.5 hours.

Example 13. A tank fills in 8 hours but, because of a leak, takes 10 hours. How long would the leak alone take to empty the full tank? Leak rate : 40 hours.

Example 14. Pipe A fills a tank in 20 minutes and pipe B in 30 minutes. Both are opened; after 8 minutes B is closed. How long to fill the tank in total? Total 60 units; A does 3 per minute, B does 2. In 8 minutes: . Remaining 20 at 3 per minute minutes. Total minutes (14 min 40 s).

net = Fraction(1, 6) + Fraction(1, 9) - Fraction(1, 18)
assert net == Fraction(2, 9) and 1 / net == Fraction(9, 2)
assert 1 / (Fraction(1, 8) - Fraction(1, 10)) == 40
assert 8 + Fraction(60 - 8 * 5, 3) == Fraction(44, 3) and round(float(Fraction(44, 3)), 2) == 14.67

Quick results for pipes

  • Two inlets and hours: .
  • An inlet taking hours and an outlet taking hours (): to fill.
  • If a pipe takes hours but takes extra hours because of a leak, the leak empties the full tank in hours.
assert Fraction(6 * 9, 6 + 9) == Fraction(18, 5)
assert Fraction(6 * 18, 18 - 6) == 9                      # inlet 6 h, outlet 18 h: 9 hours to fill
assert Fraction(8 * (8 + 2), 2) == 40                     # leak adds 2 hours to an 8 hour fill: 40 hours to empty

7. Mixed rates and the "efficiency percent" trick

If A is more efficient than B, the time ratio is the inverse: A takes of B's time.

Example 15. A is 25% more efficient than B. B alone takes 30 days. How long does A alone take, and how long together? A takes days. Together: days.

a_time = 30 * 100 / 125
assert a_time == 24 and round(float(together(24, 30)), 2) == 13.33

8. Work and wages with absentees and bonuses

If some workers leave partway, compute man-days actually worked; payment follows work done. If a contract rewards early completion, convert the time saved into the bonus before splitting.

Example 16. 20 men can finish a job in 15 days. After 5 days, 10 more men join. In how many days in total is it finished? Total 300 man-days; in 5 days done; remaining 200 with 30 men days; total days.

assert round(5 + (20 * 15 - 20 * 5) / 30, 2) == 11.67

9. Common traps

  • Adding times instead of rates. If A takes 10 days and B takes 15 days, together is not 25 days.
  • Not checking the stage totals in joining-and-leaving questions.
  • Wages split by days instead of by work done.
  • Mixing hours and minutes in pipe questions.
  • Forgetting that an outlet's rate is negative.
  • Misreading "more efficient by " (the time ratio is , not ).

10. Practice set with answers

  1. A can finish a job in 24 days and B in 40 days. How long do they take together?
  2. A and B together do a job in 8 days; B alone in 12 days. How long does A take alone?
  3. A can do a job in 30 days, B in 45 days. They start together, but A leaves after 10 days. How long does B take to finish the rest?
  4. Two pipes fill a tank in 12 and 16 minutes; a third empties it in 24 minutes. All three are open. Time to fill the empty tank?
  5. 8 men can complete a job in 18 days. How many men are needed to finish it in 12 days?
  6. A is twice as good a workman as B, and together they take 14 days. How long would B take alone?
  7. A tank is filled by a tap in 5 hours. Because of a leak it takes 6 hours. In how many hours will the leak empty the full tank?
  8. A and B can complete a piece of work in 12 days and 16 days. They work alternately, B starting first. When is it finished?
assert together(24, 40) == 15
assert 1 / (Fraction(1, 8) - Fraction(1, 12)) == 24
total = 90; a, b = total // 30, total // 45
assert (a, b) == (3, 2) and (total - 10 * (a + b)) / b == 20
assert 1 / (Fraction(1, 12) + Fraction(1, 16) - Fraction(1, 24)) == Fraction(48, 5)       # 9.6 minutes
assert 8 * 18 / 12 == 12
assert 14 * 3 == 42                                        # total 42 units: B alone does 1 unit per day
assert 5 * 6 / (6 - 5) == 30
total = 48; a, b = total // 12, total // 16
assert (a, b) == (4, 3) and alternate(48, [b, a]) == 14

Answers: 1) 15 days; 2) 24 days; 3) 20 more days; 4) 9.6 minutes; 5) 12 men; 6) 42 days; 7) 30 hours; 8) at the end of day 14.

Header Logo