title: How to solve one linear algebra equation with 2 unknowns using Python
body: <p>Trying to solve problem of 2 investments with 2% and 4% annual interest respectively. If $10,000 total was originally invested and the account had $10,250 at year end, what was the principal in each investment. I've tried using the solve function </p>
  
  <p>This is the equation I came up with to represent the problem.
  1.04x+1.02y=10000 * 1.025</p>
  
  <p>However I'm not sure that I'm properly placing the coefficients into the arrays.</p>
  
  <p>This is the code I set up:</p>
  
  <pre><code>import numpy as np
  
  A = np.array([[1.0,1.0],[104,102]])
  Y = np.array([[1.025],[10000.0]])
  np.linalg.solve(A, Y) 
  </code></pre>
  
  <p>I'd expect the results to be $7500 and $2500 which satisfy the equation and up to $10,250, however running my code I get:</p>
  
  <pre><code>array([[ 4947.725],
         [-4946.7  ]])
  </code></pre>