1

In the integers $\mathbb{Z}$, it is well known the definition of absolute value:

$|x|=\begin{cases} x,& \text{if }x\ge0\\-x&\text{if }x<0\end{cases}$

Is there a similar concept of absolute value for the rings of integers modulo n, $\mathbb{Z}_n$, such that the absolute value function maps integers modulo n to integers?

For example, if $-1\in\mathbb{Z_n}$ and $1\in\mathbb{Z}$, does it have any sense the expression: |-1|=1?


What I really want is a metric to measure the "distance" between two elements in $\Bbb{Z}_n$, that way, if $d:\Bbb{Z}_n\times \Bbb{Z}_n\to\Bbb{R}$ is the metric, then the "absolute value" is defined as $|x|=d(x,0)$. Is there any non trivial metric in $\Bbb{Z}_n$?

Jyrki Lahtonen
  • 133,153
  • 4
    You can define a function if you want, and call it "absolute value". The actual question is: what properties do you want that function to have, other than being called "absolute value" and satisfying $f(-1)=1$? Without that information, your question is too vague to have an answer. – Arturo Magidin Oct 10 '22 at 03:31
  • 1
    But in $\Bbb Z_n$ we have $-1=n-1$, so $|-1|$ should be $1$ or $n-1$? This is an obstruction to define such a function in this kind of rings. The concept however can be generalized to some fields, see here – jjagmath Oct 10 '22 at 03:33
  • 1
    Thank you for your answers, I should be more precise with my question, I realize that what I really want is a metric (https://en.wikipedia.org/wiki/Metric_space) to measure the "distance" between two elements in $Z_n$, that way, if $d:\mathbb{Z}_n\times\mathbb{Z}_n\to\mathbb{R}$ is the metric, then the "absolute value" is defined as $|x|=d(x,0)$. Is there any non trivial metric in $Z_n$? – Ser Pounce of House Whiskers Oct 10 '22 at 04:49
  • 1
    I took the liberty of adding your key comment to question body (where it belongs). You may want to study our guide for new askers to get a better idea of what is expected from questions. That way you can avoid getting your questions put on hold - makes for a smoother ride all around :-) – Jyrki Lahtonen Oct 10 '22 at 12:46

1 Answers1

3

The only thing this reminds me of is the Lee metric occasionally used in coding theory (in addition to the more common Hamming metric). For each coset $\overline{a}\in\Bbb{Z}_n$ we choose the representative with the smallest usual absolute value, and use that. In other words, if $a\in\{0,1,\ldots,n-1\}$, we declare $$ \left\vert\overline{a}\right\vert_{\text{Lee}}:=\min\{a,n-a\}. $$ This yields a metric on $\Bbb{Z}_n$ by the recipe $$d_{\text{Lee}}(\overline{a},\overline{b})=\left\vert\overline{a-b}\right\vert_{\text{Lee}}.$$ So for example with $n=4$ we have $$d(\overline{0},\overline{2})= d(\overline{1},\overline{3})=2\quad\text{and}\quad d(\overline{0},\overline{1})=d(\overline{1},\overline{2})=d(\overline{2},\overline{3})=d(\overline{3},\overline{0})=1.$$

It is easy to see that the function $d_{\text{Lee}}$ satisfies the triangle inequality. This becomes obvious if you place $n$ equally spaced points on the circle, label them with cosets modulo $n$ in the obvious way, and measure their distance along the perimeter of the circle, rescaled in such a way that the length of the entire perimeter is equal to $n$.

Do observe that this variant of the absolute value, unlike its better known cousin, is not multiplicative, i.e. we don't have a rule relating $\left\vert\overline{ab}\right\vert_{\text{Lee}}$ to $\left\vert\overline{a}\right\vert_{\text{Lee}}$ and $\left\vert\overline{b}\right\vert_{\text{Lee}}$.


Sometimes in telecommunications phase-shift keying is used, and this leads to the use of the minimum Lee distance of an error correcting code in place of the better known minimum Hamming distance. At least the four phase modulation ($n=4$) or QPSK is in common use. By quirks of metric that can actually be isometrically remapped from $(\Bbb{Z}_4, d_{\text{Lee}})$ to $(\Bbb{Z}_2^2,d_{\text{Hamming}})$, but it is probably better to discuss that in some other thread :-).

Jyrki Lahtonen
  • 133,153