Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a two lists $LHS$ and $RHS$, both of size $n$. I want to solve a system of inequalities of the form:

$$LHS[1] \leq RHS[1]$$

$$LHS[2] \leq RHS[2]$$

$$LHS[3] \leq RHS[3]$$


$$LHS[n] \leq RHS[n]$$

We assume that:

Each $LHS[i]$ is a linear equation in $m$ variables, say: $\alpha_{1}, \dots, \alpha_{m}$ and each $RHS[i]$ is a linear equation in $m$ variables, say: $\beta_{1}, \dots, \beta_{m}$.

We need to solve for $\alpha_{1}, \dots, \alpha_{m}$, $\beta_{1}, \dots, \beta_{m}$, which are positive integers.

Take m=2. To solve a single inequality (for some $i$ between $1$ and $n$) I know that I need to enter:


(I haven't put the constrains to make the code simpler)

But, if I need to solve all the inequalities, how do I input a list in 'Reduce' ?

Thanks a lot in advance.

share|improve this question
Have you checked the documentation? From the doc one example which should help you: Reduce[x^2 + y z == 1 && x + 2 y <= 3 z + 1 && x y z > 7, {x, y, z}, Reals]. If this does not help you, can you post a minimal specific example, not the general problem? – halirutan Oct 16 '12 at 23:42
Do you just need something like And @@ Thread[lhs <= rhs]? – wxffles Oct 16 '12 at 23:50
up vote 4 down vote accepted

You could use Inner to build the system of inequalities:

Reduce[ Inner[ LessEqual, lhs, rhs, And], Variables[{lhs,rhs}], Reals ]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.