Sub topic 4
Writing the equation
An equation is a statement that two quantities are equal. Writing one from a word problem means finding the two quantities the problem says are the same, then expressing each as an expression in your variable. This chapter assumes you can already define a variable with units, translate phrases such as "5 more than" or "twice a number" into expressions, and do arithmetic with integers, fractions, and decimals.
What an equation says
Every word problem that leads to a linear equation contains an equality, even if it never uses the word "equals". The equation you write is a sentence with a left side, an equals sign, and a right side. Both sides must describe the same kind of thing, measured in the same unit.
- "The total is $62" gives you a total on one side and 62 on the other.
- "Car B catches up with Car A" says that the two distances are equal.
- "After the discount the price is $48" says that an expression for the discounted price equals 48.
Before you write anything, say in plain words what is equal to what. For example: "money from adult tickets plus money from child tickets equals the total money." Write the equation only after you have that sentence.
A repeatable method
- Identify the equality. Find the sentence or fact that says two things are the same.
- Write it in words, using the quantities in the problem.
- Replace each quantity with a number or an expression in your variable.
- Check that the units on both sides match.
- Only then simplify or solve.
Where the equality comes from
The equal relationship usually takes one of a few forms. Learning to recognize them speeds up step 1.
| Pattern in the problem | Equality to write | Example |
|---|---|---|
| A stated total | Sum of the parts = total | 8a + 5c = 62 |
| Two things described as the same | Expression 1 = Expression 2 | 60t = 80(t - 1) |
| A result after a change | Original adjusted by the change = result | 0.8p = 48 |
| A known formula | Formula with the given values = target | 2L + 2W = 36 |
Worked example 1: a total split into parts
A theater sold 10 tickets. Adult tickets cost $8 and child tickets cost $5. The total was $62. How many adult tickets were sold?
Let a be the number of adult tickets. Because 10 tickets were sold in all, the number of child tickets is 10 - a. This is the key move: when a total is known, express the second unknown using the first.
The equality in words: money from adults + money from children = total money.
- Money from adults: 8a dollars.
- Money from children: 5(10 - a) dollars.
- Total: 62 dollars.
So the equation is 8a + 5(10 - a) = 62. Distributing gives 8a + 50 - 5a = 62, which simplifies to 3a + 50 = 62. Then 3a = 12 and a = 4.
from fractions import Fraction
# 10 tickets total, adult $8, child $5, total $62. Let a = number of adults.
# 8a + 5(10 - a) = 62 -> 3a + 50 = 62
a = Fraction(62 - 50, 3)
print(a, 10 - a) # 4 6
print(8 * a + 5 * (10 - a) == 62) # TrueThe code reduces the equation to 3a + 50 = 62, solves it, and checks that the result gives the correct total. Using Fraction keeps the arithmetic exact, so the equality test is reliable.
Worked example 2: a result after a change
A jacket costs $48 after a 20% discount. What was the original price?
Let p be the original price in dollars. A 20% discount removes 20% of p, so the customer pays 80% of it. The equality in words: original price times 0.8 equals the sale price.
The equation is 0.8p = 48.
A common wrong setup is p - 0.2 × 48 = 48 or p = 48 - 0.2 × 48. Both apply the 20% to the sale price. The percent in the problem is a percent of the original price, so p must appear inside the percent term.
from fractions import Fraction
# A jacket costs $48 after a 20% discount. Let p = original price.
# 0.8p = 48 -> p = 48 / 0.8
p = Fraction(48) / Fraction(4, 5)
print(p) # 60
print(p * Fraction(4, 5) == 48) # TrueHere 0.8 is written as the fraction 4/5. Dividing by 4/5 gives 60, and applying the discount again returns 48.
Worked example 3: two things that become equal
Car A leaves at 60 mph. One hour later, Car B leaves the same place at 80 mph on the same road. How long after Car A leaves does Car B catch up?
Let t be the hours Car A has travelled when B catches up. Car B has travelled one hour less, so its time is t - 1. The equality in words: distance of A = distance of B at the moment of catching up. Distance is rate times time, so:
60t = 80(t - 1)
Distributing gives 60t = 80t - 80, so 20t = 80 and t = 4.
# Car A leaves at 60 mph. Car B leaves 1 hour later at 80 mph.
# Let t = hours Car A has travelled when B catches up.
# 60t = 80(t - 1) -> 20t = 80
t = 80 / 20
print(t) # 4.0
print(60 * t == 80 * (t - 1)) # TrueCommon errors when writing the equation
- Writing an expression with no equals sign. "8a + 5(10 - a)" is a quantity, not an equation. State what it equals.
- Mixing units. If time is in minutes on one side and hours on the other, the equation is wrong even if the algebra is clean. Convert first.
- Putting the percent on the wrong base. "20% off" applies to the original price, not the sale price.
- Reversing order in subtraction phrases. "5 less than x" is x - 5, not 5 - x.
- Forgetting parentheses. Writing 80t - 1 instead of 80(t - 1) changes the meaning. If a whole quantity such as "time minus one hour" is multiplied by a rate, it needs parentheses.
- Using one equality twice. If you have used "the total is 10 tickets" to define 10 - a, you cannot use it again as a second equation in a one-variable problem. The equation comes from the other fact.
Testing your equation before solving
A quick test catches bad setups early. Pick a guess for the variable, even a wrong one, and compute both sides in context.
For the ticket problem, try a = 5. Adults pay 40, children (5 of them) pay 25, the total is 65. The left side gives 65 and the target is 62, so 5 is not the answer, but the calculation confirms that the equation measures the right thing: money. If your left side produced a number of tickets instead of dollars, the setup would be wrong.
Your equation should also respond sensibly to changes. Increasing a should increase the total, since adult tickets cost more. In 8a + 5(10 - a), the coefficient on a is 3, which is positive, so this holds.
Equations with more than one possible form
Many problems allow several correct equations. For the jacket, 0.8p = 48 and p - 0.2p = 48 are the same equation in different forms. Choose the form that makes the relationship clearest to you. Solving then gives the same answer in each case. If two setups give different answers, one of them is wrong, and substituting each answer back into the original wording will show which.
Exercise
A phone plan costs $20 per month plus $0.10 per text message. In one month the bill was $27. Define a variable, write an equation, and solve it for the number of texts.
Show answer
Let n be the number of text messages sent in the month. The equality in words: the fixed fee plus the text charges equals the bill. So 20 + 0.10n = 27. Subtract 20 to get 0.10n = 7, then n = 70. Check: 20 + 0.10 × 70 = 20 + 7 = 27 dollars.
Exercise
Anna is 4 years older than Ben. In 6 years the sum of their ages will be 40. Write an equation in terms of Ben's current age b. Do not solve it.
Show answer
Anna's current age is b + 4. In 6 years Ben is b + 6 and Anna is b + 4 + 6 = b + 10. The sum is 40, so (b + 6) + (b + 10) = 40.
Exercise
Train X leaves a station at 50 mph. Train Y leaves the same station 2 hours later at 70 mph on the same track. Let t be the hours Train X has travelled when Y catches up. Write the equation.
Show answer
Train Y has travelled t - 2 hours. The distances are equal at the catch-up point, so 50t = 70(t - 2).