Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I'm trying to figure out whether my hardware function for mapping operating system pages to DDR memory controllers is injective:

$$F(x) = a x \pmod{b},\text{ where $x$ in $[0,b)$, $a$ and $b$ are co-prime}$$

My hunch is that it is injective and I think it has to do with the Chinese Remainder Theorem, though it may be some other theorem. Also, is "$a,b$ are co-prime" sufficient? Or does $a$ also need to be greater than $b$?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Yes, $\rm\ gcd(a,b)=1,\ \ b\:|\:ax\ \Rightarrow\ b\:|\:x\ $ by Euclid's Lemma

Said functionally: $\rm\ ax\equiv 0\ \Rightarrow\ x\equiv 0\ \ (mod\ b)\ $ so $\rm\ x\to ax\ $ is injective.

More intuitively, by Bezout's identity, $\rm\ gcd(a,b)=1\ \Rightarrow\ a^{-1}\ $ exists $\rm\ (mod\ b)\:.\: $ Therefore one can multiply $\rm \ ax\equiv ay\ $ by $\rm\:a^{-1}\:$ to deduce $\rm\ x\equiv y\:$.

share|improve this answer
add comment

It is injective, your hunch is correct.

If $\displaystyle ax = ay \mod b$ then $\displaystyle a(x-y) = 0 \mod b$. Since $\displaystyle a$ and $\displaystyle b$ are co-prime, $\displaystyle x-y= 0 \mod b$ and hence $\displaystyle x = y$, as $\displaystyle x,y \in [0,b)$.

It does not matter whether $\displaystyle a \gt b$ or not.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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