Sub topic 3
Working together: adding rates
This chapter covers the step that turns the work-rate relation into a tool for multi-person problems: when several workers act on the same job at the same time, their rates add. It assumes you can add fractions, take reciprocals and find an LCM. It also assumes you know the relation from the first chapter, work = rate × time, and the LCM method from the previous chapter.
The principle: rates add, times do not
If A can finish a job in 10 days, A's rate is 1/10 of the job per day. If B can finish it in 15 days, B's rate is 1/15 of the job per day. In one day of working together, A does 1/10 of the job and B does 1/15 of it, so the pair does 1/10 + 1/15 of the job.
The same logic holds for any number of workers:
- Combined rate = sum of the individual rates.
- Time together = 1 ÷ combined rate (for a job of size 1).
- For a job of size W, time together = W ÷ combined rate.
Times cannot be added because a time is a reciprocal of a rate. A job that takes A 10 days and B 15 days does not take 25 days together, and it does not take 12.5 days (the average) either.
from fractions import Fraction
a = Fraction(1, 10) # A finishes the job in 10 days
b = Fraction(1, 15) # B finishes the job in 15 days
together = a + b
print(1 / together) # 6The sum 1/10 + 1/15 = 3/30 + 2/30 = 5/30 = 1/6, so the pair needs 6 days.
The two-worker shortcut
For two workers who take a and b days alone, the combined rate is 1/a + 1/b = (a + b)/(ab). The time together is therefore
time together = ab / (a + b)
This is "product over sum". For a = 10 and b = 15, it gives 150/25 = 6 days, which matches the result above.
The shortcut applies to two workers only. For three workers the matching formula is abc / (ab + bc + ca), which is rarely faster than adding fractions. For three or more workers, use the LCM method below.
Using the LCM method with several workers
Fractions with awkward denominators are slow to add under exam conditions. Pick the total work as the LCM of the individual times. Each worker's rate then becomes a whole number of units per day.
Suppose A takes 12 days and B takes 18 days.
- The LCM of 12 and 18 is 36, so take the job as 36 units.
- A's rate is 36 ÷ 12 = 3 units per day.
- B's rate is 36 ÷ 18 = 2 units per day.
- Together they do 5 units per day, so the job takes 36 ÷ 5 = 7.2 days.
from math import lcm
total = lcm(12, 18) # 36 units of work
rate_a = total // 12 # 3 units per day
rate_b = total // 18 # 2 units per day
print(total / (rate_a + rate_b)) # 7.2Here is a three-worker case. A, B and C take 12, 15 and 20 days alone. The LCM is 60, which gives rates of 5, 4 and 3 units per day. The combined rate is 12 units per day, so the job takes 60 ÷ 12 = 5 days. The choice of 60 units is arbitrary, since any total gives the same time. The LCM only makes the arithmetic whole-number.
A general helper
The same procedure can be wrapped in a function that takes any number of individual times. Using Fraction keeps the answers exact.
from fractions import Fraction
def combined_time(*times):
"""Time to finish one job when everyone works together."""
rate = sum(Fraction(1, t) for t in times)
return 1 / rate
print(combined_time(10, 15)) # 6
print(combined_time(12, 18)) # 36/5
print(combined_time(12, 15, 20)) # 5Working backwards: finding a missing worker
Many CAT questions give the combined time and one worker's time, then ask for the other worker's time. Rearrange the sum:
rate of the other worker = combined rate − known worker's rate
Example: A and B together finish a job in 8 days. A alone takes 12 days. How long does B take alone?
- Combined rate: 1/8.
- A's rate: 1/12.
- B's rate: 1/8 − 1/12 = 3/24 − 2/24 = 1/24.
- B alone takes 24 days.
from fractions import Fraction
def missing_time(together, known):
"""Time the second worker needs alone, given the pair's time and one worker's time."""
rate = Fraction(1, together) - Fraction(1, known)
if rate <= 0:
raise ValueError("The pair's time must be shorter than the known worker's time.")
return 1 / rate
print(missing_time(8, 12)) # 24The guard in the function reflects a real check. If the pair takes longer than one of its members working alone, the data is inconsistent, because adding a worker cannot slow the job down in this model.
Using a total other than one job
If the work is not one whole job, scale the answer. A job of W units done at a combined rate of R units per day takes W ÷ R days. Suppose two machines make 40 and 60 items per hour. Together they make 100 items per hour, so an order of 450 items takes 4.5 hours. This is the same relation, work = rate × time, with the rates given directly instead of derived from completion times.
Sanity checks
Three checks catch most mistakes quickly:
- Bounds. The combined time is always shorter than the fastest worker's time alone. In the example above, 6 days is less than 10.
- Equal workers. If n workers each take t days alone, together they take t/n days. Two workers of 10 days each take 5 days.
- Unequal workers. The combined time is more than the fastest worker's time divided by the number of workers. For A at 10 days and B at 15 days, the answer lies between 5 and 10, and 6 does.
Common errors
| Error | Why it fails | Correct move |
|---|---|---|
| Adding times: 10 + 15 = 25 | Times are reciprocals of rates | Add rates, then invert |
| Averaging times: (10 + 15) / 2 = 12.5 | Averaging ignores that the faster worker contributes more | Add rates |
| Mixing units, such as hours for A and days for B | Rates then have different denominators | Convert to one unit first |
| Inverting the sum incorrectly, such as 1/(1/10) + 1/(1/15) | Inverts each rate separately | Sum first, then invert once |
| Subtracting the wrong way in missing-worker problems | Gives a negative rate | Combined rate minus known rate |
Worked problem: pairs of workers
A, B and C are three workers. A and B together take 12 days, B and C together take 15 days, and A and C together take 20 days. How long does each take alone, and how long do all three take together?
Add the three pair rates. Each worker appears in two of the pairs, so the sum counts every worker twice:
2(A + B + C) = 1/12 + 1/15 + 1/20 = 5/60 + 4/60 + 3/60 = 12/60 = 1/5
So A + B + C = 1/10, and all three together take 10 days. Each worker's rate is then the total minus the pair that excludes that worker:
- A = 1/10 − 1/15 = 1/30, so A alone takes 30 days.
- B = 1/10 − 1/20 = 1/20, so B alone takes 20 days.
- C = 1/10 − 1/12 = 1/60, so C alone takes 60 days.
Check: A + B = 1/30 + 1/20 = 2/60 + 3/60 = 5/60 = 1/12, which matches the given 12 days.
from fractions import Fraction
ab = Fraction(1, 12)
bc = Fraction(1, 15)
ac = Fraction(1, 20)
total = (ab + bc + ac) / 2
a, b, c = total - bc, total - ac, total - ab
print(1 / total, 1 / a, 1 / b, 1 / c) # 10 30 20 60What comes next
Combined rates answer the question "how long if everyone works the whole time". The following chapters relax that assumption: efficiency ratios express rates as proportions, and later chapters handle workers who leave or join midway and who work on alternate days. All of them use the rule from this chapter, that rates add.
Exercise
A can do a job in 15 days and B can do it in 20 days. How long do they take together? Solve it with the LCM method.
Show answer
The LCM of 15 and 20 is 60 units. A's rate is 60 ÷ 15 = 4 units per day and B's rate is 60 ÷ 20 = 3 units per day. Together they do 7 units per day, so the job takes 60 ÷ 7 = 8 4/7 days, about 8.57 days. Check with the product-over-sum formula: (15 × 20) / 35 = 300/35 = 60/7, which agrees.
Exercise
A and B together finish a job in 12 days. B alone takes 30 days. How long does A take alone?
Show answer
Combined rate is 1/12 and B's rate is 1/30. A's rate is 1/12 − 1/30 = 5/60 − 2/60 = 3/60 = 1/20. A alone takes 20 days.
Exercise
Three workers take 10, 12 and 15 days alone. How long do they take together? Then say why an answer of 11 days could be rejected without any calculation.
Show answer
The LCM of 10, 12 and 15 is 60 units. The rates are 6, 5 and 4 units per day, which add to 15 units per day. The job takes 60 ÷ 15 = 4 days. An answer of 11 days is impossible because the combined time must be shorter than the fastest worker's time alone, which is 10 days.