title: Linear equations with modulo
body: <p>This is what I am actually trying to do</p>
  
  <p>Example:</p>
  
  <pre><code>&gt;&gt;&gt; x = matrix([[5,1],[2,4]])
  &gt;&gt;&gt; y = matrix([[1,5],[3,3]])
  &gt;&gt;&gt; print x
  [[5 1]
   [2 4]]
  &gt;&gt;&gt; print y
  [[1 5]
   [3 3]]
  &gt;&gt;&gt; print x*y % 7
  [[1 0]
   [0 1]]
  </code></pre>
  
  <p>Now, in this supposing I don't know <code>y</code>.</p>
  
  <p>I can calculate it using linear equations, like these:</p>
  
  <pre><code>5a + c = 1 mod7
  5b + d = 0 mod7
  2a + 4c = 0 mod7
  2b + 4d = 1 mod7
  </code></pre>
  
  <p>Without the <code>mod7</code>, I can do it like this:</p>
  
  <pre><code>a = np.array([[5,0,1,0],[0,5,0,1],[2,0,4,0],[0,2,0,4]])
  b = np.array([[1,0,1,0]])
  x = np.linalg.solve(a,b)
  </code></pre>
  
  <p>But how do I do it with <code>mod7</code>?</p>