1

Q. If $m$ and $n$ are two positive integers and $f:A\to A,$ where $A=\{0,1,2,3,...,m-1\},$ is defined by $f(x)= nx\pmod m.$ Find the condition on $n$ and $m$ which ensures that $f$ is one-to-one and onto.


My attempt: Here $f^{-1}$ must exist if $f$ is a bijection. Now as $f$ maps $x$ to $nx$ under modulo $m$ so $f^{-1}$ must map $x$ to $n^{-1}x$ under modulo $m.$ But in $\mathbb Z_m$(or here $A$), $n^{-1}$ will exist iff $\gcd(m,n)=1.$ So I think the required condition should be that $m$ and $n$ are relatively prime. (I don't know what the actual answer is!)

I have just started with number theory and discrete mathematics this semester. So I don't have much knowledge to deal with such type of questions involving moduler arithmetic. So kindly guide me saying that whether my approach is correct or not. If not, please suggest me a way to reach the answer to this question or if it is correct, then can we reach the same conclusion using a different approach? I would love to know about your insights. Thanks in advance...

  • Your conjecture is valid. Try to prove it. What happens if $m$ and $n$ has a common nontrivial factor? Can the multiplication map be onto? Also, proving injectivity is easy in the coprime case. – Berci Feb 06 '21 at 12:58
  • @Berci, Thank you sir for taking time to point out these essential facts. I read your comment one hour back and was trying to establish the facts that you mentioned and luckily I succeeded. I've proved that if $\gcd(m,n)=1$ then $f$ is both one-one and onto but if $\gcd(m,n)>1$ then $f(x)\not\equiv1\pmod m$ which suggests that $f$ is not onto in this case. Thank you! – Usual_Learner Feb 06 '21 at 14:11

1 Answers1

0

Your conjecture is valid.

Observe that a function $g:X\to X$ on a finite set is one-to-one exactly when it's onto: indeed, $g$ collapses two elements of $X$ if and only if its range contains less than $|X|$ elements.

If $d$ is a common divisor of $n$ and $m$, then $d$ also divides $f(x)=nx \mod m$, so in particular, if $d>1$, e.g. $1$ is not in the range of $f$.

On the other hand, if $m,n$ are relatively prime, then $f$ is one-to-one, because then we have $$nx\equiv ny\pmod m\iff m\,|\,n(x-y)\iff m\,|\,(x-y)\iff x\equiv y\pmod m\,.$$

Berci
  • 90,745