Skip to content

Instantly share code, notes, and snippets.

@ordovician
Last active January 2, 2016 20:29
Show Gist options
  • Save ordovician/8357126 to your computer and use it in GitHub Desktop.
Save ordovician/8357126 to your computer and use it in GitHub Desktop.
Equivalence Relations in modulo aritmetic.
mod(A, C) == r
# then
mod(A + k*C, C) == r
# so if
mod(A, C) == mod(B, C)
# then
mod(A, C) == mod(A + k*C, C) == mod(B, C)
# so
B == A + k*C
# meaning
A - B == A - (A + k*C)
A - B == k*C
# which shows that C is a factor of A - B, which we write as:
# C | (A-B)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment