Assume that there are three different points in x-y coordinate like:
p1={4, -1}; p2={5, -2}; p3={1, 5}; In order to compare these points to each other in a specific criteria, I have first built List1 which includes the whole possible states:
List1={{{4, -1}, {5, -2}}, {{4, -1}, {1, 5}}, {{1, 5}, {5, -2}}}; The criteria is:
If any of these two points has an x value bigger than the x value of the other point and a y value smaller than the y value of the other point, add this point to a different list. Otherwise move on to the next pair of points. Give a number which shows how many times point1 from List1 satisfies the criteria.
In order to clarify the problem :
first element of
List1includes two points :{{4, -1}, {5, -2}}point1 = {4, -1}andpoint2 = {5, -2}. x1 = 4 < x2 = 5 and y1 = -1 > y2 = -2. So point{5, -2}dominates point{4, -1}: ( 5>4 and -2<-1 )Now put point {5, -2} in a list and give a number which shows how many times point {5, -2} satisfy the criteria.
The final results have to be like bellow:
DominatePoint1 = {{5, -2},2} DominatePoint2 = {{4, -1},1} DominatePoint3 = {{1, 5},0}
How can this be implemented in Mathematica?