Find the set of points where two functions are equal

661 Views Asked by At

Given the function: $$f(M, \vec{p}, d) = \sum_{i=1}^m log(\frac{\mathbb{I}(|\vec{M}_i - \vec{p}|_2<d)}{|\vec{M}_i - \vec{p}|_2})$$ Where $M \in \mathbb{R}^{m \times n}$ is a matrix, $\vec{p} \in \mathbb{R}^{n}$ is a vector describing a point, $d \in \mathbb{R}$ is a minimum distance scalar, and $|\vec{M}_i - \vec{p}|_2$ is the euclidean distance between two points. Also when $\mathbb{I}(|\vec{M}_i - \vec{p}|_2<d)$ is true 1 is returned, otherwise its zero. If I had two different matrices and plugged them into this function, how would I find the $n$ dimensional points where the two functions are equal to each other?

As simple example let us look at the matrices $A$ and $B$: $$A = \begin{bmatrix} 0.3 & 0.3 \\ 0.3 & 0.4 \\ 0.4 & 0.3 \\ \end{bmatrix} B = \begin{bmatrix} 0.6 & 0.6 \\ 0.6 & 0.7 \\ 0.7 & 0.6 \\ \end{bmatrix} $$ And the minimum distance is: $$ d=0.3 $$

How would one go about finding the set of points where $f(A, p) = f(B, p)$? I know you would make them equal to one another like: $$\sum_{i=1}^3 log(\frac{\mathbb{I}(|\vec{A}_i - \vec{p}|_2<0.3)}{|\vec{A}_i - \vec{p}|_2}) = \sum_{i=1}^3 log(\frac{\mathbb{I}(|\vec{B}_i - \vec{p}|_2<0.3)}{|\vec{B}_i - \vec{p}|_2})$$ But I don't know how to solve this. Also bare in mind that I need this to work for examples with points of higher dimensionality ($n > 0$), and when the size of the $m$ dimension of the two matrices are not equal.

To help you understand the problem more clearly I have created a visual aid: A graph describing the intersection of the two functions, where the red line indicates where the two functions would be equal.

If you require any further details feel free to ask.

1

There are 1 best solutions below

7
On

Using properties of $\log$, we can rewrite the equation as $$|A_1-p|^2\cdot |A_2-p|^2\cdot |A_3 -p|^2=|B_1-p|^2\cdot |B_2-p|^2\cdot |B_3 -p|^2.$$ If we write all the points in their coordinates and let $p=(x,y)$, this equation turns into an equation of the form $F(x,y)=0$, where $F(x,y)$ is a two-variable function of degree 5. For general $A,B$, the set of solutions of $F(x,y)=0$ could be complicated.

In this case, the points in $A$ are the vertices of a right triangle and the points in $B$ are obtained by translating the points in $A$ by the vector $(0.3, 0.3)$. The symmetry across the line $y=x$ suggests that a solution $p$ might exist on the line $y=x$. By letting $x=y$ in the equation we get a degree-5 polynomial. It turns out that it has a unique root around $x_0 \approx 0.48$. All other solutions form a curve passing through $(x_0,x_0)$ and the curve is symmetric with respect to $y=x$.