At the end of the last lesson, you had a reliable way to shrink a three-variable system: pick a variable, combine two different pairs of equations, and watch that variable disappear twice. But every system we used was quietly cooperative. Some column already held a 1 next to a −1, and the cancellation happened for free.
Welcome to the third lesson of Three-Variable Systems and a First Look Beyond, where that convenience goes away. Here we handle the general case: no pair cancels anything on its own, so we reshape the equations before combining them. The move itself is borrowed from the elimination course — multiply an equation by a constant — but inside a three-variable system you have to pay for it twice, which makes choosing the target variable just as important as executing the arithmetic.
When Nothing Cancels on Its Own
Multiplying an entire equation by a nonzero constant produces an equivalent equation: different numbers on the page, exactly the same solutions. Geometrically, 2x+3y+3z=17 and 4x+6y+6z=34 describe the same plane, so nothing about the system's meaning shifts when we rescale.
Think of doubling a recipe. Two eggs become four, one cup of flour becomes two, and the dish tastes identical — as long as you scale every ingredient. Now imagine comparing two recipes that both call for eggs: if you scale one so both use the same number of eggs, the eggs drop out of the comparison and only the differences remain. That is precisely what we are about to do with a variable.
Here is the full menu of situations you can meet in a pair of equations, based on the two coefficients of your target variable:
Target coefficients look like
What to do
Opposites, such as 3 and −3
Add; no scaling needed
Equal, such as 3 and 3
Subtract; no scaling needed
One divides the other, such as 2 and 6
Scale one equation
Neither divides the other, such as 4 and 6
Scale both, up to the LCM
The first two rows are last lesson's territory. The bottom two are this lesson's.
Scaling One Equation in a Pair
The cheap case is when one target coefficient divides the other. Take this pair:
(1)(2)​2x+y−z=44x−3y+2z=1​
To eliminate x, notice that 4 is a multiple of 2. Multiplying equation (1) by −2 turns its x term into −4x, the exact opposite of the 4x in equation (2):
−2×(1):−4x−2y+2z=−8
Adding this to equation (2) gives −5y+4z=−7. Two details deserve a pause: every term was multiplied by −2, the constant included, and we chose −2 instead of +2 so that plain addition would do the cancelling. Multiplying by +2 and subtracting works just as well — pick the sign pattern you trust yourself to execute cleanly.
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal
Scaling Both Equations in a Pair
Choosing the Cheapest Target Variable
Carrying Out a Full Reduction
When Both Pairs Need Scaling
Common Traps When Scaling
Scaling extends your reach and, unfortunately, your opportunities to slip. These are the errors worth watching for:
Multiplying only part of the equation. Every term travels, including the constant on the right-hand side.
Getting the sign backwards. If both target coefficients share a sign, either use one negative multiplier and add, or keep both positive and subtract. Deciding before you write anything prevents most sign disasters.
Scaling for the wrong column. Choose multipliers by looking only at the target variable, and let the other coefficients land where they land.
Treating a scaled equation as a replacement. The scaled form is a one-time tool for a single combination; the next pair starts from the original equation again.
After each combination, check that the target variable is gone. Usually the two remaining variables will still appear, but a second variable may also cancel, leaving a valid equation in just one variable. What matters is that the two resulting equations collectively provide usable information for solving the system.
Conclusion and Next Steps
In this lesson, we dropped the assumption that coefficients line up by themselves. Scan the three columns and pick the target that needs the least reshaping, multiply one or both equations by well-chosen constants, then combine each pair to remove that same variable twice. Tidy up the results if a common factor or a negative leading sign is begging to be cleaned, and confirm that each combined equation still holds for the original solution.
The exercises ahead follow that same order of thinking. You will plan multipliers for a single pair, judge which variable is cheapest to eliminate, assemble one scaled combination step by step, and finally reduce two complete systems — one where a single pair needs scaling, and one where both do. Grab a pen, and let's make those coefficients line up.
When neither coefficient divides the other, both equations get scaled, and the target is the least common multiple of the two coefficients, signs ignored. Consider:
(1)(2)​3x+2y+z=75x−y+4z=2​
To eliminate x, the LCM of 3 and 5 is 15. Multiply equation (1) by 5 and equation (2) by −3, so the x terms become 15x and −15x:
Notice how quickly the numbers inflated. That growth is the true cost of scaling, and it is exactly why the next step of planning matters.
In a three-variable system you eliminate the same variable twice, so you pay the scaling cost twice. Before touching any arithmetic, scan all three coefficient columns and ask which one demands the least reshaping:
Scale (1) by 2, then by 3 — one small multiplier per pair
y
3, 5, 11
LCM 15, then LCM 33 — both equations scaled, large numbers
z
3, −4, 5
LCM 12, then LCM 15 — both equations scaled
The x column wins outright, because 4 and 6 are both multiples of 2: equation (1) can be stretched to meet each of the others while equations (2) and (3) stay untouched. The best target is the variable whose coefficients share the smallest multiples, and a column containing a coefficient that divides the other two — or a ±1 anywhere — is a strong signal.
Let's finish the plan. We pair (1) with (2), and (1) with (3), scaling equation (1) both times so that addition does the cancelling.
Both results can be tidied before you move on: multiplying the first by −1 gives y+10z=32, and dividing the second by 2 gives y−2z=−4. Tidying is optional but almost always pays off in the solving stage. Our reduced system is
{y+10z=32y−2z=−4​
Two equations in the same two variables, exactly as required. The original system's solution is (1,2,3), and substituting y=2, z=3 gives 2+30=32 ✓ and 2−6=−4 ✓, so nothing was lost along the way.
Sometimes no column offers a free ride, and every combination requires reshaping. The procedure does not change — it just asks for steadier bookkeeping:
The x column (3,5,4) and the z column (5,−2,3) both force large LCMs, while the y column (2,4,3) stays small: 4 is a multiple of 2, and 2 and 3 meet at just 6. So y is our target. For the first pair, scale (1) by 2 and subtract (2):
Notice that equation (1) was scaled differently in the two pairs — by 2 once and by 3 the next time. That is entirely legal, because each combination is an independent calculation that starts fresh from the original equations. The reduced system, x+12z=37 and x+9z=28, is checked instantly against the solution (1,2,3): 1+36=37 ✓ and 1+27=28 ✓.