Skip to content
Technique

Count integer solutions by fixing one variable

Algebra • Equations • Linear Equations

Statement

To count the solutions of a linear equation in several unknowns over the positive integers, fix one unknown at each of its admissible values in turn, count the solutions of the equation that remains in the other unknowns, and add those counts. The two-unknown case is the base: with has exactly solutions, because may be any of and is then forced.

How to use it

  1. 1Work out the range of the variable you fix before counting anything: every other unknown still needs at least , which is what bounds it.
  2. 2Fix the variable that leaves the simplest equation behind - in any of them will do, in fix the one with the coefficient.
  3. 3The counts usually come out as a run of consecutive integers, so the total is a triangular number rather than a sum to be added term by term.
  4. 4Check the two ends of the run by hand: the largest value of the fixed variable should leave exactly one solution.

Worked example

How many ordered triples of positive integers satisfy ?

Step-by-step

  1. 1
    can be or

    Why: and are each at least , so .

  2. 2
    For a fixed : has solutions

    Why: The two-unknown base case, with .

  3. 3
    give solutions, and

Answer

Watch out

The bound on the fixed variable changes with the constraint: over the non-negative integers has solutions, not , and ignoring that shift is the usual slip. The count is of ordered tuples, so and are two solutions; and the method needs every coefficient to be positive, or the admissible range is not a finite run.

Builds on

Also known as

number of positive integer solutions of x+y+z=n, count integer solutions by cases, fix one variable and sum the cases, number of solutions of a linear equation in positive integers

Appears in past papers

2020 (II)