How to generate a list of sets of inequalities in mathematics

I want to do the following in Mma. Suppose I have three expressions x1, 3 x1-x2, x2-x1where 0<=x1,x2<=1). I want to have another one that defines the largest of the three, at least half the size. Thus, there is some permutation of three in order:

x1<=3 x1-x2<=x2-x1 && 2 x1<=x2-x1
3 x1-x2<=x1<=x2-x1 && 2 (3 x1-x2)<=x2-x1

.... with the remaining 4 similar conditions.

How can I create these conditions automatically (along with 0<=x1,x2<=1) and then submit them to “Explain one by one” and solve for x2 in terms of x1?

Many thanks!

+3
source share
2 answers
eqs = {x1, 3 x1 - x2, x2 - x1};
Reduce[Max[eqs] >= 2 Min[eqs], {x1, x2}, Reals]

If you want to make comparisons with the second largest or third largest / smallest, then you can use RankedMax

x2 - x1 x2, , RegionPlot

RegionPlot[Max[eqs] >= 2 Min[eqs], {x1, 0, 1}, {x2, 0, 1}, PlotPoints -> 100]
+3

Max Min x2 x1 , .

In[1]:= Reduce[
         Max[x1, 3 x1 - x2, x2 - x1] >= 2 Min[x1, 3 x1 - x2, x2 - x1] && 
         0 <= x1 && x2 <= 1, 
         {x2, x1}]
0

Source: https://habr.com/ru/post/1785072/


All Articles