Defining Variables Well Before You Write Anything
Write one clear sentence for each letter, with quantity and units, and watch word problems become much easier to set up.
Key takeaways
- A variable stands for a number, so its definition should name something that can be counted or measured.
- Include the owner, the moment and the unit wherever they could be confused.
- Choosing the smallest or most referred-to quantity as the letter often keeps fractions away.
- One letter is enough when other quantities can be written in terms of it.
- Definitions also record restrictions, such as whole numbers only or no negative lengths.
A good variable definition is a full sentence saying what number the letter stands for, including whose quantity it is, when it applies and what units measure it. "Let b = the number of bagels sold on Saturday" is a definition. "b = bagels" is only a label, and labels cause mistakes.
The sentence takes a few seconds to write. It tells you what each term in your equation means and what to report once you have solved it.
A letter is a number, not a thing
In algebra, letters stand for numbers. Writing "let a = apples" invites you to read 3a as "three apples," when a in your equation really means how many apples there are, or perhaps what one apple costs.
Those two readings lead to different equations. If a is the number of apples and each costs 50 cents, the total cost in cents is 50a. If a is the price of one apple in cents and you buy 12, the total is 12a.
The definition "let a = the price of one apple, in cents" leaves no doubt. For background on the idea itself, see what a variable is.
What a complete definition contains
Compare weak and strong versions.
| Weak | Strong |
|---|---|
| t = time | t = hours elapsed since 9:00 a.m. |
| m = Maya | m = Maya's age today, in years |
| w = water | w = liters of water in the tank at the start |
| p = price | p = price of one ticket, in dollars, before tax |
Not every problem needs all five parts. Include any that could be read in two ways.
Start from the question
Read the whole problem before choosing letters. Find the sentence that asks for something, and underline it. That quantity is a natural candidate for a variable.
Then list the other unknown quantities and ask how they depend on one another. Often the problem describes several amounts by comparing them with a single one.
Suppose a rope 31 meters long is cut into two pieces, and the longer piece is 4 meters more than twice the shorter. Both lengths are unknown, but the longer is described using the shorter.
Let s = length of the shorter piece, in meters.
Longer piece: 2s + 4
s + (2s + 4) = 31 the pieces make the whole rope
3s + 4 = 31
s = 9 The pieces are 9 m and 22 m. Check: 22 = 2 · 9 + 4, and 9 + 22 = 31.
Choosing which quantity gets the letter
You are free to choose, and some choices are kinder than others. If one person has three times as much money as another, letting x be the smaller amount gives x and 3x. Letting x be the larger gives x and x/3, which is correct but introduces a fraction.
Choose the quantity that others are measured against, which is usually the one that comes after "than" or "as": in "Lee is 5 years older than Sam," let s be Sam's age, so that Lee's is s + 5.
If the letter is not the thing asked for, make a note. After solving for Sam's age, you may still need to add 5.
Age problems also need a clear moment. "In 6 years" means that every person's age grows by 6, so define the letter as an age today, then write s + 6 and s + 11 for the future ages.
One variable or two
You can often use one letter or two. Consider 20 coins, all nickels and dimes, worth $1.45.
With two letters, let n be the number of nickels and d the number of dimes. Then n + d = 20 and 5n + 10d = 145, with values in cents.
With one letter, let d be the number of dimes, so the nickels number 20 − d.
10d + 5(20 − d) = 145
10d + 100 − 5d = 145
5d = 45
d = 9 There are 9 dimes and 11 nickels, worth 90 + 55 = 145 cents.
Two letters match the story more directly but need two equations. One letter needs more thought at the start. Both are sound, and solving by substitution shows that they are closely connected.
Units keep you honest
The coin example used cents on both sides. Writing 5n + 10d = 1.45 mixes cents on the left with dollars on the right, and the result would be nonsense.
Time and distance problems have the same risk. If a runner's speed is 12 kilometers per hour and the time is given in minutes, define t in hours, or convert: 45 minutes is 0.75 hour, so the distance is 12 · 0.75 = 9 km.
Defining the unit with the letter forces you to settle this before you compute. See units as a check for ways to test your finished expression.
Letters that help and letters that mislead
Meaningful letters make work readable: d for distance, t for time, h for height. Subscripts help when similar quantities repeat, such as t₁ and t₂ for the times of two trips. See naming many variables with subscripts.
There is also a hazard. When the letter matches the first letter of an object, it is tempting to treat it as the object. In a problem about students and professors, writing S for "students" can lead to the famous reversal error. Writing "S = the number of students" prevents much of it.
Avoid letters that look like digits or symbols in your handwriting, such as o beside zero, l beside 1, or x beside a multiplication sign.
Stating restrictions
A definition tells you which values make sense. A count of coins must be a whole number from 0 up to the total. A length must be positive. A time after a start cannot be negative.
In the coin problem, d must be a whole number with 0 ≤ d ≤ 20. Had the algebra produced d = 9.4, you would know that the stated total was impossible or that a step had gone wrong.
Restrictions also select among multiple solutions. If a rectangle's width w satisfies w(w + 3) = 40, factoring w² + 3w − 40 = (w + 8)(w − 5) gives w = −8 or 5. A width cannot be negative, so w = 5 and the length is 8.
Two travelers, one clock
A last example shows the value of the moment. One cyclist leaves at noon riding 15 km/h. A second leaves from the same place at 1 p.m., follows the same route and rides 20 km/h. When does the second catch up?
Let t be the number of hours after noon. The first cyclist has ridden for t hours and covered 15t km. The second has ridden for t − 1 hours and covered 20(t − 1) km, valid for t ≥ 1.
15t = 20(t − 1)
15t = 20t − 20
t = 4 The catch-up happens at 4 p.m., 60 km from the start. If you had defined t only as "time," it would be unclear whether to report 4 p.m. or 1 p.m. plus 4 hours.
Repairing a vague setup
Imagine a half-finished solution that begins "x = bus" and then writes 40x + 12 = 172. A reader cannot tell whether x counts buses, riders on one bus or something else.
Work backward from the equation. If each of several full buses carries 40 students and 12 more students travel by van, with 172 students in all, then the definition is "x = the number of full buses." Solving gives 40x = 160 and x = 4.
If a term in your equation cannot be explained in a sentence using your definition, either the term or the definition is wrong. Here 40x reads as "40 students per bus times the number of buses," which is a number of students, matching 12 and 172.
Finishing the job
After solving, return to your definitions and answer in a sentence: "The shorter piece is 9 meters and the longer is 22 meters." This catches answers that solve for the wrong thing.
Then check the numbers against the words of the problem, not only against your equation. If the equation was built wrongly, it will happily confirm its own wrong solution. The article on checking reasonableness offers further tests.
Common questions
Do I have to write the definition if it is obvious?
On homework or exams it is good practice, and many teachers require it. What feels obvious while reading can be forgotten five lines later.
Can I change a definition midway?
Not without starting the setup again. If a different choice looks better, cross out the old work and rewrite every expression using the new meaning. Mixing the two is a common source of errors.
Can one letter mean different things in different problems?
Yes. A letter's meaning lasts only for the problem in which you define it. Within one problem, though, each letter should keep a single meaning.