0 likes | 8 Views
Introduction to matrices, vectors, and systems of linear equations. Topics covered include vectors as sets of numbers, matrix operations, properties of vectors and matrices, types of matrices (diagonal, identity, symmetric, triangular), matrix-vector products, and linear systems.
E N D
Chapter 1 Matrices, Vectors, and Systems of Linear Equations 除了標註※之簡報外,其餘採用李宏毅教授之投影片教材
Vectors and Matrices Vectors and Matrices Chap. 1.1
Vectors 1 2 3 v = • A vector v is a set of numbers • Components: the entries of a vector. • The i-th component of vector v refers to vi • v1=1, v2=2, v3=3 • If a vector only has less than four components, you can visualize it. v2 v v1
4 5 6 1 2 3 6 8 9 9 0 2 A vector set with 4 elements Vector Set , , , • A vector set can contain infinite elements ?1 ?2:?1+ ?2= 1 L = 0 1,1 0,0.3 0.7,0.7 0.3……
Vector Set • Rn:We denote the set of all vectors with n entries by Rn
Scalar Multiplication ?1 ?2 2?2 ? = 2? ?2 ? ??1 ??2 ?? = ?1 2?1
Vector Addition http://mathinsight.org/vectors_carte sian_coordinates_2d_3d#vector3D
Objects having the following 8 properties are “vectors”. Properties of Vector For any vectors u, v and w in Rn, and any scalars a and b • u + v = v + u • (u + v) + w = u + (v + w) • There is an element ? in Rnsuch that ? + u = u • There is an element u’ in Rnsuch that u’ + u = ? • 1u = u • (ab)u = a(bu) • a(u+v) = au + av • (a+b)u = au + bu = - u 0 ⋮ 0 zero vector ? =
1 2 33 X 1 1 2 3 2 3 3 1 1 5 Matrix A = −1 1 1 X 3 −2 • If the matrix has m rows and n columns, we say the size of the matrix is m by n, written m x n • We use Mmxnto denote the set that contains all matrices of size m x n 2 columns 3 columns 1 2 3 3 X 2 4 5 6 1 4 2 5 3 6 ∈M3x2 3 rows ∈M2x3 2 rows 2 X 3 先 Row 再 Column
Matrix 先 Row 再 Column • Index of component: the scalar in the i-th row and j-th column is called (i,j)-entry of the matrix (1,2)-entry ?11 ?21 ⋮ ??1 ?12 ?22 ⋮ ??2 ⋯ ⋯ ⋱ ⋯ ?1? ?2? ⋮ ??? 2 3 3 1 1 5 ? = ? = −1 1 −2 … ?? ? = ?? ?? (3,1)-entry (3,3)-entry vectors
Matrix • Two matrices with the same size can add or subtract. • Matrix can be multiplied by a scalar 54 72 81 81 0 18 1 2 3 4 5 6 6 8 9 9 0 2 9? = ? = ? = −5 −6 −6 −5 5 4 7 13 5 8 ? − ? = ? + ? = 10 12
Properties • A, B, C are mxn matrices, and s and t are scalars • A + B = B + A • (A + B) + C = A + (B + C) • (st)A = s(tA) • s(A + B) = sA + sB • (s+t)A = sA + tA
有名有姓的 Matrix ? ? ? = ? Square matrix diagonal 2 0 0 3 1 0 5 2 3 0 1 1 0 0 1 −1 1 −2 Upper Triangular Matrix Lower Triangular Matrix
Is I3a diagonal matrix? YES 有名有姓的 Matrix Is ?3×3a diagonal matrix? YES • Diagonal Matrix 2 0 0 0 1 0 0 0 2 All non-diagonal elements are “0”. • Identity Matrix 1 0 0 0 1 0 0 0 1 Denoted by I (any size) or I? I3= • Zero Matrix 0 0 0 0 0 0 Denoted by ? (any size) or ??×? ?2×3=
Transpose • If A is an mxn matrix, ??(transpose of A) is an nxm matrix whose (i,j)-entry is the (j-i)-entry of A (1,2) Transpose 6 8 9 9 0 2 ??=6 8 0 9 2 ? = 9 (2,1) (2,3) (3,2) Column 變成 Row ; Row 變成 Column
Transpose • A and B are mxn matrices, and s is a scalar • ?? ?= ? • ???= ??? • ? + ??= ??+ ?? This is a linear system ??= ? Symmetric Matrix
Vectors and matrices are special cases of tensors? 1 2 3 S Rank 3 tensor Matrix (Rank 2) Scalar (Rank 0) Vector (Rank 1) The above is an over-simplified definition of a tensor. So what is a tensor? • Informal Definition: An object that is invariant under a change of coordinates, and has components that change in a special, predictable way under a change of coordinates. ※
Matrix Matrix- -Vector Product Vector Product Chap. 1.2
Matrix-Vector Product ?11 ?21 ⋮ ??1 ?12 ?22 ⋮ ??2 ⋯ ⋯ ⋱ ⋯ ?1? ?2? ⋮ ??? ?1 ?2 ⋮ ?? ? = ? = m X n n X 1 Inner Product with Row ?? = m X 1 1 2 3 A? =14 ? =1 2 5 3 6 ? = 32 4
Matrix-Vector Product ?11 ?21 ⋮ ??1 ?12 ?22 ⋮ ??2 ⋯ ⋯ ⋱ ⋯ ?1? ?2? ⋮ ??? ?1 ?2 ⋮ ?? ? = ? = Inner Product with Row ?? = ?11 ⋮ ??1 ?12 ⋮ ??2 ?1? ⋮ ??? = ?1 + ?2 + ⋯+ ?? Weighted sum of Columns
?11 ?21 ⋮ ??1 ?12 ?22 ⋮ ??2 ⋯ ⋯ ⋱ ⋯ ?1? ?2? ⋮ ??? ?1 ?2 ⋮ ?? ? = ? = ?1 ?2 …… Linear System ?? ?? Linear System ? ? = ?? The matrix ? represents the system.
?1 ?2 …… ?1 ?2 …… Linear System ?? ?? Matrix-vector product:
Properties of Properties of Matrix Matrix- -Vector Product Vector Product Chap. 1.2
● Matrix-vector Product • The sizes of matrix and vector should match. 2 3 3 1 1 5 1 ? = ? = −1 1 −1 −2 2 3 0 1 1 2 1 2 1 −1 3 4 A′′= ?′ = −1 −3
Properties of Matrix-vector Product • A and B are mxn matrices, u and v are vectors in Rn, and c is a scalar. • ? ? + ? = ?? + ?? • ? ?? = ? ?? = ?? ? • ? + ? ? = ?? + ?? • ?? is the mx1 zero vector • ?? is also the mx1 zero vector • ??? = ? ?1 ?2 ?3 1 0 0 0 1 0 0 0 1 ?1 ?2 ?3 =
Properties of Matrix-vector Product • A and B are mxn matrices. If ?? = ?? for all ? in Rn. Is it true that ? = ?? ???= ??, where ??is the j-th standard vector in Rn Column Aspect 1 ⋮ 0 1 ⋮ 0 ???= ?? ⋯ ?? = 1 ∙ ??+ 0 ∙ ??+ ⋯+ 0 ∙ ?? ??= j = ?? j ???= ??? ???= ??? ???= ??? …… ? = ? ??= ?? ??= ?? ??= ??
Linear Combination Linear Combination Chap. 1.2
Linear Combination • Given a vector set ??,??,⋯,?? • The linear combination of the vectors in the set • ? = ?1??+ ?2??+ ⋯+ ???? • ?1,?2,⋯,??are scalars (coefficients of linear combination) 1 1,1 1+ 41 1 −31 1 3, 3+ vector set: −1 −1 =2 coefficients: −3,4,1 8 其實就是 weighted sum 啦
Column Aspect ?? ?? ?? ?1 ?2 ⋮ ?? ? =?? ?? ⋯ ?? coefficients ? = Vector set Linear Combination = ?1??+ ?2??+ ⋯+ ????
System of Linear Equations vs. Linear Combination Non empty solution set? Has solution or not? (A system of linear equations) Consistent? The Same question Column Aspect = ? Is ? the linear combination of columns of ?? = ?1??+ ?2??+ ⋯+ ???? linear combination of columns of ?
● Example 1 3?1+ 6?2= 3 2?1+ 4?2= 4 ?1 ?2 ? =3 6 4 ? =3 ? = 2 4 Has solution or not? Is ? the linear combination of columns of ?? 3 4 3 2,6 4
● 3?1+ 6?2= 3 2?1+ 4?2= 4 Example 1 Has solution or not? 3 2,6 • Vector set: 4 • Is 3 3 2,6 NO 4a linear combination of ? 4 3 4 The linear combination is always on the dotted line. 6 4 3 2
● Example 2 2?1+ 3?2= 4 3?1+ 1?2= −1 ?1 ?2 ? =2 3 1 4 ? = ? = −1 3 Has solution or not? Is ? a linear combination of columns of ?? 4 2 3,3 −1 1
● 2?1+ 3?2= 4 3?1+ 1?2= −1 Example 2 Has solution or not? 2 3,3 4 −1 2 3 1 23 1 3 1 4 −1 (-1)2 3
● Example 2 • If u and v are any nonparallel vectors in R2, then every vector in R2is a linear combination of u and v • Nonparallel: u and v are nonzero vectors, and u cv. ?1?1 ?2?1 +?1?2 +?2?2 = ?1 = ?2 ? u and v are not parallel ? ? Has solution • If u, v and w are any nonparallel vectors in R3, then every vector in R3is a linear combination of u, v and w? NO
● Example 3 2?1+ 6?2= −4 1?1+ 3?2= −2 ?1 ?2 ? =2 6 3 ? =−4 ? = 1 −2 Has solution or not? Is ? the linear combination of columns of ?? −4 −2 2 1,6 3
● 2?1+ 6?2= −4 1?1+ 3?2= −2 Example 3 Has solution or not? 2 1,6 • Vector set: 3 2 1,6 • Is −4 ? Yes −2a linear combination of 3 6 3 2 1 −4 −2 u and v are not parallel Has solution
Having Solution or Not Having Solution or Not Chap. 1.2
Review Linear System x b System of Linear Equations Matrix-vector product: Given A and b, let’s find x
● More Variables? ????,???,???????? … • Considering any system of linear equations with 2 variables and 2 equations …… line 1 …… line 2 ?11?1+ ?12?2= ?1 ?21?1+ ?22?2= ?2 line 1 =line 2 1ine 1 1ine 1 1ine 2 1ine 2 unique solution consistent infinite solutions consistent no solution inconsistent
Only Unique and Infinite? 為什麼不能只有兩個解? 一旦找到兩個解, 就可以找到無窮多解 ?? ? A ? ? ? ? A A 0.7? 0.3? 0.3? 0.7? A A 0.6? 0.4? 0.4? 0.6? = ? 0.3? + 0.7? 0.3? + 0.7? 3rd solution A 0.4? + 0.6? 4th solution = ? 0.4? + 0.6?
Equivalent • Two systems of linear equations are equivalent if they have exactly the same solution set. 3?1 ?1 +?2 −3?2 = 10 = 0 ?1 = 3 = 1 ?2 3 1 equivalent 3 1 Solution set: Solution set:
Equivalent • Applying the following three operations on a system of linear equations will produce an equivalent one. • 1. Interchange 3?1 ?1 −3?2 = 0 ?1 3?1 −3?2 +?2 = 0 = 10 +?2 = 10 • 2. Scaling (non zero) 3?1 −3?1 +?2 +9?2 = 10 = 0 3?1 ?1 +?2 −3?2 = 10 = 0 X(-3) • 3. Row Addition 3?1 ?1 +?2 −3?2 = 10 = 0X(-3) 10?2 −3?2 = 10 = 0 ?1
Solving system of linear equation • Strategy • We know how to transform a given system of linear equations into another equivalent one. • We do it again and again until the system of linear equation is very simple • Finally, we know the answer at a glance. ?1 −3?2 10?2 = 0 = 10 ?1 3?1 −3?2 +?2 = 0 = 10 X (-3) X 1/10 ?1 = 3 = 1 ?1 −3?2 ?2 = 0 = 1 ?2 X 3
Augmented Matrix • a system of linear equation ?11 ?21 ⋮ ??1 ?12 ?22 ⋮ ??2 ⋯ ⋯ ⋱ ⋯ ?1? ?2? ⋮ ??? ?1 ?2 ⋮ ?? ?1 ?2 ⋮ ?? ? = m x n ? = ? = coefficient matrix
Augmented Matrix • a system of linear equation m x (n+1) m x n m x 1 augmented matrix
Back to Equivalent • 1. Interchange ?1 3?1 −3?2 +?2 = 0 = 10 3?1 ?1 +?2 −3?2 = 10 = 0 • 2. Scaling (non zero) 3?1 −3?1 +?2 +9?2 = 10 = 0 3?1 ?1 +?2 −3?2 = 10 = 0 X(-3) • 3. Row Addition 3?1 ?1 +?2 −3?2 = 10 = 0X(-3) 10?2 −3?2 = 10 = 0 ?1
elementary row operations Back to Equivalent • 1. Interchange Interchange any two rows of the matrix 1 3 −3 1 0 10 3 1 1 10 0 −3 Multiply every entry of some row by the same nonzero scalar • 2. Scaling (non zero) 3 1 9 10 0 3 1 1 10 0 −3 X(-3) −3 Add a multiple of one row of the matrix to another row • 3. Row Addition 0 1 10 −3 10 0 3 1 1 10 0 X(-3) −3
Solving system of linear equation A simple system of linear equations A complex system of linear equations Rx = b Ax = b equivalent R=[ R b ] …… A’=[ A b ] A’’ A’’’ elementary row operations 1. Interchange any two rows of the matrix 2. Multiply every entry of some row by the same nonzero scalar 3. Add a multiple of one row of the matrix to another row