1

Introduction. I have three indices, $i$, $j$ and $l$ indicating, respectively, the $i^{th}-$element, the $j^{th}-$element and the the $l^{th}-$element of a set of 2-dimensional points $P=\{ p_1, p_2, p_3, \ldots, p_n \}$, and I would like to write down the subset $Q \subset P$ containing the $k$-nearest neighbours (denoted by $j$) of the element $i$.

Question. If I write $Q = \{ j \, \colon \, d_{ij}<d_{il} \, ,\forall l \neq i \neq j \enspace \land \enspace \left| j \right| = k\}$, would $\left| j \right| = k$ indicate the size of $Q$, i.e. that exactly $k-$elements (denoted by $j$) are part of $Q$? Or, maybe, I should write as $\left| \{ j \} \right| = k$?

Ommo
  • 359
  • 1
    What's wrong with writing the definition of $Q$ using words? It is more understandable than anything you can write with symbols. By the way if you want there to be the set of $k$ nearest neighbors then you have to assume that the distances are all different, otherwise you may need to specify which points from the boundary to choose. – Michal Adamaszek Oct 25 '23 at 10:12
  • thanks @MichalAdamaszek for your comment :-) About the distribution of distances, I could write "a set of randomly distributed 2-dimensional points", which means that the occurrence that k-nearest neighbors are equally distanced from a point $i$ is unlikely. In other words, a random distribution of distances, should help to have all the distances different. Not a big issue in my opinion. About the definition of $Q$ with symbols, I think (just my opinion) it would help readers to compare it with other similar definitions, also written with math symbols. – Ommo Oct 25 '23 at 10:21
  • Still sticking to the math expression of $Q$, I might indicate the size of $Q$ as $\left| Q \right| = k$, instead of $\left| j \right| = k$, or $\left| {j} \right| = k$. However, it would be defining $Q$ with itself, i.e. $Q={ \ldots, , \land , \left| Q \right| = k}$ probably resulting in a logical fallacy (or not?). – Ommo Oct 25 '23 at 10:26
  • 2
    "Let $Q\subseteq P\setminus{p_i}$ be defined as the set such that $|Q|=k$ and $d(p_i,q)<d(p_i,q')$ for all $q\in Q$ and $q'\in P\setminus Q\setminus {p_i}$." – Michal Adamaszek Oct 25 '23 at 10:43
  • thanks a lot! :-) – Ommo Oct 25 '23 at 10:46
  • Just a small doubt: If we indicate a point $p_i$ with its index $i$ (and $p_j$ with its index $j$), can we write the same as you did, i.e. "Let $Q\subseteq P \setminus {i}$ be defined as the set such that $\left| Q \right|=k$ and $d_{ij}<d_{i,j^{\prime}}$ for all $j \in Q$ and $j^{\prime} \in P \setminus Q \setminus {i}$"? Indeed, in some works I see people replacing (or better to say, "indicate") a point with its index. – Ommo Oct 25 '23 at 11:13
  • 1
    Yes it is just as good. Up to your notational convention. – Michal Adamaszek Oct 25 '23 at 11:21
  • Thanks a lot again! :-) :-) – Ommo Oct 25 '23 at 11:23
  • A small thing. Since $j \in Q$ and $j' \in P \setminus Q \setminus {i}$, we can re-write them as follows: $j \in P \setminus ({j'} \cup {i})$, where $Q$ would be simply $Q=P \setminus ({j'} \cup {i})$, and $j' \in P \setminus ({j} \cup {i})$. In this way, we do not need to define $Q$ with itself. – Ommo Oct 26 '23 at 08:21

0 Answers0