What is the sum and difference problem?
The sum and difference problem asks: if you know the sum of two numbers and the difference between them, what are the two numbers? This is a classic arithmetic word-problem type taught in Japanese elementary schools, where it is called "wasazan" ("wa" = sum, "sa" = difference). While the name is culture-specific, the underlying math is pure, universal algebra.
How to use this calculator
Enter the sum of the two numbers and the difference (the larger number minus the smaller number). The calculator instantly returns both the larger and the smaller number. The difference is conventionally entered as a non-negative value; if you enter a negative value, its absolute value is used.
The formula explained
Suppose the larger number is a and the smaller is b. Then we know two facts:
\(a + b = S\) (the sum) and \(a - b = D\) (the difference).
Adding these two equations cancels the b terms: \(2a = S + D\), so the larger number is $$a = \frac{S + D}{2}$$. Subtracting them cancels the a terms: \(2b = S - D\), so the smaller number is $$b = \frac{S - D}{2}$$. Because we always divide by the constant 2, there is never any divide-by-zero risk.
Worked example
Two numbers add up to 15 and differ by 3. The larger number is $$\frac{15 + 3}{2} = \frac{18}{2} = 9.$$ The smaller number is $$\frac{15 - 3}{2} = \frac{12}{2} = 6.$$ Check: \(9 + 6 = 15\) and \(9 - 6 = 3\). Both conditions hold.
FAQ
Can the answers be decimals? Yes. When the sum and difference do not have the same parity, the results are non-integer. For example, sum 10 and difference 3 give 6.5 and 3.5, which is perfectly valid.
What if the difference is 0? Then both numbers are equal, each being \(S / 2\).
Can the result be negative? Mathematically the formula works for any real numbers, so if the difference exceeds the sum, the smaller number will come out negative. For the typical "two positive numbers" interpretation, keep the difference no larger than the sum.