Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.