Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In one of the programming work I am doing, I encountered a set of linear eqns. with modulo. I am putting it in simple format with only 2 variables,

$$(a_{11}x + a_{12}y) \mod 8 = b_1$$ $$(a_{21}x + a_{22}y) \mod 8 = b_2$$

In case of simple eqns. with out modulo I can use: $AX=B$, $X=A^{-1}B$. But how to handle this modulo? Any clue or pointers will be very helpful.

share|cite|improve this question

You can do Gauss-Jordan elimination performing operations modulo $8$. Just be mindful that "division" is only defined for odd integers (you are really multiplying by the inverse modulo $8$).

share|cite|improve this answer

You can apply Cramer's rule if the determinant is odd (so invertible mod 8). For an introduction to linear algebra over commutative rings see Wm. C. Brown: Matrices over commutative rings.

share|cite|improve this answer

Your Answer


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.