So I'm writing a paper (computer sciences) that involves moore neighbourhoods. If I am using set builder notation to define a set, can I use index form for example to either index elements of the set or include an argument that is a variable used in the set builder expression? Ideally I'd like to do this without having to define loads of other functions.

For example let's say I want to use the following to show a moore neighbourhood around $0$: \begin{align}\|(x_1,...,x_d)\|_\infty &= \text{max}(|x_1|,...,|x_d|) \\ M_{r}^{/0} &= \{ \mathbf{m} \in \mathbb{Z}^d : 1 \leq \|\mathbf{m}\|_\infty \leq r \} \\ \end{align} Can I simply then use $M_{1}^{/0}$ to show a Moore neighbourhood of range 1? Or must I define some additional function of some sort? Can I then extend this idea to show that the elements of $M_{1}^{/0}$ can also be indexed? For example, it would be great if I could simlply write $\mathbf{m_{1,i}}$ where $\mathbf{m_{1,i}} \in M_{1}^{/0} $ to show that I'm accessing the $i^{\text{th}}$ element of a Moore neighbourhood with a range of 1. In effect I want to be able to show the accessing of elements of $M_{r}^{/0}$ using a function with two arguments $m(r,i)$. How do I achieve this in the most succinct way possible ideally without introducing a load of function definitions? I should also mention that my background is computer science and not maths. Also, any corrections to do with the notation I've used would be appreciated.


Your way to denote $\mathbf{M}_r^{/0}$ seems accurate. You are then free to substitute the $r$ in this notation by any number you like, so e.g. $\mathbf M_1^{/0}$ to denote the neighborhood of range one. No additional definition is necessary.

If the exact order of the element you want to index is not of importance, you can just write that you assume that

$$\mathbf M_r^{/0}=\{\mathbf m_{r,1},...,\mathbf m_{r,k(r)}\},$$

where $k(r)$ denotes the size of a Moore-neighborhood of range $r$. Now you are free to write $\mathbf m_{r,i}\in\mathbf M_r^{/0}$ for any element in the neighborhood. Just do not assume that the index $i$ stands for anything else than a distinguishing feature from the other elements.

Of course, if you need a specific order of the neighbors, you can always say that $\mathbf M_r^{/0}=\{\mathbf m_{r,1},...,\mathbf m_{r,k(r)}\}$, where the indices are chosen so that $i<j$ implies $\mathbf m_{r,i}\prec \mathbf m_{r,j}$. Here $\prec$ denotes a specifically defined order of the grid points, e.g. lexicografic $(1,2)\prec(1,3)$ and $(2,3)\prec(3,1)$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.