# How do I Solve this Seemingly Simple Set of Four Equations with Four Unknowns?

I have what looks like a set of simple simultaneous equations: 4 equations with 4 unknowns. The numbers are really simple, and in fact I already know the answer, but I cannot figure out how to work this out by hand. It started with me looking at a box of numbers like this:

I've shown the sum of the columns and the rows. The equations based on this are:

1) A + B = 10
2) C + D = 12
3) A + C = 15
4) B + D = 7


I thought this would be simple enough to solve. At first I didn't even attempt it. When I did, I kept going in circles. Here's what I tried:

• A = 10 - B, eq #1
• (10 - B) + C = 15, eq #3
• C = 5 + B, simplified
• (5 + B) + D = 12, eq #2
• B + D = 7, simplified

This gives me equation #4 which doesn't tell me anything. I tried a different approach:

• [A + B = 10] - [A + C = 15] = [B - C = -5], eq #1 - eq #3
• C = B + 5, simplified
• [C + D = 12] - [B + D = 7] = [C - B = 5], eq #2 - eq #4
• C = B + 5, simplified

This doesn't give me anything useful because I now have one equation with two unknowns. I can't use the original four equations at this point because I've already used them.

Is there something obvious that I'm missing? Is this problem harder than it seems? I'd like to know how to do this with just pen and paper

Here are the answers by the way:

A = 5, B = 5, C = 10, D = 2

You actually only have three equations in four unknowns, because any three of them implicitly yield the fourth. For example, knowing the two row sums tells you that the sum of all four numbers is $22$. Thus only one of the column sums tells you anything new. There are thus an infinite number of solutions.
In addition to your solution, for instance, we have $A = 6, B = 4, C = 9, D = 3$. Your observation of $C = B+5$ yields the infinite solutions (once you include also $A = 10-B$ and $D = 12-C = 7-B$). There are only eight solutions in non-negative integers, corresponding to $B = 0$ to $7$.
• Another way to see there are an infinite number of solutions is to observe that adding $1$ to $A$ and $D$ while subtracting $1$ from $B$ and $C$ leaves all the row and column sums unchanged. – Ben Millwood Apr 6 '15 at 22:24
$$\left[\begin{matrix} 1&1&0&0\\0&0&1&1\\1&0&1&0\\0&1&0&1\end{matrix}\right] \left[\begin{matrix}A\\B\\C\\D \end{matrix} \right] = \left[\begin{matrix}10\\12\\15\\7\end{matrix}\right]$$