A geometric perspective on counting non-negative integer solutions and combinatorial identities

We consider the effect of constraints on the number of non-negative integer solutions of x+y+z = n, relating the number of solutions to linear combinations of triangular numbers. Our approach is geometric and may be viewed as an introduction to proofs without words. We use this geometrical perspective to prove identities by counting the number of solutions in two different ways, thereby combining combinatorial proofs and proofs without words.


Introduction
Combinatorial proofs reduce a mathematical result to a counting problem, often by counting an amount in two different ways to arrive at an identity. In Proofs that Really Count: the Art of Combinatorial Proof, Benjamin and Quinn [1] provide an accessible and engaging introduction to combinatorial proofs, viewing their text as the 'counting equivalent of the visual approach' used by Nelsen in Proofs without Words I & II, [2,3] where mathematical results are illustrated with few or no words, often by relying on geometric representations of the results. In this article, we prove identities involving triangular numbers by using geometry to count the number of non-negative integer solutions of an equation under inequality constraints in two different ways, thereby combining combinatorial proofs and proofs without words.
Despite our emphasis on pictures to prove the results, we include words to explain the interplay between the geometry and the combinatorics not only to aid the exposition, but also to serve as a guide to how geometry can be used to construct such proofs. To build up to the results, we use geometry to explain the effect of successively adding inequality constraints to the set of non-negative integer solutions of x + y + z = n. As the reader (hopefully) becomes more comfortable with the geometric approach, we decrease the use of words to accompany the pictures. We conclude by challenging the reader to prove a final combinatorial result and include its pictorial proof as a supplement to this article. Our approach and results are in the spirit of other recent work that uses geometry to look at combinatorial results, [4,5] as well as the invitation by Alsina and Nelsen [6] to use proofs without words to 'stimulate mathematical thought'.

Non-negative integer solutions of x + y + z = n and triangular numbers
For positive integer n, the solutions to x + y + z = n lie on a plane in R 3 that intersects the positive octant. The three points (n, 0, 0), (0, n, 0), and (0, 0, n) not only define the aforementioned plane, but also are vertices of the equilateral triangle that intersects the plane with the positive octant, as in Figure 1(a). Evenly spaced within the triangle, the non-negative integer solutions of x + y + z = n form a lattice. For example, the lattice of non-negative integer solutions of x + y + z = 6 is shown in Figure 1 The number of dots evenly spaced within and along the sides of a regular polygonal figure is referred to as a figurate number. Accordingly, the number of evenly spaced dots in the equilateral triangle is referred to as a triangular number. For example, the triangular number 15 is perhaps best recognized as the shape a rack of billiard balls takes at the beginning of a game of pool; it is the fifth triangular number because it has five dots along each side. Denoting the mth triangular number as T m , the first four triangle numbers are z y x (n, 0, 0) (0, n, 0) The nonnegative integer lattice for x + y + z = 6.  T 1 = 1, T 2 = 3, T 3 = 6, T 4 = 10, and their geometric representation is shown in Figure 2. By definition, T m = 0 for m ≤ 0. By counting each row of dots beginning at the top of the triangle, triangular numbers may be viewed as sums of consecutive integers, where T 1 = 1, T 2 = 1 + 2, T 3 = 1 + 2 + 3, T 4 = 1 + 2 + 3 + 4, and so on. Therefore, the mth triangular number is the sum: by generalizing the well-known approach that a school-aged Gauss used to sum the first 100 positive integers. This sum is equal to m+1 , the number of ways to choose two items from a set of m + 1 items. Because the bottom row of the triangular lattice in Figure 1(b) has n + 1 solutions (for which z = 0), there are T n + 1 non-negative integer solutions to x + y + z = n.

Non-negative integer solutions and inequality constraints
The position of each dot in the equilateral triangular associated with T n + 1 corresponds to a particular non-negative integer solution of x + y + z = n. The interrelationship between these non-negative solutions can be used to count solutions with specific properties. The following example relates the solutions to x + y + z = 6 to their position in the equilateral triangle associated with T 7 , and how this geometry can be used to count the number of non-negative integer solutions to x + y + z = n when x satisfies an inequality constraint.

