Algebraic number tricks

"Think of a number, double it, add 10, halve it, subtract your original number... the answer is always 5!" A friend performs this and it feels like mind-reading. It is not magic — it is algebra wearing a disguise. Every step of the trick is really an operation on an unknown number xx, and when you write those steps out symbolically and simplify, the xx often cancels away completely, leaving a fixed constant that has nothing to do with what your friend actually picked. This article shows exactly how to translate a "think of a number" trick into algebra, prove why it always works using the distributive law, and handle the twin task of finding the original number when a trick gives you a numeric clue instead of a guaranteed answer.

The core insight

A "think of a number" trick is a chain of operations on an unknown xx that, once translated into algebra and simplified with the distributive law, either collapses to a constant (proving the trick always works) or becomes a linear equation you solve for xx (if the trick asks you to guess the number from a clue).

The core idea

A number trick is nothing more than a sequence of everyday arithmetic instructions — "add", "multiply", "subtract" — applied one after another to a number the other person is keeping secret. Algebra lets us follow those instructions without ever knowing the secret number, by giving it a name.

Step 1: name the unknown. Let the number your friend picked be xx. Every instruction that follows becomes an operation performed on the current expression, not just on xx alone.

Step 2: translate instruction by instruction. "Add 3" turns xx into x+3x+3. "Multiply the result by 2" turns x+3x+3 into 2(x+3)2(x+3) — the brackets matter, because the instruction acts on everything computed so far, not only on the newest term.

Step 3: simplify with the distributive law. Expanding brackets and combining like terms is where the trick's secret is revealed:

a(b+c)=ab+aca(b+c) = ab + ac

where: aa is the outer multiplier, and b,cb, c are the terms inside the bracket being distributed over. This single rule is what turns a tangle of brackets into a clean expression in xx.

Step 4: read the result. If every xx term cancels, you are left with a pure number — a constant — and that constant is the trick's guaranteed answer, whatever the starting number was. If xx terms remain and you are instead told what the final result equals, you have a linear equation, and the task changes from "prove it always works" to "solve for xx": an equation of the form

ax+b=cax + b = c

where: aa is the coefficient multiplying xx, bb is a constant added along the way, and cc is the known final result — gives x=c−bax = \dfrac{c-b}{a}.

Figure
A flowchart of a number trick showing x entering four operation boxes add three times two subtract four divide by two subtract x and exiting as the constant one regardless of the starting value
Whatever x starts as, the chain always ends at 1 x add 3 multiply by 2 subtract 4 divide by 2 subtract original x 1 The x terms cancel inside the chain, so the exit value never depends on the entry value

The core idea continues: proving versus solving

These are two different jobs that look alike on the page. Proving a trick always works means simplifying the algebraic expression until the xx disappears, leaving a constant — that constant is the answer for every starting number. Solving for the original number means the trick gave you the final numeric result as a clue, so you set the simplified expression equal to that number and solve the resulting linear equation for xx. Reading the question carefully — does it ask you to explain why the answer is always the same, or does it ask you to find what number was chosen — tells you which of these two jobs to do.

Derivation AWhy a "think of a number" trick collapses to a constant

The goal is to show, for the general pattern "think of a number xx, add pp, multiply the result by mm, subtract qq, divide by mm, then subtract the original number xx," that the final answer is always the fixed value p−qmp - \dfrac{q}{m} no matter what xx was chosen, so that any specific trick following this pattern can be checked instantly by reading off pp, qq and mm instead of repeating the whole algebra from scratch.

Step 1. Translate "add pp" into algebra: the expression becomes x+px + p. This is just naming what the first instruction does to the unknown starting value.

Step 2. Translate "multiply the result by mm": the entire previous expression sits inside brackets before the multiplier is applied, giving m(x+p)m(x+p). Expanding with the distributive law, m(x+p)=mx+mpm(x+p) = mx + mp.

Step 3. Translate "subtract qq, then divide by mm": subtracting gives mx+mp−qmx + mp - q, and dividing every term by mm gives mx+mp−qm=x+p−qm\dfrac{mx + mp - q}{m} = x + p - \dfrac{q}{m}.

