yuns

정의, Linear system, Linear combination, vector equation 등 본문

goorm 수업 정리/linear algebra

정의, Linear system, Linear combination, vector equation 등

yuuuun 2021. 8. 9. 17:07
반응형

정의

  • scalar: a single number
  • vector: an ordered list of numbers
  • Matrix: two-dimensional array of numbers
    • row vector, column vector
  • Matrix notations
    • Square matrix (#rows = #columns)
      • $A\in R^{n\times n}$
    • Transpose of matrix
      • $A^T$
  • Vector / Matrix Additions and Multiplications
  • A = np.array([[1, 2], [3, 4]])
    B = np.array([[5, 6], [7, 8]])
    A*B # elementwise product
    '''
    array([[ 5, 12],
           [21, 32]])
    '''
    
    A@B # matrix product
    '''
    array([[19, 22],
           [43, 50]])
    '''
    
    import sympy as sy
    
    A = sy.Matrix([[3, 4], [7, 8]])
    B = sy.Matrix([[5, 3], [2, 1]])
    
    A@B
    '''
    23 13
    51 29
    '''
    
    B@A
    '''
    36 44
    13 16
    '''
  • elementwise product
  • Matrix Multiplication is not Commutative
  • 만족하는 특성
    • Distributive: $A(B+C) = AB + AC$
    • Associative: $A(BC) = (AB)C$
    • Property of transppose: $(AB)^T = B^T A^T$
# 벡터 곱은 교환법칙이 성립
# 계산에 사용할 기호(symbol)들을 아래와 같이 선언합니다.
x1, x2, y1, y2 = sy.symbols('x1, x2, y1, y2', real = True)

# 위에서 선언한 기호를 활용하여, np.array와 유사한 방식으로 벡터를 선업합니다.
x = sy.Matrix([x1, x2])
y = sy.Matrix([y1, y2])

x.T@y
'''
[x1y1, x2y2]
'''

y.T@x
[x1y1, x2y2]

Linear System

n개의 linear equation(일차 방정식)들의 collection을 뜻함. 동일한 n개의 variable을 가진 m개의 일차 방정식들을 표현 가능함

Linear Equation(연립 방정식, 선형 방정식)

  • $a_1x_1 + a_2x_2+\cdots +a_nx_n = b$
    • $a_1, \cdots a_n$: coefficients

Identity Matrix(항등행렬)

  • nxn matrix에서 대각행렬이 1이고 나머지는 0인 행렬

Inverse Matrix

  • $A^{-1}$

Linear combination, vector equation, Four view of matrix multiplication

Linear combination

  • $c_1v_1 + \cdots c_pv_p$
  • linear combination of $v_1,\cdots,v_p$ with weights or coefficients $c_1,\cdots,\c_p$

Vector Equation

  • Span
    • Given a set of vetcors $v_1,\cdots,v_p \in R^n $. Span{$v_1,\cdots,v_p$} is defined as the set of all linear combinations of $v_1,\cdots,v_p$
    • 주어진 벡터들의 조합으로 나올 수 있는 벡터들의 모든 후보
  • Geometric Interpretation of Vector Equation
    • $a_1x_1 + a_2x_2+a_3x_3 = b$ 에서 $b \in Span\{a_1, a_2, a_3\}$일 때
  •  
반응형

'goorm 수업 정리 > linear algebra' 카테고리의 다른 글

Advanced Eigendecomposition  (0) 2021.08.18
Eigendecomposition  (0) 2021.08.17
선형 독립과 선형 변환  (0) 2021.08.10
Comments