```python
import numpy as np
```


```python
A = np.array([[2,-3,1],[1,-2,1],[3,1,-2]])
B = np.array([[2],[7],[10]])
```


```python
np.linalg.inv(A).dot(B)
```




    array([[19.5],
           [24.5],
           [36.5]])






```python
from sympy import *
A1 = Matrix(A)
A1.rref()
```




    (Matrix([
     [1, 0, 0],
     [0, 1, 0],
     [0, 0, 1]]), (0, 1, 2))




```python
Aug = np.array([[2,-3,1,2],[1,-2,1,7],[3,1,-2,10]])

Aug2 = Matrix(Aug)
Aug2.rref()
```




    (Matrix([
     [1, 0, 0, 39/2],
     [0, 1, 0, 49/2],
     [0, 0, 1, 73/2]]), (0, 1, 2))




```python
np.column_stack([A,B])
```




    array([[ 2, -3,  1,  2],
           [ 1, -2,  1,  7],
           [ 3,  1, -2, 10]])




```python
v1 = np.array([1,2,-1,2])
v2 = np.array([-3,3,1,0])
v3 = np.array([-1,7,-1,4])


```


```python
Matrix(np.vstack([v1,v2,v3])).rref()
```




    (Matrix([
     [1, 0, -5/9, 2/3],
     [0, 1, -2/9, 2/3],
     [0, 0,    0,   0]]), (0, 1))



# Finding r


```python
m = Matrix(np.vstack([v1,2*v2,v2,v1+v2,v3,v1-v3]))
(m.T).rref()
```




    (Matrix([
     [1, 0,   0,   1,   2,   -1],
     [0, 1, 1/2, 1/2, 1/2, -1/2],
     [0, 0,   0,   0,   0,    0],
     [0, 0,   0,   0,   0,    0]]), (0, 1))



eb4d2f09892231d0884ee641ab6df1bf7e98b2b8
ipynb
Jupyter Notebook
notebooks/test Assignment-4.ipynb
ganeshj05/titanic
30695e266b8b77450f98557167590c694b42f3c4
MIT
notebooks/test Assignment-4.ipynb
ganeshj05/titanic
30695e266b8b77450f98557167590c694b42f3c4
MIT
notebooks/test Assignment-4.ipynb
ganeshj05/titanic
30695e266b8b77450f98557167590c694b42f3c4
MIT
Qwen/Qwen-72B
1. YES
2. YES