Example 3.1:
The non-negative integer solutions of x + y + z = 6 form an integer lattice in the shape of the equilateral triangle associated with T 7 , as pictured in Figure 1(b). Because each dot of the T 7 triangle corresponds to a particular non-negative integer solution of x + y + z = 6 (as demonstrated in Figure 3), relationships between the solutions can be exploited. For example, the coordinates (2, y, z) fall on a line that is parallel to the side of the equilateral triangle opposite the vertex (6, 0, 0); this line is the intersection of x = 2 and the portion of x + y + z = 6 in the positive octant. The solutions to x + y + z = 6 with x = 2 (bold in Figure 3) partition the non-negative integer solutions into the sets: those for which x ≥ 2 and x < 2. From the geometry in Figure 3, the numbers of non-negative integer solutions of x + y + z = 6 with x ≥ 2 and x < 2 are T 5 and T 7 − T 5 , respectively. This follows because there are five solutions on the side with vertices (2, 0, 4) and (2, 4, 0); they have y coordinates of 0, 1, 2, 3, and 4.
The approach in Example 3.1 to count the number of non-negative integer solutions to x + y + z = n under a single inequality constraint on one variable is generalized below. We focus on the case in which the constraint z ≥ k affects the non-negative integer solutions because it may be visually easier to see. By considering the complement of the set of nonnegative integer solutions to x + y + z = n for which z ≥ k, the number of solutions for which z < k can be determined as the difference of two triangular numbers. Of course, the result also determines the number of non-negative integer solutions for a single constraint in any other single variable by symmetry. The proof of Proposition 3.2 follows from Figure 4(a).

Proposition 3.2:
For 0 ≤ k ≤ n, the number of non-negative integer solutions of x + y + z = n is A similar geometric approach can be used to determine the number of non-negative integer solutions to x + y + z = n under inequality constraints on two of the variables.
Case (3): As in the previous cases, the inequality constraints may be taken in succession. Taking z < k first and applying Proposition 3.2 Case (2), the number of non-negative integer solutions to x + y + z = n when z < k is T n + 1 − T n + 1 − k , which is equal to the number of solutions in the set ∪ •, denoted by | ∪ •|, in Figure 4(b). The additional constraint y < j eliminates the solutions for which y ≥ j, denoted by | ∪ •| in Figure 4 Case (3) in Proposition 3.3 is interesting for at least three reasons. First, the number of non-negative integer solutions is also equal to | × ∪ | − | × |, which amounts to counting the solutions for which y < j first, and then restricting the set to those which also satisfy z < k. Second, counting the number of solutions is an example of the inclusion-exclusion principle. Specifically, the entire expression T n + 1 − T n + 1 − k − T n + 1 − j + T n + 1 − j − k starts with all solutions and subtracts away those for which z ≥ k and those for which y ≥ j, but then adds back in those solutions for which both z ≥ k and y ≥ j (because these were subtracted twice). In terms of the solutions from Figure 4(b), the inclusion-exclusion principle is represented Finally, the number of solutions counted in Case (3) may be counted another way, providing a general combinatorial identity, as shown in the following theorem. This embodies the central theme that counting nonnegative integer solutions is an accessible and ripe area to generate combinatorial proofs that can be understood through geometry.

Theorem 3.4:
For any n with 0 < j, k ≤ n, Proof: From Proposition 3.3 Case (3), the right-hand side of Equation (1) counts the number of non-negative integer solutions to x + y + z = n when y < j and z < k. Recall that the associated solutions are represented by in Figure 4(b), which is recreated in Figure 5(a). From Figure 5(b), | | is also given by | ∪ ♦ ∪ ⊗| − |♦| − |⊗|. Notice that the ♦ solutions form a triangular number of side length one less than j because there are j solutions, denoted by , on the z = 0 side of the triangular lattice. Hence, |♦| = T j − 1 . Similar logic shows that |⊗| = T k − 1 by the relationship of the solutions on the y = 0 side of the lattice. The number of symbols along the side of the inverted equilateral triangle parallel to x = 0 is (j − 1)

Corollary 3.5:
The number of non-negative integer solutions of x + y + z = n when y < j and z < k is jk.
Proof: The solutions represented by in Figure 5 form a rhombus with j dots on one side and k dots on the other. Hence, there are jk solutions.
Up to symmetry, there are four cases for when x, y, and z are each restricted by inequality constraints (and not distinguishing between weak and strict inequalities). Two of the four cases lie at the heart of the combinatorial identities in the next section. For completeness, the other two are given below.

