I need to find algorithm that can check if system like this
x1 * k + b > y1, x2 * k + b > y2, ..., xn * k + b < yn
has solution(s) where i substitute x[i] and y[i] and unknown varialbes are k,b.
I need to find algorithm that can check if system like this
x1 * k + b > y1, x2 * k + b > y2, ..., xn * k + b < yn
has solution(s) where i substitute x[i] and y[i] and unknown varialbes are k,b.
If only the last inequality is "<" and all the other ones are ">". Here is how to check:
Transform the system to: b > y1 - x1 * k, b > y2 - x2 * k, ..., b < yn - xn * k
And it is easy to see that whether the original system has solutions is equivalent to the system yn - xn * k > y1 - x1 * k, yn - xn * k > y2 - x2 * k, ... has solutions
And it is equivalent to yn - y1 > (xn - x1) * k, yn - y2 > (xn - x2) * k, ... has solutions or not.
Then you need to discuss the signs of xn - xk, whether they are zero, positive or negative, and you can further transform the system to simpler form. For example, if xn - x1 > 0 and xn - x2 <0, it will look like this: k < (yn - y1)/(xn - x1), k > (yn - y2)/(xn - x2), ...
And then it is easy to check whether the new simple system has solutions or not which is equivalent to the original system has solutions or not.
You question is equivalent to asking if the points are linearly separable (with one class of points corresponding to the inequalities with >, the others with <).
You can use the Perceptron Algorithm to find a separating line if one exists. That wikipedia page provides some alternative algorithms too.