Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Is there any method available in mathematica to eliminate variable from set of inequalities? I tried Eliminate function available, but I guess it works on equalities only.

share|improve this question
    
Please add an example that you used with Eliminate that didn't work. Thanks! –  tkott Dec 11 '12 at 17:09
add comment

2 Answers

I'll borrow an example from another response. Recast as an existance problem in the variable you want to eliminate, then use Resolve.

sol = 
 Resolve[Exists[y, 
   And @@ {x >= 4 y, x <= 3 + 4 y, x >= 0, x <= 63, y >= 0, y <= 15}]]

(* x \[Element] 
  Reals && ((-3 + x <= 0 && -x <= 0) || (-60 + x <= 0 && -x <= 
      0) || (-63 + x <= 0 && 3 - x <= 0) || (-63 + x <= 0 && 
     60 - x <= 0)) *)
share|improve this answer
add comment

You might want to have a look at Reduce :

sol = Reduce[{x >= 4 y, x <= 3 + 4 y, x >= 0, x <= 63, y >= 0, y <= 15}, {y}, Integers] ;

You can then build a function with :

ysol[x_] =  Piecewise[Transpose[{sol[[All, 2, 2]] /. Or -> List, 
                                 sol[[All, 1]] /. Or -> List}]];

DiscretePlot[ysol[x], {x, 0, 63}]

plot

share|improve this answer
    
I feed this {x >= 4 y, x <= 3 + 4 y, x >= 0, x <= 63, y >= 0, y <= 15} and it says Eliminate::eqf: "y<=15 is not a well-formed equation" what does it mean? –  username_4567 Dec 11 '12 at 18:42
    
What output are you trying to get ? –  b.gatessucks Dec 11 '12 at 18:57
    
I want to eliminate variable y from above inequalities.. –  username_4567 Dec 11 '12 at 19:19
    
Isn't there a single simple method to remove a variable for system of inequalities ???/ –  username_4567 Dec 12 '12 at 11:23
    
If the solution provided by Daniel Lichtblau is not what you want please say why. –  b.gatessucks Dec 12 '12 at 11:34
show 2 more comments

Your Answer

 
discard

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.