Step 4. Translate "subtract the original number xx": (x+p−qm)−x=p−qm\left(x + p - \dfrac{q}{m}\right) - x = p - \dfrac{q}{m}. The xx terms cancel exactly, leaving the constant p−qmp - \dfrac{q}{m}, which depends only on the trick's fixed numbers pp, qq, mm and never on the number that was chosen — this is the algebraic proof that the trick works for every starting value. Check against a known case: with p=3p=3, m=2m=2, q=4q=4 (add 3, multiply by 2, subtract 4, divide by 2, subtract the original number), the formula gives p−q/m=3−4/2=3−2=1p - q/m = 3 - 4/2 = 3 - 2 = 1, matching the trick worked out below.

Worked example

Trick: "I thought of a number, added 5, then multiplied the whole result by 3. I got 36. What was my number?" This trick does not collapse to a constant — it gives a numeric clue, so the job is to solve for xx.

Step 1. Let the number be xx. Translating "added 5" gives x+5x + 5, and "multiplied the whole result by 3" gives 3(x+5)3(x+5) — the brackets are essential because the multiplication acts on the entire sum, not just on xx.

Step 2. Set the translated expression equal to the stated result: 3(x+5)=363(x+5) = 36.

Step 3. Expand the left side using the distributive law: 3x+15=363x + 15 = 36.

Step 4. Subtract 15 from both sides: 3x=213x = 21. Divide both sides by 3: x=7x = 7.

Check: substituting back, 7+5=127 + 5 = 12, and 3×12=363 \times 12 = 36, which matches the clue. The original number was x=7x = 7.

Competitive stretch

Suppose the same trick is changed to "added 5, multiplied by 3, then subtracted 6, giving 30." Translating gives 3(x+5)−6=303(x+5) - 6 = 30, so 3x+15−6=303x + 15 - 6 = 30, giving 3x+9=303x + 9 = 30, then 3x=213x = 21, so x=7x = 7 again — the same original number, showing how an extra step just shifts the constant term without changing the method: translate, expand with the distributive law, collect like terms, then isolate xx.

Common traps

  • Forgetting brackets when a step applies to the whole previous result. "Add 5, then multiply by 3" means 3(x+5)3(x+5), not 3x+53x+5; the multiplication must act on everything computed so far.
  • Stopping simplification too early. Testing only one starting number and hitting an arithmetic slip can wrongly suggest the trick "sometimes" works — the algebraic proof, done fully, removes that doubt because it holds for every xx by construction.
  • Mixing up "prove it always works" with "find the number." These are different tasks: the first ends with the xx terms cancelling to a constant; the second ends with an equation you solve for xx.
  • Sign errors when subtracting a bracketed expression. For example, 10−(x+3)10 - (x+3) is often wrongly simplified as 10−x+310 - x + 3 instead of the correct 10−x−3=7−x10 - x - 3 = 7 - x; every term inside the bracket changes sign when the bracket is subtracted.

Ask the tutor: Stuck on why your own number trick did not simplify to a constant, or unsure how to bracket a tricky phrase like "subtract it from double the number"? Ask the AI tutor to walk through your specific trick step by step.

How do I know when to expand brackets versus when to just combine terms?

Expand brackets whenever an operation such as multiplication or division is applied to an entire previous result rather than to a single term — that is exactly what phrases like "multiply the whole result" or "the sum you now have" are signalling. Once every bracket is expanded, you are left with separate xx terms and separate constant terms, and only then should you combine the like terms together. Trying to combine before expanding is the most common source of errors, because it mixes terms that are not actually alike yet.

What if the x terms do not fully cancel when I simplify?

Then the trick is not the "always gives the same answer" kind, and the expression you end up with, something like 2x+32x + 3, is simply the simplified algebraic form of the whole procedure. If the trick then tells you what the final numeric result was, set your simplified expression equal to that number and solve the resulting linear equation for xx, exactly as in the worked example. If no numeric result is given, you have not made an error — the trick may just not be designed to be starting-number-independent.

Why does testing one number, like x equals 7, not count as a full proof?

Substituting one number can confirm your algebra looks right and catch obvious mistakes, but it can never prove the trick works for every possible starting number, because you have only checked a single case out of infinitely many. The algebraic simplification, where the xx terms cancel completely and leave only a constant, is what proves the result for every xx at once — that is the real power of translating the trick into algebra rather than just trying a few numbers.

Before this

Where this leads