# Determining number of positive integer solutions to Ax + By + Cz + Dw < Z ?

I would like a method to determine the number of positive integer solutions for an linear inequality, of the form:
$Ax + By + ... < Z$ given integer A,B, .. Z and integer $x,y,z,w \ge 0$

For example, there are 11 solutions to $3x + 5y < 15$

I know this is similar to the existing question ( Count the number of positive solutions for a linear diophantine equation ). However, I am unclear about extending it to cover the inequality - Do I need to apply the formula for each 0 .. Z ? Also, it seems difficult to go from even $Ax + By = N$ to $y + z = n$ while remaining in integers.

-

Your $2$-dimensional question could be reformulated as counting the number of lattice points in the triangle with corners $(x,y) = \{(0,0), (5,0), (0,3)\}$, but without counting the points on the long diagonal. In that case it is one less than half of the number of lattice points in the rectangle formed by those points and $(5,3)$, which contains $24$ points, so then it is $11$. – TMM Sep 5 '11 at 18:49
In $2$ dimensions you could generalize this for arbitrary $A, B, Z$, but for higher dimensions it becomes harder I think. – TMM Sep 5 '11 at 18:53

## 1 Answer

The number of positive solutions of $3x+5y<15$ is the same as the number of positive solutions of $3x+5y+z=15$. The same "trick" works in general. Thus (apart from an increase of $1$ in the number of variables), there is no great difference between $<K$ and $= K$.

The real problems, whether one is dealing with equality or inequality, come from the implicit congruential restrictions.

There are a number of ideas that one can use, none very pleasant. It is useful to reformulate the problem so that we are looking for non-negative solutions. Then we can use generating functions to obtain an explicit $F(t)$ such that, for any $n$, the number of solutions with right-hand side equal to $n$ is the coefficient of $t^n$ in the power series expansion of $F(t)$. That is unfortunately not necessarily a practical computational tool for finding an exact answer.

-

"come from the implicit congruential restrictions": Are you talking about the equality case here? Can you give a concrete example? – Srivatsan Sep 6 '11 at 5:39
@Srivatsan Narayanan: Consider $2x+3y \le n$ or equivalently $2x+3y+z=n$, non-negative solutions.  The number of solutions is not too hard to compute.  But we get $6$ slightly different "formulas," for $n congruent to$0$,$1$,$\dots 5$(modulo$6\$). – André Nicolas Sep 6 '11 at 10:43
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 29, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9223105907440186, "perplexity_flag": "head"}