\[ \matrix{ x_1 & + & 2x_2 & = & 5 \cr 3x_1 & - & 4 x_2 & = & 6 } \, \, \Leftrightarrow \begin{bmatrix} 1 & 2 \\ 3 & -4 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 5 \\ 6 \end{bmatrix} \]
\[ \matrix{ x_1 & + & 2x_2 & = & 5 \cr 3x_1 & - & 4 x_2 & = & 6 } \, \, \Leftrightarrow \begin{bmatrix} 1 & 2 & 5 \\ 3 & -4 & 6 \end{bmatrix} \]
What did the fish say when he hit the wall?
Dam.
It's inappropriate to make a dad joke if you are not a dad.
It's a faux pa.
(Ab <- matrix(c(1,-2,3,-3,7,-5,2,-8,-9,6,-19,-9),3))
[,1] [,2] [,3] [,4]
[1,] 1 -3 2 6
[2,] -2 7 -8 -19
[3,] 3 -5 -9 -9
refmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 1 -3 2 6
[2,] 0 1 -4 -7
[3,] 0 0 1 1
refmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 1 -3 2 6
[2,] 0 1 -4 -7
[3,] 0 0 1 1
rrefmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 1 0 0 -5
[2,] 0 1 0 -3
[3,] 0 0 1 1
(Ab <- matrix(c(1,2,4,2,6,3,-4,-6,-15,5,8,13),3))
[,1] [,2] [,3] [,4]
[1,] 1 2 -4 5
[2,] 2 6 -6 8
[3,] 4 3 -15 13
refmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 1 2 -4 5
[2,] 0 2 2 -2
[3,] 0 0 6 -12
refmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 1 2 -4 5
[2,] 0 2 2 -2
[3,] 0 0 6 -12
rrefmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 1 0 0 -5
[2,] 0 1 0 1
[3,] 0 0 1 -2
\[ \scriptsize{ \begin{align} & &\begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} & | & a_{1,n+1} \\ a_{21} & a_{22} & \cdots & a_{2n} & | & a_{2,n+1} \\ \vdots & \vdots & \ddots & \vdots & | & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} & | & a_{n,n+1} \end{bmatrix} & \begin{matrix} R_2 = R_2 - \frac{a_{21}}{a_{11}}R_1 \\ \vdots \\ R_n = R_n - \frac{a_{n1}}{a_{11}}R_1 \end{matrix} \\ \\ & \rightarrow & \begin{bmatrix} a_{11}^{(2)} & a_{12}^{(2)} & \cdots & a_{1n}^{(2)} & | & a_{1,n+1}^{(2)} \\ 0 & a_{22}^{(2)} & \cdots & a_{2n}^{(2)} & | & a_{2,n+1}^{(2)} \\ \vdots & \vdots & \ddots & \vdots & | & \vdots \\ 0 & a_{n2}^{(2)} & \cdots & a_{nn}^{(2)} & | & a_{n,n+1}^{(2)} \\ \end{bmatrix} & \begin{array} {llll} a_{1j}^{(2)} = a_{1j}^{(1)}, \, \, j = 1, \ldots, n+1 \\ a_{k1}^{(2)} = 0, \, \, \, \, \, \, k = 1, \ldots, n \\ a_{kj}^{(2)} = a_{kj}^{(1)} - m_{k1} \cdot a_{1j}^{(1)} \\ m_{k1} = \frac{a_{k1}^{(1)}}{a_{11}^{(1)}}, \, \, a_{11}^{(1)} \neq 0 \end{array} \end{align} } \]
\[ \scriptsize{ \begin{bmatrix} a_{11}^{(k)} & a_{12}^{(k)} & \cdots & a_{1,k-1}^{(k)} & a_{1,k}^{(k)} & \cdots & a_{1n}^{(k)} & | & a_{1,n+1}^{(k)} \\ 0 & a_{22}^{(k)} & \cdots & a_{2,k-1}^{(k)} & a_{2,k}^{(k)} & \cdots & a_{2,n}^{(k)} & | & a_{2,n+1}^{(k)} \\ 0 & 0 & \ddots & \vdots & \vdots & \cdots & \vdots & | & \vdots \\ 0 & 0 & \cdots & a_{k-1,k-1}^{(k)} & a_{k-1,k}^{(k)} & \cdots & a_{k-1,n}^{(k)} & | & a_{k-1,n+1}^{(k)} \\ 0 & 0 & \cdots & 0 & a_{k,k}^{(k)} & \cdots & a_{k,n}^{(k)} & | & a_{k,n+1}^{(k)} \\ 0 & 0 & \cdots & 0 & a_{k+1,k}^{(k)} & \cdots & a_{k+1,n}^{(k)} & | & a_{k+1,n+1}^{(k)} \\ 0 & 0 & \cdots & \vdots & \vdots & \cdots & \vdots & | & \vdots \\ 0 & 0 & \cdots & 0 & a_{n,k}^{(k)} & \cdots & a_{n.n}^{(k)} & | & a_{n,n+1}^{(k)} \\ \end{bmatrix}} \]
\[ \scriptsize{ \begin{array} {llll} a_{ij}^{(k)} & = & a_{ij}^{(k-1)}, & 1 \leq i \leq k-1, & 1 \leq j \leq n+1 \\ a_{ij}^{(k)} & = & 0, & k \leq i \leq n, & 1 \leq j \leq k-1 \\ a_{ij}^{(k)} & = & a_{ij}^{(k-1)} - m_{i,k-1} \cdot a_{k-1,j}^{(k-1)}, & k \leq i \leq n, & k \leq j \leq n+1 \\ m_{i,k-1} & = & \frac{a_{i,k-1}^{(k-1)}}{a_{k-1,k-1}^{(k-1)}}, & {a_{k-1,k-1}^{(k-1)}} \neq 0 & k \leq i \leq n \end{array} } \]
\[ \scriptsize{ \begin{bmatrix} a_{11}^{(n)} & a_{12}^{(n)} & \cdots & a_{1,k}^{(n)} & \cdots & a_{1n}^{(n)} & | & a_{1,n+1}^{(n)} \\ 0 & a_{22}^{(n)} & \cdots & a_{2,k}^{(n)} & \cdots & a_{2,n}^{(n)} & | & a_{2,n+1}^{(n)} \\ 0 & 0 & \ddots & \vdots & \ddots & \vdots & | & \vdots \\ 0 & 0 & \cdots & a_{k,k}^{(n)} & \cdots & a_{k,n}^{(n)} & | & a_{k,n+1}^{(n)} \\ \vdots & \vdots & \cdots & \vdots & \ddots & \vdots & | & \vdots \\ 0 & 0 & \cdots & 0 & \cdots & a_{n,n}^{(n)} & | & a_{n,n+1}^{(n)} \\ \end{bmatrix} } \]
\[ \scriptsize{ \begin{array}{rcrcccccccc} a_{11}^{(n)}x_1 & + & a_{12}^{(n)}x_2 & + & \cdots & + & a_{1k}^{(n)}x_k & + & \cdots & + & a_{1n}^{(n)}x_n & = & a_{1,n+1}^{(n)} \\ 0x_1 & + & a_{22}^{(n)}x_{2} & + & \cdots & + & a_{2k}^{(n)}x_k & + & \cdots & + & a_{2,n}^{(n)}x_n & = & a_{2,n+1}^{(n)} \\ 0x_1 & + & 0x_{2} & + & \cdots & \vdots &\vdots &\vdots & \cdots & \vdots & \vdots & = & \vdots \\ 0x_1 & + & 0x_{2} & + & \cdots & + & a_{kk}^{(n)}x_k & + & \cdots & + & a_{k,n}^{(n)}x_n & = & a_{k,n+1}^{(n)} \\ \vdots & \vdots & \vdots & \vdots & \ddots & \vdots & \cdots &\cdots &\ddots & \vdots & \vdots & = & \vdots \\ 0x_1 & + & 0x_{2} & + & \cdots & + & 0x_k & + & \cdots & + & a_{n,n}^{(n)}x_n & = & a_{n,n+1}^{(n)} \\ \end{array} } \]
\[ \scriptsize{ \begin{aligned} x_n & = \frac{a_{n,n+1}^{(n)}}{a_{n,n}^{(n)}} \\ x_i & = \frac{ a_{i,n+1}^{(n)}-a_{i,n}^{(n)}x_n-a_{i,n-1}^{(n)}x_{n-1} -\ldots-a_{i,i+1}^{(n)}x_{i+1} } {a_{i,i}^{(n)}} \\ & = \frac{ a_{i,n+1}^{(n)}- \sum_{j \, = \, i+1}^n a_{i,j}^{(n)}x_j }{a_{i,i}^{(n)}}, \,\, i = n-1, n-2, \ldots, 1 \end{aligned} } \]
refmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 2 3 1 2
[2,] 0 -1 4 0
[3,] 0 0 2 2
rrefmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 1 0 0 -5.5
[2,] 0 1 0 4.0
[3,] 0 0 1 1.0
(L <- matrix(c(1,-3,2,0,1,1,0,0,1),3))
[,1] [,2] [,3]
[1,] 1 0 0
[2,] -3 1 0
[3,] 2 1 1
(U <- matrix(c(2,0,0,3,-1,0,1,4,2),3))
[,1] [,2] [,3]
[1,] 2 3 1
[2,] 0 -1 4
[3,] 0 0 2
(A <- matrix(c(2,-6,4,3,-10,5,1,1,8),3))
[,1] [,2] [,3]
[1,] 2 3 1
[2,] -6 -10 1
[3,] 4 5 8
L %*% U
[,1] [,2] [,3]
[1,] 2 3 1
[2,] -6 -10 1
[3,] 4 5 8
refmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 3 2 1 0
[2,] 0 1 2 1
[3,] 0 0 3 6
rrefmatrix(Ab)
[,1] [,2] [,3] [,4]
[1,] 1 0 0 1.333333
[2,] 0 1 0 -3.000000
[3,] 0 0 1 2.000000
(L <- matrix(c(1,1,-4,0,1,-2,0,0,1),3))
[,1] [,2] [,3]
[1,] 1 0 0
[2,] 1 1 0
[3,] -4 -2 1
(U <- matrix(c(3,0,0,2,1,0,1,2,3),3))
[,1] [,2] [,3]
[1,] 3 2 1
[2,] 0 1 2
[3,] 0 0 3
(A <- matrix(c(3,3,-12,2,3,-10,1,3,-5),3))
[,1] [,2] [,3]
[1,] 3 2 1
[2,] 3 3 3
[3,] -12 -10 -5
L %*% U
[,1] [,2] [,3]
[1,] 3 2 1
[2,] 3 3 3
[3,] -12 -10 -5