Proposition 3.6:
For 0 ≤ i, j, k ≤ n, the number of non-negative integer solutions of x + y + z = n is Proof: The proofs of both cases stem from Figure 4(c).
Case (1): As suggested in Figure 4(c), the number of non-negative integer solutions of x + y + z = n when x ≥ i, y ≥ j and z ≥ k is |•| = T n + 1 − i − j − k . This follows by considering the effect of each inequality constraint in succession and by repeatedly applying Proposition 3.2 Case (1).
Case (2): By Proposition 3.3 Case (1), the number of non-negative integer solutions to x + y + z = n when y ≥ j and z ≥ k is T n + 1 − j − k . In Figure 4(c), this is pictured by • ∪ . The solutions which also satisfy x < i are represented by . It follows that | (1) and Proposition 3.2 Case (2). Figure 4(c) in a predictable way in the proof of Case (2) in Proposition 3.6. As the effect on the constraints becomes more complicated, it is not so easy to 'see' their effect. In the next section, we prove a combinatorial identity, in the spirit of Theorem 3.4, that is based on two visual proofs that count the number of non-negative integer solutions to x + y + z = n subject to the constraints x < i, y < j, and z ≥ k. The proof applies results from this section, as well as the principle of inclusion-exclusion. Because the pictures associated with the proof are more complicated, we break the solution into a number of cases and 'show' the result for each case.
The number of non-negative integer solutions of x + y + z = n, when x < i, y < j, and z < k, is counted two different ways as well; this combinatorial identity appears as Theorem 5.1. A more complete treatment of determining the number of non-negative integer solutions under inequality constraints on the variables appears in the text. [7]

A combinatorial identity proved by pictures
The following theorem is based on counting, in two different ways, the number of nonnegative integer solutions of x + y + z = n, when x < i, y < j, and z ≥ k, and is proved via pictures. The proof is more complicated than those in Section 3 because the relationship among i, j, k, and n changes the geometry. For this reason, we break the general problem into the following cases that specify the relationship between the variables: Each case results in a side-by-side picture that counts the number of non-negative integer solutions, represented by •'s, in two different ways. The proof uses fewer words than those in Section 3, as Section 3 was viewed as an introduction to the relationship between triangular numbers and non-negative integer solutions of x + y + z = n under inequality constraints. We use less words as the proof progresses, so that the final cases are truly in the tradition of a proof without words, in which the geometric representation tells the whole story. Although the proof depends on the results from Section 3, explicit references to previous results have been omitted (e.g. we will no longer say that a result is due to one of the propositions in Section 3). However, to help see the geometric relationships, symbols for intersecting regions are defined naturally. For example, a region of and a region of + intersect in a region denoted by . Recall that T m = 0 for m ≤ 0; because it is not always obvious when an index is not positive, we denote T m for m ≤ 0 by T m to emphasize that its value is always zero.

