Home> urticator.net Search About This Site > Domains Glue Stories Computers Driving Games Humor Law > Math Numbers Science Continued Fractions Game Theory (Section) > Group Theory Probability Miscellaneous A Theorem on Finite Abelian Groups The Structure of Zn How to Compute Inverses in Un
|
How to Solve Simultaneous CongruencesI already explained how to solve simultaneous congruences in An Example. The first part of that explanation is flawless.
Suppose we're trying to solve a set of congruences The second part is OK, I guess. It explains how to find the numbers Gi, but it does it in prose, by example, and as a result it feels nebulous, like there's nothing there for my mind to grab on to. Nowadays I'd rather see the results in a table, like so, even though there's almost no interaction between the rows.
Here (and in An Example) the number n is the product of all the moduli mi, in this case 18981. The solution x is defined modulo n. Now let's look at the columns one by one.
What about the case where the moduli mi aren't relatively prime? In practice, I haven't run into it, so I guess it's not particularly useful, but it's easy to understand, so sure, let's take a quick look. The key lies two essays before An Example, in the first paragraph of The Structure of Un. For each i, we can break the original congruence modulo mi into congruences modulo the prime power factors of mi. Then, whenever a prime occurs in more than one congruence, the congruence with the largest exponent will win, and the rest will be either redundant or incompatible. For example, if we know that x ≡ 5 mod 8, then x ≡ 1 mod 4 is redundant but x ≡ 2 mod 4 is incompatible. New topic! Remember the formula for the solution x?
x = sum ( ai Gi ) Here's an interesting special case. If the parameters ai are identically 1, then the solution is just the sum of the Green's functions. However, the solution is also obviously just 1. Therefore, we have the following result.
sum ( Gi ) ≡ 1 mod n When computing a table, we can use that result either as a shortcut to get the last Green's function or as a checksum at the end. Here's another interesting special case. If there are three congruences, and the parameters ai are some permutation of −1, 0, and 1, then the solution is the difference of two Green's functions. Let's consider the six possible permutations and differences all at once. Of the six differences, three are positive, and of the three, the two smallest always add up to the third. The reason for that is easy to understand. If for example G3 > G2 > G1, then
(G3 − G1) = (G3 − G2) + (G2 − G1). Of course, in modular arithmetic nothing is greater than or less than anything else, and as a result nothing is positive or negative. However, the identity above is still valid, and in fact there are five others just like it that are now equally valid. Now, here's the strange part. Suppose we normalize the six differences into the range [0,n) and ignore the fact that we shouldn't compare them. The two smallest may not be the same as before, but they still always add up to another difference! Sadly, I don't know any elegant way to prove that. We just have to look at cases, eliminate some, and observe that the rest are covered by the six identities. For example, if G3 − G2 is the smallest difference, then G3 − G1 can't be the next smallest, because
(G2 − G1) = (G3 − G1) − (G3 − G2) < (G3 − G1). Finally, let's take a quick look at the simultaneous congruences that appeared in the thread Number Maze. In The Next Block I ran into the second special case, but I solved it with an ad hoc method. For comparison, here's the table of Green's functions for n = 231. As expected, the positive differences are 55, 56, and 111.
In Odds and Ends there were actually two layers of simultaneous congruences. In the first layer there were two instances of the second special case (plus some easier problems). Here's the table of Green's functions for n = 663. As expected, the positive differences are 169, 170, and 339.
And here's the table of Green's functions for n = 665. As expected, the positive differences are 20, 56, and 76.
In the second layer there were a bunch of simultaneous congruences based on the same moduli. They weren't special cases, though, so I was forced to break out the Green's functions. So, the results in this table aren't new.
Here I left everything unnormalized, partly for consistency with the previous results and partly for clarity. Since n = 73188570, the normalized form of −440895 would be 72747675, a completely unhelpful number.
|
See Also@ November (2024) |