Saturday, 28 February 2015

discrete mathematics - using Gauss' algorithm (for linear congruences) for A > B



To solve BxA(modm), use Gauss' algorithm.




The algorithm works perfectly when A<B. For example, to solve 6x5(mod11): x565(2)6(2)1012101
so x10



But when A>B, I run into problems. For example, trying to solve 7x13(mod100): x13713(15)7(15)19510595595(21)5(21)1995105955 and it continues to be 955. Am I missing a step?



PS: I was applying the algorithm on random linear congruence problems I could find. The second example comes from http://www.johndcook.com/blog/2008/12/10/solving-linear-congruences/, which says the answer is x59.



update




This answer answered my question. It explains that Gauss' algorithm works only on prime modulo.


Answer



This answer answered my question. It explains that Gauss' algorithm works only on prime modulo.


No comments:

Post a Comment

real analysis - How to find limhrightarrow0fracsin(ha)h

How to find lim without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...