I always see questions on here that deal with this modular stuff, and I have no idea what any of it means, so I figured I would ask here.
So lets say we have $$a \equiv b\pmod n$$ The example on wiki is $$38\equiv 14\mod 12$$ This is because 38-14 = 24, which has a factor of 12. Why is it 12 instead of 24, 3, 4? It gives an practical example of a clock. I get that that is a mod 12 (I think) but how do I write that in the notation used above? This is just some self learning in the small spare time I have
If you do programming, you should be familiar with the usage of
%as an operator that (depending on your language) is either the remainder after division or modulus operator (they are slightly different in how they handle negative numbers, but they are essentially the same idea). If you are not familiar with it, I suggest you get familiar with it, because it is an extremely useful tool used in a number of different applications.If two numbers a, and b, are equivalent mod n, we write $a \equiv b \mod n$, which is really a shorthand for the assertion that $\exists \ c\in\Bbb Z : a - b = c\cdot n$, or that the difference between $a$ and $b$ is some integral multiple of $n$. There are a number of other forms that one could put that assertion in, but they are all essentially equivalent to this one.
While $38\equiv 14\mod 2$, $38\equiv 14\mod 3$, $38\equiv 14\mod 4$, $38\equiv 14\mod 6$, $38\equiv 14\mod 8$, $38\equiv 14\mod 18$, and $38\equiv 14\mod 24$ are all true, the reason wikipedia use $38\equiv 14\mod 12$ as an example is because the article draws an analogy between modular arithmetic and time with it. The reason they use 12 is because the article was written by Americans, who use the numbers from 1 up through 12 to identify hours of the day (because it would be just silly to use the numbers up through 24 like everyone else, and nobody I know numbers their hours up through 2, 3, 4, 6, 8, or 18). In terms of the 'time' analogy for modular arithmetic, it basically means that you will be identifying the hour of the day with the same ordinal after 14 hours from now as you will after 38 hours.