I'll see if I can't help with the following...
I am really lost at rearranging the matrices in the form given in their examples
Here's some tips for going between matrices and Python list
s and numpy
array
s
$$
v =
\begin{pmatrix}
9 \\\
8 \\\
7
\end{pmatrix}
$$
Where I usually see $v_{\left(1\right)} = 9$ and $v_{\left(3\right)} = 7$ is written just a bit like...
vList = [9, 8, 7]
vArray = np.array(vList)
# vList[0] # -> 9
# vArray[2] # -> 7
... and in most programming languages the index starts at 0
, but it looks like you've got that.
Things get interesting with nested lists and multidimensional numpy arrays...
$$
p =
\begin{pmatrix}
0.3 & 0.6 & 0.9 \\\
0.4 & 0.7 & 0.8 \\\
0.5 & 0.8 & 0.7
\end{pmatrix}
$$
Which could be represented as a numpy.array
as shown...
p = np.array([
[0.3, 0.6, 0.9],
[0.4, 0.7, 0.8],
[0.5, 0.8, 0.7]
])
Accessing rows could then look like...
p[0]
# -> array([ 0.3, 0.6, 0.9])
p[2]
# -> array([0.5, 0.8, 0.7])
... but accessing cells is likely to frustrate those that want precision at a cellular level...
p[2,0]
# -> 0.5
# ... above looks okay...
p[0,0]
# -> 0.29999999999999999
# ... but that was `0.3`...
p[1,1]
# -> 0.69999999999999996
# ... and that should have been `0.7`
Even funkier than that...
p * 5
# -> array([[ 1.5, 3. , 4.5],
# [ 2. , 3.5, 4. ],
# [ 2.5, 4. , 3.5]])
Hopefully this gave ya some traction on translating your problem into something that a computer will consider, as well as some pointers on how not to use numpy
. It's fantastic but misusing it can lead to anger, and anger can lead to; well let's not even consider the paths divergent from light ;-)
Best Answer
The question may be formulated as $$ \begin{bmatrix}2&3\\6&5\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix} =\begin{bmatrix}3\\0\end{bmatrix} $$ You solve it by finding the inverse of the leftmost matrix and multiplying by that inverse from the left to obtain $$ \begin{bmatrix}x\\y\end{bmatrix} =\begin{bmatrix}2&3\\6&5\end{bmatrix}^{-1}\begin{bmatrix}3\\0\end{bmatrix} $$ which means that $\left[\begin{smallmatrix}x\\y\end{smallmatrix}\right]$ may be found by calculating the product on the right-hand side.