matrix-operations.md (3454B)
1 +++ 2 title = 'Matrix operations' 3 template = 'page-math.html' 4 +++ 5 6 # Matrix operations 7 $a_{ij}$ is the entry in the ith row and jth column of A 8 9 diagonal entries are $a_{11}$, $a_{22}$, etc. and form the main diagonal. if non-diagonal entries are zero, then it's a diagonal matrix. 10 11 equal matrices have same size _and_ their corresponding entries are equal. 12 13 ## Sums and scalar multiples 14 sum A+B: sum corresponding entries in A and B. 15 16 scalar multiple $rA$ is matrix whose columns are r times the corresponding columns in A (with r scalar). 17 18 the usual rules of algebra apply to sums and scalar multiples of matrices. 19 20 when matrix B multiplies vector x, it transforms x into vector $Bx$. if $Bx$ is multiplied by A, the result is $A(Bx)$. $A(Bx)$ is produced from x by composition of mappings, which can be represented as multiplication by a single matrix AB. 21 22 $A(Bx) = (AB)x$ 23 24 $AB = A \begin{bmatrix} b_1 & b_2 & \dots & b_p \end{bmatrix} = \begin{bmatrix} Ab_1 & Ab_2 & \dots & Ab_p \end{bmatrix}$ 25 26 A is matrix, B is matrix with columns $b_1 \dots b_p$. 27 28 each column of AB is a linear combination of columns of A using weights from corresponding column of B. AB has the same number of rows as A and same number of columns as B. if the number of columns of A does not match number of rows of B, the product is undefined. in general, AB ≠ BA. 29 30 if product AB is defined, then: 31 32 $(AB)\_{ij} = a\_{i1} b_{1j} + a_{i2} b_{2j} + \dots + a_{in} b_{nj}$ 33 34 $row_i (AB) = row_i (A) \times B$ 35 36 a nifty trick: if multiplying matrix m×n by matrix n×o, the product will be a matrix m×o. 37 38 ## Powers of a matrix 39 $A^k = \underbrace{A \dots A}_{k}$ 40 41 with $A$ an n × n matrix and k a positive integer. 42 43 ## Transpose of a matrix 44 a matrix $A'$ whose columns are made up of the corresponding rows of $A$ 45 46 properties: 47 * $(A^T)^T = A$ 48 * $(A+B)^T = A^T + B^T$ 49 * $(rA)^T = rA^T$ with r a scalar 50 * $(AB)^T = B^T A^T$ 51 52 the transpose of a product of matrices == product of their transposes in reverse order 53 54 ## Inverse of a matrix 55 invertible (singular) if there is same size matrix C such that $CA = I$ and $AC = I$ where I is the n × n identity matrix. 56 57 identity matrix: a matrix where the diagonals are all 1. 58 59 C is uniquely determined by A, so: $A^{-1} A = I$. 60 61 let $A = \begin{bmatrix} a & b \\\\ c & d \end{bmatrix}.$ if $ad - bc \ne 0$ then $A^{-1} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\\\ -c & a \end{bmatrix}$ 62 63 determinant: $\det A = ad - bc$ 64 65 if A is invertible (determinant is not 0), then for each $b \in \Re^n$ the solution of $Ax = b$ is $A^{-1} b$. 66 67 properties of inverse: 68 * $(A^{-1})^{-1} = A$ 69 * $(AB)^{-1} = B^{-1} A^{-1}$ (watch out for order!) 70 * $(A^T)^{-1} = (A^{-1})^T$ 71 72 finding $A^{-1}$: 73 * Row reduce augmented matrix $\begin{bmatrix} A & I \end{bmatrix}$. 74 * if A is row equivalent to I, then $\begin{bmatrix} A & I \end{bmatrix}$ is row equivalent to $\begin{bmatrix} I & A^{-1} \end{bmatrix}$ 75 * otherwise, A doesn't have an inverse. 76 77 ## Elementary matrices 78 elementary matrix: obtained by performing single elementary row operation on identity matrix 79 80 if elementary row operation is performed on m × n matrix A, result is EA, with E an m × m matrix obtained by performing same row operation on $I_m$ 81 82 inverse of any elementary matrix E is of same type that transforms E back into I. 83 84 an n² matrix A is only invertible if A is row equivalent to $I_n$. any sequence of elementary operations reducing A to $I_n$ also transforms $I_n$ into $A^{-1}$. 85