<a href="https://colab.research.google.com/github/tofighi/Linear-Algebra/blob/main/4A_Applications.ipynb" target="_parent"></a>


```python
import sympy as sp
sp.init_printing(use_unicode=True)
```


```python
flowMat = sp.Matrix([[1,1,1,0,0,0,500], [1,0,0,1,0,1,400], [0,0,1,0,1,-1,100], [0,1,0,-1,-1,0,0]])
flowMat
```




$\displaystyle \left[\begin{matrix}1 & 1 & 1 & 0 & 0 & 0 & 500\\1 & 0 & 0 & 1 & 0 & 1 & 400\\0 & 0 & 1 & 0 & 1 & -1 & 100\\0 & 1 & 0 & -1 & -1 & 0 & 0\end{matrix}\right]$




```python
flowMat.rref()
```




$\displaystyle \left( \left[\begin{matrix}1 & 0 & 0 & 1 & 0 & 1 & 400\\0 & 1 & 0 & -1 & -1 & 0 & 0\\0 & 0 & 1 & 0 & 1 & -1 & 100\\0 & 0 & 0 & 0 & 0 & 0 & 0\end{matrix}\right], \  \left( 0, \  1, \  2\right)\right)$




```python
coffeeMat = sp.Matrix([[0.3,0.6,0.1], [0,0.8,0.2], [0.5,0.5,0]]).T
coffeeMat
```




$\displaystyle \left[\begin{matrix}0.3 & 0 & 0.5\\0.6 & 0.8 & 0.5\\0.1 & 0.2 & 0\end{matrix}\right]$




```python
drinks = sp.Matrix([1,0,0])
drinks
```




$\displaystyle \left[\begin{matrix}1\\0\\0\end{matrix}\right]$




```python
for i in range(10):
    drinks = coffeeMat*drinks
    print(drinks)
```

    Matrix([[0.300000000000000], [0.600000000000000], [0.100000000000000]])
    Matrix([[0.140000000000000], [0.710000000000000], [0.150000000000000]])
    Matrix([[0.117000000000000], [0.727000000000000], [0.156000000000000]])
    Matrix([[0.113100000000000], [0.729800000000000], [0.157100000000000]])
    Matrix([[0.112480000000000], [0.730250000000000], [0.157270000000000]])
    Matrix([[0.112379000000000], [0.730323000000000], [0.157298000000000]])
    Matrix([[0.112362700000000], [0.730334800000000], [0.157302500000000]])
    Matrix([[0.112360060000000], [0.730336710000000], [0.157303230000000]])
    Matrix([[0.112359633000000], [0.730337019000000], [0.157303348000000]])
    Matrix([[0.112359563900000], [0.730337069000000], [0.157303367100000]])


bfbfb20c18e5d27dac893bc9b0298ae264da5c61
ipynb
Jupyter Notebook
4A_Applications.ipynb
tofighi/Linear-Algebra
bea7d2a4a81e0c49b324f23c47cf03db72e376cf
CC0-1.0
4A_Applications.ipynb
tofighi/Linear-Algebra
bea7d2a4a81e0c49b324f23c47cf03db72e376cf
CC0-1.0
4A_Applications.ipynb
tofighi/Linear-Algebra
bea7d2a4a81e0c49b324f23c47cf03db72e376cf
CC0-1.0
Qwen/Qwen-72B
1. YES
2. YES