1

How can I calculate the arithmetic mean in a multiplicative group modulo $n$?

For example: if $n=15$, $a=8$ and $b=5$ then I want to find the mean of $a$ and $b$ as $7$. If $a$ and $b$ were real numbers then, the mean of $a$ and $b$ can be defined as the real number $\frac{a+b}{2}$. What I want is a way to calculate, from the integers $a$ and $b$ (that belong to the multiplicative group modulo $n$), the integer $[\frac{a+b}{2}]$ using only operations permited in the multiplicative group modulo $n$.

mip
  • 223
  • A "division by two" modulo $n$ is not possible, if $a+b$ is odd and $n$ even, you have to rule out this case. – Peter Aug 23 '18 at 11:47
  • I know that it is not possible but I'm asking whether exists an algorithm oto calculate (a+b)/2 using only operation permitted in multiplicative group modulo n? – mip Aug 23 '18 at 11:50
  • If $n$ is odd, it is easy. Either $a+b$ is even, then just apply usual division by $2$, or it is odd , then add $n$ and then apply usual division by $2$. If $a+b$ is even, then you can apply the usual division by $2$ no matter what $n$ is. – Peter Aug 23 '18 at 11:52

0 Answers0