0

There's probably a formal way to put this with rings, but suppose I have a number x and mod base M and divisor d. I know x mod M = x', and that d is divisible by x. How do I find x/d mod M?

It seems possible because if you take x = 12, M = 5, d = 3 for example, only knowing that x' = 2, you can deduce that x/d = 4.

Bernard
  • 175,478

1 Answers1

0

Let $\,x = dy,\,$ so $\,y = x/d.\,$ Then $\bmod m\,$ we seek to solve $\,dy\equiv \bar x\,$ for $\,y.\,$ By general theory there is a unique solution $\!\iff\! \gcd(d,m)=1.\,$ If so, $\,d^{-1}$ exists $\!\bmod m\,$ and $\,y \equiv \bar x d^{-1} \pmod{\!m}$.

e.g. $x = 14 = 2(7) = 2y$. Then $\,2y = 14\equiv 4\pmod{\!10}\!\iff$ $ 2y = 4+10n\iff$ $ y = 2+5n$ $\iff y \equiv 2,7\pmod{\!10}\,$ has $\,\color{#c00}2\,$ solutions (since $\,\gcd(2,10)= \color{#c00}2),\,$ so it is impossible to uniquely determine $\,y\bmod 10\,$ given only $\,2y\bmod 10$.

As explained in the link, we can view the solution $\,y\,$ of $\,dy\equiv \bar x\pmod{\!m}$ as a modular fraction $$y\,\equiv\, \dfrac{\bar x}{d}\!\!\!\pmod{\!m}\,\equiv\, \dfrac{\bar x\color{#c00}{/c}}{d\color{#c00}{/c}}\!\!\!\pmod{\!m\color{#c00}{/c}}\qquad $$

by cancelling $\,\color{#c00}{c} = \gcd(d,m)\,\ \rm\color{#c00}{everywhere},\,$ e.g. $\,c = \gcd(2,10) = 2\,$ in the example above so

$$y\,\equiv\,\dfrac{4}2\!\!\!\!\pmod{\!10}\, \equiv\, \dfrac{2}1\!\!\!\!\pmod{\!5}\qquad$$

in the example above. As shown in the link, if $\,c\nmid \bar x\,$ then there are no solutions, else there are $\,c\,$ solutions $\bmod m,\,$ i.e. the map $\,y\mapsto dy\,$ is $\,c\,$ to $1\,$ when viewed modulo $\,m$.

Bill Dubuque
  • 272,048