Division in modular arithmetic when multiplicative inverse does not exist

modular arithmetic

Lets suppose we have two integers $a$ and $b$ such that $b\mid a$ and an integer $p$ that is not co-prime with $b$. In that case, $b^{-1}$ does not exist in $\mathbb{Z_p}$, but there is an integer number, let's call it $c$, that satisfy the relation $\frac{a}{b}=c$. The question is that could we consider that $c \mod p$ is the answer to the calculation $\frac{a}{b}\pmod p$?

Let's show a concrete example, $\frac{7!}{5!}\pmod 5$, $5!$ has no inverse, but $\frac{7!}{5!}=42$ and $42 \bmod 5 = 2$, so could we say that $2$ is the answer to the question or an answer does not exist?

Thanks

Best Answer

There are two distinct things happening here.

The fraction $\frac{7!}{5!}$ does not exist in the ring $\Bbb Z_5$. However, the integer $\frac{7!}{5!}$ does exist, and through the modulo map is sent to $2$ in $\Bbb Z_5$.

There is really no contradiction here. There is only an abuse of notation as a fraction can both represent direct modular division, or it can represent an integer which is then sent to the modular ring. Which fractions are valid will depend on the interpretation (for instance, $\frac{7!}{5!}$ is invalid in the first interpretation and valid in the second, while something like $\frac32$ is valid in the first and invalid in the second). A saving grace, however, is that when both interpretations agree that the fraction exists then they do agree on its value.

Related Question