Saturday 28 February 2015

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



To solve $Bx \equiv A \pmod{m}$, use Gauss' algorithm.




The algorithm works perfectly when $A < B$. For example, to solve $6x \equiv 5 \pmod{11}$: $$x \equiv \frac{5}{6} \equiv \frac{5(2)}{6(2)} \equiv \frac{10}{12} \equiv \frac{10}{1}$$
so $x \equiv 10$



But when $A > B$, I run into problems. For example, trying to solve $7x \equiv 13 \pmod{100}$: $$x \equiv \frac{13}{7} \equiv \frac{13(15)}{7(15)} \equiv \frac{195}{105} \equiv \frac{95}{5} \equiv \frac{95(21)}{5(21)} \equiv \frac{1995}{105} \equiv \frac{95}{5}$$ and it continues to be $\frac{95}{5}$. 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 $x \equiv 59$.



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 $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...