인공지능을 위한 선형대수 - 1️⃣기초

zioni·2025년 11월 25일
post-thumbnail

1. Scalar, Vector, and Matrix

1) Scalar

  • a single number
  • sRs \in \mathbb{R}

2) Vector

  • an ordered list of numbers
  • x=[x1x2xn]Rn\mathbf{x} = \begin{bmatrix}x_1 \\x_2 \\\vdots \\x_n\end{bmatrix}\in\mathbb{R^n}

3) Matrix

  • a two-dimensional array of numbers
  • A=[163452]R3×2A = \begin{bmatrix} 1 & 6 \\ 3 & 4 \\ 5 & 2 \\ \end{bmatrix}\in\mathbb{R}^{3 \times 2}
  • Row vector : a horizontal vector
  • Column vector : a vertical vector

2. Column Vector and Row vector

1) Column Vector

  • A vector of n-dimension → a column vector
  • x=[x1x2xn]Rn=Rn×1\mathbf{x} = \begin{bmatrix}x_1 \\x_2 \\\vdots \\x_n\end{bmatrix}\in\mathbb{R^n}=\mathbb{R}^{n \times 1}

2) Row Vector

  • transpose

  • xT=[x1x2xn]T=[x1x2xn]R1×n\mathbf{x}^{\mathsf{T}} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix}^{\mathsf{T}} = \begin{bmatrix} x_1 & x_2 & \cdots & x_n \end{bmatrix} \in \mathbb{R}^{1 \times n}

  • Example (transpose of a matrix)

    A=[123456],AT=[142536]A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}, \quad A^{\mathsf{T}} = \begin{bmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{bmatrix}

3. Matrix Notations

1) Square matrix

  • ARn×nA\in\mathbb{R}^{n \times n}

2) Rectangular matrix

  • ARm×nA\in\mathbb{R}^{m \times n}

3) Transpose of matrix

  • AT\mathbf{A}^{\mathsf{T}}

4) AijA_{ij}

  • (i,j)(i, j) -th component of AA
  • Ai,:A_{i, :} : ii - th row vector of AA
  • A:,iA_{:, i} : ii - th column vector of AA

4. Vector/Matrix Additions and Multiplications

1) C=A+BC = A + B

  • Cij=Aij+BijC_{ij} = A_{ij} + B_{ij}
  • A,B,CA, B, C should have the same size

2) ca,cAca, cA

  • Scalar multiple of vector / matrix
    2[321]=[642]2 \begin{bmatrix} 3 \\ 2 \\ 1 \end{bmatrix} = \begin{bmatrix} 6 \\ 4 \\ 2 \end{bmatrix}

3) C=ABC = AB

  • Matrix - matrix multiplication

  • Cij=kAi,kBk,jC_{ij} = \sum_{k} A_{i,k} B_{k,j}

  • ARm×n, BRn×pABRm×pA \in \mathbb{R}^{m \times n},\ B \in \mathbb{R}^{n \times p} \Rightarrow AB \in \mathbb{R}^{m \times p}

  • [123456][100111]=[41101]\begin{bmatrix}1 & 2 & 3 \\4 & 5 & 6\end{bmatrix}\begin{bmatrix}1 & 0 \\0 & 1 \\1 & -1\end{bmatrix}=\begin{bmatrix}4 & -1 \\10 & -1\end{bmatrix}

    ▶️ 4=(1×1)+(2×0)+(3×1)4=(1\times1)+(2\times0)+(3\times1)


5. Matrix multiplication is NOT commutative

  • ABBAAB \neq BA
profile
감자애오

0개의 댓글