Sub topic 11
Setting Up and Solving Word Problems
This chapter assumes you can solve a system by substitution and by elimination, check a solution in both equations, and recognize systems with no solution or infinitely many solutions. The new skill is translation: turning a paragraph into two equations. The algebra afterward is work you already know how to do.
Why word problems need two equations
A word problem needs a system when it asks for two unknown quantities and gives two independent facts linking them. One fact alone, such as "two numbers add to 10", has infinitely many answers. A second fact, such as "one is 4 more than the other", pins down a single pair.
A reliable workflow keeps you from mixing up quantities:
- Read the problem and list the unknown quantities.
- Define one variable per unknown, with units.
- Find two separate facts and write each as an equation.
- Choose a method and solve.
- Check the answer in the original words, not only in your equations.
- Answer in a sentence with units.
Step 1 and 2: Define variables carefully
Vague definitions cause most setup errors. Writing "let x = tickets" is ambiguous, because it does not say which kind of ticket. Write "let x = the number of adult tickets" and "let y = the number of child tickets".
Match the variable to what the question asks. If the question asks for a price, define a price variable. If it asks for a count, define a count variable. Mixing the two is a frequent source of wrong equations, as the ticket example below shows.
Step 3: Translate facts into equations
Most word problems in this topic use a small set of fact patterns. The table lists the common ones.
| Phrase in the problem | Equation pattern |
|---|---|
| "The total number of items is 20" | x + y = 20 |
| "The sum of two numbers is 15" | x + y = 15 |
| "x is 3 more than y" | x = y + 3 |
| "x is twice y" | x = 2y |
| "Each A costs $5 and each B costs $8, total $62" | 5x + 8y = 62 |
| "A 30% solution mixed with a 50% solution" | 0.30x + 0.50y = amount of pure substance |
| "Travel at rate r for time t" | distance = r * t |
Two kinds of equation appear again and again. A quantity equation counts items, such as x + y = 20. A value equation multiplies each count by its price, rate, or concentration and adds, such as 5x + 8y = 62. Many problems give one of each.
Worked example 1: Tickets (quantity and value)
A theater sells adult tickets for $12 and child tickets for $7. One evening it sells 150 tickets and collects $1,380. How many of each kind were sold?
Define variables:
- x = the number of adult tickets sold
- y = the number of child tickets sold
Fact 1 is a quantity equation. Fact 2 is a value equation:
x + y = 150
12x + 7y = 1380Because both equations have simple coefficients, elimination works well. Multiply the first equation by -7 so the y terms are opposites:
-7x - 7y = -1050
12x + 7y = 1380Add:
5x = 330 -> x = 66Substitute into the first equation:
66 + y = 150 -> y = 84Check the original words: 66 + 84 = 150 tickets, and 12(66) + 7(84) = 792 + 588 = 1380 dollars. Both facts hold.
Answer: 66 adult tickets and 84 child tickets were sold.
The same problem could also be solved by substitution. Isolate x = 150 - y and put it in the second equation to get 12(150 - y) + 7y = 1380, so 1800 - 5y = 1380 and y = 84. The answers agree.
Worked example 2: Rates and a boat in a current
A boat travels 24 miles downstream in 2 hours. It returns the same 24 miles upstream in 3 hours. Find the boat's speed in still water and the speed of the current.
Define variables:
- b = the boat's speed in still water, in miles per hour
- c = the speed of the current, in miles per hour
Going downstream, the current helps, so the effective speed is b + c. Going upstream, it hurts, so the effective speed is b - c. Use distance = rate * time:
2(b + c) = 24
3(b - c) = 24Simplify each equation by dividing:
b + c = 12
b - c = 8The c terms are already opposites. Add:
2b = 20 -> b = 10Then 10 + c = 12, so c = 2.
Check: downstream speed 10 + 2 = 12 mph, and 12 2 = 24 miles. Upstream speed 10 - 2 = 8 mph, and 8 3 = 24 miles.
Answer: the boat goes 10 mph in still water, and the current flows at 2 mph.
Notice that the variables are speeds, not times or distances. The distances were known, so they became constants.
Worked example 3: Mixture
A chemist has a 20% acid solution and a 60% acid solution. How many liters of each should be mixed to make 40 liters of a 35% acid solution?
Define variables:
- x = liters of the 20% solution
- y = liters of the 60% solution
The quantity equation is about total volume. The value equation is about the amount of pure acid, because acid, unlike percentages, adds up directly:
x + y = 40
0.20x + 0.60y = 0.35(40)The right side of the second equation is 14 liters of pure acid. Multiply the second equation by 100 to clear decimals:
20x + 60y = 1400Divide by 20:
x + 3y = 70Subtract the first equation from this one (or use elimination with -1):
(x + 3y) - (x + y) = 70 - 40
2y = 30 -> y = 15Then x = 40 - 15 = 25.
Check: 25 + 15 = 40 liters. Acid: 0.20(25) + 0.60(15) = 5 + 9 = 14 liters, and 14 / 40 = 0.35, which is 35%.
Answer: mix 25 liters of the 20% solution with 15 liters of the 60% solution.
A quick sanity check also helps here: 35% lies between 20% and 60%, so both ingredients are needed, and it is closer to 20% than to 60%, so more of the 20% solution makes sense.
Common errors
Defining a variable but using it as something else
Suppose x is the number of adult tickets, and you write 12x as "the cost of one adult ticket". The 12 is already the price. The variable is a count, so 12x is the total dollars from adults. Keep a note of what each term in each equation measures.
Adding quantities with different units
An equation must have the same unit on both sides and in every term. Writing x + 0.35y = 40 mixes liters with percentages. Convert percentages to amounts of the pure substance first.
Using the same fact twice
Two equations that say the same thing give a dependent system, not a unique solution. For instance, "the total is 20" and "twice the total is 40" are one fact. If elimination produces 0 = 0, look for a missed second fact in the problem.
Skipping the check in words
A solution can satisfy your equations and still be wrong if the equations are wrong. Always check against the original sentences. A negative count of tickets, or a fractional number of people, signals a setup error or an impossible problem.
Reading the solution type in context
The three outcomes from the earlier chapter have meaning in word problems.
- One solution: the usual case. The two facts determine the quantities.
- No solution: the facts contradict each other. For example, "x + y = 10" and "x + y = 12" cannot both hold.
- Infinitely many solutions: the facts repeat each other, so the problem is underdetermined.
Also check whether the solution makes sense. A system can have a valid algebraic solution that the context rejects. If the algebra gives x = 2.5 and x counts people, the problem has no usable answer.
Checking your work with code
The solve_2x2 function from this tutorial can verify setups. This version also confirms that the answers are whole numbers when the context needs counts.
from fractions import Fraction
def solve_2x2(a1, b1, c1, a2, b2, c2):
"""Solve a1*x + b1*y = c1 and a2*x + b2*y = c2 using Cramer's rule."""
det = a1 * b2 - a2 * b1
if det == 0:
return None # no unique solution
x = Fraction(c1 * b2 - c2 * b1, det)
y = Fraction(a1 * c2 - a2 * c1, det)
return x, y
def solve_count_problem(a1, b1, c1, a2, b2, c2):
result = solve_2x2(a1, b1, c1, a2, b2, c2)
if result is None:
return "No unique solution: check for contradictory or repeated facts."
x, y = result
if x.denominator != 1 or y.denominator != 1 or x < 0 or y < 0:
return f"Algebraic solution ({x}, {y}) is not a valid count."
return int(x), int(y)
# Tickets: x + y = 150 and 12x + 7y = 1380
print(solve_count_problem(1, 1, 150, 12, 7, 1380)) # (66, 84)
# A setup with a contradiction: x + y = 10 and x + y = 12
print(solve_count_problem(1, 1, 10, 1, 1, 12))The first call prints (66, 84). The second prints the no-unique-solution message, because the determinant is 0.
Choosing a method for word problems
Word problem systems often arrive in standard form, such as x + y = 150 and 12x + 7y = 1380. Elimination suits them when coefficients line up. Substitution suits problems that state "x is twice y" or "x is 3 more than y", because the equation arrives already solved for a variable. Graphing is rarely the best choice here, because you need exact values, but a quick sketch can confirm that the answer is reasonable.
Practice: write the system first
Try this one before reading the answer. A gym charges a one-time sign-up fee plus a monthly rate. After 3 months, a member has paid $145 in total. After 7 months, another member who joined under the same plan has paid $285. Find the sign-up fee and monthly rate. The setup is the key part: let f be the fee and m the monthly rate, so f + 3m = 145 and f + 7m = 285.
Exercise
A gym charges a one-time sign-up fee f plus a monthly rate m. After 3 months a member has paid $145 in total, and after 7 months a member on the same plan has paid $285. Write the system, solve it, and check your answer.
Show answer
Equations: f + 3m = 145 and f + 7m = 285. Subtract the first from the second: 4m = 140, so m = 35. Then f + 3(35) = 145 gives f = 40. Check: 40 + 3(35) = 145 and 40 + 7(35) = 40 + 245 = 285. The sign-up fee is $40 and the monthly rate is $35.
Exercise
A bakery sells muffins for $3 and cookies for $2. A customer buys 12 items and pays $31. How many muffins and how many cookies did the customer buy? Then explain what the answer would tell you if the total were $30.50 instead.
Show answer
Let x = muffins and y = cookies. Then x + y = 12 and 3x + 2y = 31. Multiply the first equation by -2: -2x - 2y = -24. Add to the second: x = 7. Then y = 5. Check: 7 + 5 = 12 and 21 + 10 = 31. With $30.50, the same steps give x = 6.5 and y = 5.5. These are not whole numbers, so no valid purchase matches those facts, and the problem has no usable answer even though the system has an algebraic solution.
Exercise
A plane flies 600 miles with the wind in 2 hours and returns against the wind in 2.5 hours. Define variables, write the system, and find the plane's speed in still air and the wind speed.
Show answer
Let p = the plane's speed in still air and w = the wind speed, both in miles per hour. With the wind: 2(p + w) = 600, so p + w = 300. Against the wind: 2.5(p - w) = 600, so p - w = 240. Add: 2p = 540, so p = 270. Then w = 30. Check: 2(270 + 30) = 600 and 2.5(270 - 30) = 2.5(240) = 600. The plane flies 270 mph in still air and the wind is 30 mph.