What this calculator does
This is a practice tool for a classic algebra word problem: three people whose ages are linked by two age differences and a known total. For example, "Mary is 2 years younger than Alex, and Alex is 7 years older than Sam. If the sum of their ages is 75, find each age." You set up the problem, solve it on paper, type in your three answers, and the tool grades each one and shows the complete worked solution.
How to use it
Enter the three names, the two age differences, and the younger/older relations, plus the total of all three ages. Then type your guessed ages for each person. The calculator marks each answer correct or incorrect and reveals the algebra. It is a generic teaching tool and is not tied to any country or units other than years.
The formula explained
Pick the middle person (Person 2) as the pivot variable x. Translate each statement using a sign: "older" adds the difference (+1), "younger" subtracts it (-1). Then Person 1 = \(x + s_1 d_1\) and Person 3 = \(x - s_2 d_2\). Adding all three ages gives \(3x + s_1 d_1 - s_2 d_2 = S\), so $$x = \dfrac{S - s_1 d_1 + s_2 d_2}{3}.$$ The remaining ages come straight from the relations.
Worked example
With Mary 2 years younger than Alex (\(s_1 = -1\), \(d_1 = 2\)) and Alex 7 years older than Sam (\(s_2 = +1\), \(d_2 = 7\)), and sum 75: $$\text{Alex} = \frac{75 - (-1\times 2) + (1\times 7)}{3} = \frac{75 + 2 + 7}{3} = \frac{84}{3} = 28.$$ So Mary = \(28 - 2 = 26\) and Sam = \(28 - 7 = 21\). Check: \(26 + 28 + 21 = 75\).
Definitions & Glossary
- Person 1, Person 2, Person 3 — the three people in the word problem. Person 2 is chosen as the reference (pivot) person; Person 1 and Person 3 each have their age stated relative to Person 2.
- Pivot variable \(x\) (Person 2's age) — the single unknown the problem is reduced to. Once \(x\) is found, the other two ages follow directly from the differences.
- \(d_1\), \(d_2\) (age differences) — the two given gaps in years: \(d_1\) is how much Person 1 differs from Person 2, and \(d_2\) is how much Person 3 differs from Person 2. Both are entered as positive numbers; the direction is carried by the sign.
- \(s_1\), \(s_2\) (sign factors) — each equals \(+1\) when that person is older than Person 2 and \(-1\) when younger. They convert the spoken relation ("older"/"younger") into algebra: Person 1 \(= x + s_1 d_1\), Person 3 \(= x + s_2 d_2\).
- \(S\) (sum of ages) — the known total of all three ages, \(S = P_1 + P_2 + P_3\). It is the constant that lets the single equation be solved.
- Pivot formula — combining the three relative ages and the total gives \(\,3x + s_1 d_1 + s_2 d_2 = S\,\), i.e. \(\,x = \dfrac{S - s_1 d_1 - s_2 d_2}{3}\,\); each age is then recovered and the sum re-checked against \(S\).
FAQ
Why is Person 2 the pivot? Both statements relate to Person 2, so choosing them as the unknown keeps the algebra to a single variable.
What if my numbers do not give a whole answer? For a clean problem, choose differences and a sum so that \((S - s_1 d_1 + s_2 d_2)\) is divisible by 3 and all ages are positive.
Does it grade my work or just the final ages? It compares each entered age to the correct value and shows the full solution so you can check your reasoning.