Theorem 4.1:
For non-negative integers i, j, k, and n such that max {i, j, k} ≤ n, Each side of Equation (2) is the result of counting the number of non-negative integer solutions to x + y + z = n subject to the inequality constraints x < i, y < j, andz ≥ k. The right-hand side of Equation (2) uses the approach from Section 3. The left-hand side introduces the line z = n − i − j and counts solutions relative to their positions to this line. This is why the cases of the proof focus on the relationship between k and n − i − j. The same symbols may be used to represent different types of solutions in the left and right figures that follow. In the proof, the left-hand side of Equation (2) always corresponds to the left picture in a figure; similarly, for the right-hand side of Equation (2) and the right picture.
Proof: Case (1): Consider the left-hand side of Equation (2). The triangular number T i + j + 1 is equivalent to all integer solutions denoted by •, , × , and ⊗ in the left-hand picture of Figure 6. (The lone ⊗ solution is at the intersection of the lines x = i and y = j in Figure 6 (left).) In order to satisfy the inequality constraints x < i and y < j, we must subtract off the triangular numbers T i + 1 and T j + 1 . Since k ≤ n − i − j, the subscripts of the next three terms are either zero or negative; hence, these triangular numbers equal zero. The left-hand side of Equation (2) Following the same approach for the right-hand side of Equation (2), the triangular number T n − k − 1 is equivalent to all integer solutions denoted by •, , × , or ⊗ in the righthand picture of Figure 6. In order to satisfy the inequality constraints x < i and y < j, we must subtract off the triangular numbers T n − k − i + 1 and T n − k − j + 1 . In doing so, we end up subtracting off the region denoted by (⊗) in the right-hand picture of Figure 6 twice. Hence, the triangular number T n − i − j − k + 1 must be added back again. Thus, we can express the right-hand side of Equation (2) For Case (1), Equation (2) may be written as where the left and right sides of the equation count the same number of solutions in the left and right pictures of Figure 6, respectively, because Case (2a): The left-hand side of Equation (2) counts the • entries in Figure 7 (left). This is done by noticing that |• ∪ ∪ × ∪ ⊗ ∪ + | = T i + j + 1 and then subtracting off | × ∪ ⊗ | = T i + 1 , and | ∪ ⊗| = T j + 1 , and | + | = T i + j + k − n − 2 . Because the lone ⊗ solution is subtracted twice, it is added back in with the '+1' because |⊗| = 1.
The right-hand side is similar, but a little simpler. There are T n + 1 − k solutions with z ≥ k; these are represented by • ∪ × ∪ in Figure 7 (right). The solutions that also satisfy x ≥ i are given by × , where | × | = T n − k − i + 1 ; the solutions for which y ≥ j are given by International Journal of Mathematical Education in Science and Technology 607 Notice that the T-terms have indices less than or equal to zero (based on the inequalities that define Case (2a)). Case (2b): A similar approach is used for this case. The left-hand side of Equation (2) Case (2c): The third sub-case of Case (2) is as complicated as possible for the left-hand side of Equation (2) Case (  Notice that the conditions on i, j, and k assure that i + k − n − 2 ≤ 0, j + k − n − 2 ≤ 0, and n − i − j − k + 1 ≤ 0. Counting the number of solutions in each region leads to the following result: Case (3b): In Figure 11, the non-negative integer solutions satisfy  so that Case (3c): Similar to Case (2c), this case follows from Figure 12 because Counting the number of solutions of each type yields which completes the proof.

Concluding remarks
Counting the number of non-negative integer solutions to x + y + z = n for x < i, y < j, and z < k in two different ways leads to Theorem 5.1. The solutions for which x ≤ i, y ≤ j, and z ≤ k were counted previously in [8].
Theorem 5.1: For non-negative integers i, j, k, and n such that max {i, j, k} ≤ n, The same cases used in the proof of Theorem 4.1 can be used to prove this new theorem. Once again, the approach for the left-hand side of Equation (3) is to consider how the line z = n − i − j partitions the non-negative integer solutions for different relationships between n − i − j and k. Equation (3) can be simplified because the same triangular numbers appear on each side of the equal sign. Eliminating these redundancies dresses up Equation (3) to yield the following identity.

Corollary 5.2:
For non-negative integers i, j, k, and n such that max {i, j, k} ≤ n, We provide pictorial proofs of the identity in Theorem 5.1 in a manner similar to the proof of Theorem 4.1 in a supplemental document available on the journal's website. As a challenge, see if you can construct the figures to complete the proof. However, as a caveat, Case (1) is a degenerate case because there are no solutions satisfying the constraints; this becomes apparent from the corresponding figure. Also, for easy comparison, our figures for the different cases all have n = 20. The parameters i, j, and k for each of the cases will be denoted by (i, j, k). In the supplementary document, we use the following parameters in our figures: Case (1): (9,5,2); Case (2a): (9,6,9); Case (2b): (9,5,13); Case (2c): (9,5,18); Case (3a): (16,10,2); Case (3b): (16,10,7); and Case (3c): (16,10,14). One can check that each of these parameter values satisfies the cases.
One can imagine how the solutions to x 1 + x 2 + x 3 + x 4 = n under different inequality constraints on the x i 's would lead to an identity equating different linear combinations of tetrahedral numbers. Although the pictures add to the understanding of the identity, it can be proved without a geometric approach by considering changes of variables and repeated applications of the inclusion-exclusion principle. This approach can be generalized to count the number of non-negative integer solutions to x 1 + · · · + x m = n under inequality constraints, a topic considered in [7].