Connect via MCP →

Enter Calculation

Enter a leftover surplus as a positive number and a shortage as a negative number.

Formula

Advertisement

Results

Number of people
3
people
Total number of items 18 items

What is the surplus-and-deficit word problem?

The surplus-and-deficit problem (known in Japanese elementary math as "kabusoku-zan") is a classic arithmetic puzzle: a group of people share a fixed number of items two different ways. In one scenario each person gets a certain number of items and some are left over (a surplus) or fall short (a shortage); in a second scenario each person gets a different number, again leaving a surplus or shortage. From these two facts you can determine exactly how many people there are and how many items in total. A common story version has friends gathering chestnuts and dividing them, but the math applies to any distribution problem.

Diagram showing people each receiving items at two different rates, one leaving leftover items and one falling short
The surplus-and-deficit problem: distributing items at two rates, one leaving a surplus and one a shortage.

How to use the calculator

Enter the items per person for each of the two scenarios, then enter the resulting surplus or shortage for each. Use the sign convention: a leftover surplus is a positive number, and a shortage (not enough) is a negative number. The calculator returns the number of people and the total number of items, or warns you if the data is inconsistent.

The formula explained

Let n be the people and T the total items. Each scenario says the total equals (rate per person times people) plus the signed leftover: \(T = \text{rate}_1 \times n + \text{result}_1\) and \(T = \text{rate}_2 \times n + \text{result}_2\). Setting them equal and solving gives $$N = \frac{\text{Result}_2 - \text{Result}_1}{\text{Rate}_1 - \text{Rate}_2}$$ Then \(T = \text{rate}_1 \times n + \text{result}_1\). The two rates must differ, otherwise there is no unique answer.

Formula visualization showing difference of surplus and deficit divided by difference of rates equals number of people
Number of people equals the gap between the two remainders divided by the gap between the two rates.

Worked example

Each person gets 5 items leaving 3 over (rate1 = 5, result1 = +3); each gets 7 items but is 3 short (rate2 = 7, result2 = −3). Then $$n = \frac{-3 - 3}{5 - 7} = \frac{-6}{-2} = 3 \text{ people},$$ and \(T = 5 \times 3 + 3 = 18\) items. Check: \(7 \times 3 - 3 = 18\). So 3 people picked 18 chestnuts.

FAQ

What if I enter equal rates? The denominator becomes zero and there is no unique solution, so the calculator reports an error.

Why must the answer be a whole number? People and items are counted in whole units; a fractional result means the inputs do not form a valid problem.

Does the sign convention matter? Yes. Always enter a surplus as positive and a shortage as negative so the equations balance correctly.

Last updated: