0

I asked a question regarding modular arithmetic in CS StackExchange website but think that there are critical mistakes in the modular arithmetic. The following is the link to the question https://cs.stackexchange.com/questions/129527/shortest-path-in-modular-arithmetic/129538#129538.

For the original question, we can reinterpret: x and y connects iff $x + a ≡ y$ mod $n$. The answer rewrite the above congruence $x - y ≡ a$ mod $n$. If we apply addition modular arithmetic, we should get $x - y ≡ -a$ mod $n$. Also, if the above conversion is correct, how does the answer get $x + ma ≡ y$ mod $n$ from $x - y ≡ a$ mod $n$. If both operations are incorrect, how can we play with modular arithmetic to solve this problem?

  • 1
    You misread: they rewrite $\ x\color{#c00}{{\bf -}a}\equiv y\ $ to $\ x-y\equiv a.\ $ Or, equivalently, negate $,a.\ $ Based on your prior (essentially dupe) question I highly recommend you review the basic congruence arithmetic laws linked there. – Bill Dubuque Aug 24 '20 at 17:29
  • 2
    $a\equiv-a\bmod \mathbf 2$ – J. W. Tanner Aug 24 '20 at 17:30
  • 2
    @J.W.T But it's $!\bmod 7,$ not $!\bmod 2,\ $ and it's better to learn the general idea. – Bill Dubuque Aug 24 '20 at 17:32
  • 1
    $x + m a \equiv y\pmod{!n}$ comes from a path of length $m$ between $x$ and $y$, i.e. start at $x$ then take $m$ steps of length $a$ to reach $y$, on a (modular) clock of $n$ hours. – Bill Dubuque Aug 24 '20 at 17:43
  • 2
    As here, when you have questions about a specific answer it is usually best to first pose them in comments on the answer. If you don't receive an adequate reply then you can post a new question. That way you may help to improve the answer. – Bill Dubuque Aug 24 '20 at 17:47

0 Answers0