 The seventh chapter of Leholet's commentary on the nine chapters is devoted to the method of excess and deficit. It concerns problems of the following type, an unknown number of contributors and an unknown cost, two contribution rates, one producing an excess and the other a deficit, and the problem to find the number of contributors at the total cost. So one of the problems is, as follows, a group of chickens is purchased by a group of people. If each contributes nine, there is an excess of eleven. If each contributes six, there is a deficit of sixteen. Find the number of persons at the cost of the chickens. Now Leholet actually gives two different ways of solving this type of problem. We'll take a look at the second one as it makes a little bit more sense initially. So we'll add the excess and deficit, eleven plus sixteen, that makes twenty-seven. We'll find the difference in the contribution rates. In other words, we'll subtract nine minus six to get three. Now we'll divide the sum of the excess and deficit, twenty-seven, by the difference of the contribution rates, three. And this result, nine, is the number of persons. And since we know there's nine persons, and if each contributes six, there's a deficit of sixteen, then we know that the total cost must have been nine times six plus sixteen seventy. Now why does this work? Well, we might note the following. A contribution of six gives sixteen to few, there's our deficit, while a contribution of nine gives eleven to much, there's our excess. And so the thing to notice here is that increasing each person's contribution by nine minus six by three increased the total number of coins by sixteen plus eleven, that's twenty-seven. And so that means there must have been twenty-seven divided by three, nine persons. Now Leoughley actually gave two solutions and that was the second one. Excess and deficit problems were often solved in an algorithmic format as follows. If you have an excess and deficit, set down the contribution rates and the excess or deficit, find the sum of the excess and deficit, find the difference of the contribution rates, divide the sum by the difference of the contribution rates to get the number of people, find the sum of the cross products, and then divide the sum of the cross products by the difference of the contribution rates to get the cost. So if we apply that to the problem at hand, we have a contribution rates of 9 and 6, giving us an excess of 11 or a deficit of 16. As before, we'll add the excess and deficit, 11 plus 16 gives us 27. And we'll find the difference in the contribution rates, 9 minus 6 equals 3. And so as before, 27 divided by 3 is 9, the number of persons. Now, the cross product is interesting, so that's the product of 9 by 16 with 11 by 6. So we'll add the sum of the cross products, that gives us 210. And 210 divided by 3 is 70, the cost. Now the reason that this method works is a little bit more complicated, but it's a little bit more interesting as well. If P is the number of people and C is the cost, then we're solving the system of equations 9P equals C plus 11, and 6P is C minus 16. So this is a system of equations. And in modern terms, if we multiply the first equation by 16 and the second by 11, then add, our constant drops out. And so when we divide, we can get this ratio C over P. Now if we just subtract one equation from the other we get, now equals means replaceable. And so what this means is that anytime we see 11 plus 16, we can replace it with 9 minus 6P. And so substituting gives us, and if we look at our expression, we see that all of this, 9 times 16 plus 6 times 11 over 9 minus 6, that must be equal to C. And you'll notice this is the sum of the cross products divided by the difference in the contribution rates. And finally we'll introduce a totally modern viewpoint. The equations we're trying to solve correspond to a system of two equations in two unknowns. And Kramer's rule tells us that the solution to this system of equations in two unknowns can be determined formulaically. And if we apply Kramer's rule, we see that P, the number of persons, is in fact the sum of the access and deficit divided by the difference in the contribution rates. And similarly, the cost is going to be the sum of the cross products divided by the difference in the contribution rates. And so you could say that the Chinese knew Kramer's rule. But you would be incorrect. And that's because Kramer's rule is more than just a formula for solving a system of equations. Rather, it's a relationship between the coefficients of the equation and the solution. And the Chinese never made this connection between the coefficients of the equation and the solution. And so it's incorrect to say that they knew Kramer's rule. The Chinese also considered problems where both contribution rates yielded in excess or both yielded to deficit. The basic approach is the same, the difference in the total divided by the difference in the contribution rates gives the number of people. However, instead of adding the cross products, they'll be subtracted. So if a group of people purchase an object, if each contributes 12, there are 30 coins too few. If each contributes 15, there are nine coins too few. Find the cost and the number of cheapskate persons. So setting up our table, we have a contribution of 12 gives us a deficit of 30, while a contribution of 15 gives us a deficit of nine. So we find the number of persons as before. The difference in the amounts, 30 minus nine is 21, while the difference in the contribution rates, 15 minus 12, is 3. And again, the way we might read this is that if each person contributes three more, we've raised 21 more coins. And so there must be 21 divided by three, seven persons. Now, because both contribution rates produced a deficit, we take a difference of the cross products. And there's only one way to find the cross products and end with a non-negative number. And that's to do 30 minus 15 minus nine times 12, which gives us... And now we divide the difference in the cross products by the difference in the rates. 342 divided by three gives us 114, which is the cost. Similarly, if we have a generous group of people where we get accesses, we can compute the amounts in the same way. So if each person contributes 15, there's 40 coins too much. If each person contributes 10, there's 10 too much. Find the number of persons in the cost. So we'll set up our table with our contribution rates and our access and deficit, both accesses this time. And again, the number of persons is going to be the difference in the accesses divided by the difference in the contribution rates. That's going to give us six. We'll find the difference in the cross products. And again, there's only one way we can find that difference that gives us a non-negative number. And we'll divide the difference in the cross products by the difference in the contribution rates to get the cost 50.