If $A$ and $B$ are co-primes (i.e. $\gcd(A,B)=1$), does $A\cdot x \bmod B$ (where $x\in \mathbb N$) give as result an element of $\{0,1,2,....,B-1\}$ ?
Asked
Active
Viewed 77 times
4
-
1Are you asking whether every element in the set can be reached given appropriate $x$ (e.g. this function is surjective) or are you "just" asking whether the result will always be in this set (without additional properties)? (I've also edited your post to look fancier, if you don't like any changes feel free to edit again) – SEJPM Jun 04 '16 at 20:50
-
Yes, I am asking whether the result will always be in this set or not !!!? – ut42 Jun 30 '16 at 05:01
1 Answers
6
Claim: If $A$ and $B$ are coprime, the map $$\begin{align*} \{0,\dots,B-1\}\ &\to\ \{0,\dots,B-1\} ,\\ x \ &\mapsto\ A\cdot x\bmod B \end{align*}$$ is a well-defined bijection.
It is clear directly from the definition of $\bmod$ that $A\cdot x\bmod B$ is indeed between $0$ and $B-1$. Surjectivity follows, e.g., from Bézout's lemma. Any surjection between finite sets of the same cardinality is automatically bijective.
In particular, this implies that the map $$\begin{align*} \mathbb Z\ &\to\ \{0,\dots,B-1\} ,\\ x \ &\mapsto\ A\cdot x\bmod B \end{align*}$$ is also surjective.

yyyyyyy
- 12,081
- 4
- 47
- 68