Presentation is loading. Please wait.

Presentation is loading. Please wait.

資訊科學數學12 : Dot Product & Matrix Operation

Similar presentations


Presentation on theme: "資訊科學數學12 : Dot Product & Matrix Operation"— Presentation transcript:

1 資訊科學數學12 : Dot Product & Matrix Operation
陳光琦助理教授 (Kuang-Chi Chen)

2 Linear Equations and Matrices Dot Product and Matrix Multiplication

3 Dot Product and Matrix Multiplication
The dot product or inner product of the n-vectors a and b

4 Example 1 E.g. 1 – the dot product of u and v
u·v = (1)(2) + (-2(3) + (3)(-2) + (4)(1) = -6

5 Example 2 Example 2 Let and . If a·b = -4 , find x
a·b = 4x = -4 4x + 8 = -4 x = -3

6 Example 3 E.g. 3 – Computing a course average
w·g = (.10)(78) + (.30)(84) + (.30)(62) + (.30)(85) = 77.1

7 Matrix Multiplication
The product of A and B, denoted by AB = C, where thus

8 (cont’d) That is, colj(B) A B = AB mp pn mn

9 Example 4 Example 4

10 Example 5 E.g. 5 – Compute the (3, 2) entry of AB

11 Example 6 – Linear System in Matrix Form
E.g. 6 – Linear system in matrix form - a linear system - a matrix form

12 Example 7 – Find x and y E.g. 7 – Find x and y

13 AB and BA AB and BA - BA may not be defined, while BA is defined
- AB and BA are of different sizes (A23 , B32) - AB and BA are both of the same size and they may be equal - AB and BA are both of the same size and they may not be equal (see example)

14 Example 10 – AB ≠ BA E.g AB ≠ BA

15 Example 11 – the 2nd column of AB
E.g the second column of AB

16 Remark Remark – inner product and matrix multiplication
If u and v are n-vectors - Both are n1, then u·v = uTv - Both are 1n, then u·v = uvT - u is 1n and v is n1, then u·v = uv .

17 Example 12 – Inner Product & Matrix Multiplication
E.g. 12 – inner product and matrix multiplication

18 Matrix-vector Product
The matrix-vector product written in terms of columns

19 - A linear combination of the columns of A
(cont’d) - A linear combination of the columns of A

20 Example 13 Example 13

21 Example 14 E.g. 14

22 Linear Systems Linear Systems Define

23 Linear Systems (cont’d)
We have i.e., Ax = b Here, A is the coefficient matrix (design matrix).

24 Augmented Matrix Augmented Matrix

25 Example 15 – Augmented Matrix
E.g. 15

26 Example 16 – Augmented Matrix

27 Linear Equations and Matrices Properties of Matrix Operations

28 Properties of Matrix Operations
Theorem 1.1 Properties of matrix addition A + B = B + A – commutative law A + (B + C) = (A + B) + C – associative law A + O = A , (O: zero matrix) – identity law A + D = O , A + (-A) = O – additive inverse

29 Example 1 – Zero Matrix E.g. 1 - The 22 zero matrix

30 Example 2 Example 2 A + (-A) = O

31 Example 3 – Subtraction E.g. 3 – Subtraction

32 Properties of Matrix Multiplication
Theorem 1.2 – Properties of matrix multiplication (AB)C = A(BC) – associative law A(B + C) = AB + AC – distributive law (A + B)C = AC + BC . * No commutative law !

33 Example 4 – (AB)C = A(BC) The # of multiplications to compute
A(BC) is 343 + 233 = = 54; (AB)C is 234 + 243 = = 48.

34 Example 5 E.g. 5 – A(B + C) = AB + AC

35 Identity Matrix of Order n
Definition – Identity matrix of order n thus, In A = A or A In = A .

36 Example 6 E.g. 6 – Identity matrix I2A = A AI3 = A

37 Powers of A Matrix Powers of an nn matrix Definition :
thus, A0 = In , ApAq = Ap+q , (Ap)q = Apq , (AB)p ≠ ApBp . (why? No commu. law)

38 Example 7 – No Cancellation Law
E.g. 7 – The cancellation law doesn’t hold. We know ab = ac and a ≠ 0 ⇒ b = c ; but it doesn’t hold in matrix. (see example)

39 Example 8 Example 8 , but B≠ C .

40 Example 9 – Markov Chain E.g. 9 – Example of Markov chain
Initial distribution of the market

41 determine a and b so that the market is stable i.e., Ax0 = x0 .
(cont’d) x2 = Ax1 = A(Ax0) = A2x0 . Let x0 = [a, b]T , determine a and b so that the market is stable i.e., Ax0 = x0 .

42 We have x0 = [a, b]T , a + b = 1, and Ax0 = x0 , i.e., and a = 1 – b ,
(cont’d) We have x0 = [a, b]T , a + b = 1, and Ax0 = x0 , i.e., and a = 1 – b ,

43 Properties of Scalar Multiplication
Theorem Properties of scalar multiplication r(sA) = (rs)A (…like-associative law) r(A + B) = rA + rB (…like-distributive law) (r + s)A = rA + sA A(rB) = r(AB) = (rA)B .

44 Example 10 Example 10 r = -2 ,

45 Properties of Transpose
Theorem 1.4 – Properties of transpose (AT)T = A (double transpose law) (A + B)T = AT + BT (AB)T = BTAT (Check? If A32 , B23) (rA)T = rAT .

46 Example 11 – Transpose E.g. 11 – Transpose

47 Symmetry Definition – Symmetric Let A = [aij]nn ,
If AT = A , (i.e., aij = aji ), then A is symmetric.

48 Example 12 – Symmetry E.g. 12 – Symmetry

49 Linear Equations and Matrices Matrix Transformation

50 Matrix Transformation
R2 : denotes the set of all 2-vectors R3 : denotes the set of all 3-vectors Represented geometrically as directed line segments in a rectangular coordinate system

51 Vector Space – 2- & 3-vectors
(x, y) x-axis y-axis Let z-axis

52 Example 1 – n-Vectors Example 1

53 Definition of Mapping Function
If A is an mn matrix and u is an n-vector, then Au is an m-vector ; - Mapping Rn into Rm ; A mapping function f : Rn → Rm defined by f(u) = Au ; - f(u) : the image of u ; - the range of f: the set of all images of the vectors in Rm ; - f: the mapping function

54 u Au = v f f(u) = Au f(u) = v image range Rn Rm

55 Example 2 – Image Example 2

56 More Examples of Image

57 Example 3 Example 3

58 Solution of Example 3

59 Example 4 – Reflection E.g. 4 – Reflection
Let f : R2 → R2 be the matrix transformation defined by The reflection w.r.t. the axis in R2 .

60 Example 5 – Projection Example 5 – Projection (3-dim onto 2-dim)
Let f : R3 → R2 be the matrix transformation defined by then

61 More – Projection (3-dim onto xy-plane)
… cont’d … More – Projection (3-dim onto xy-plane) Let f : R3 → R3 be the matrix transformation defined by then

62 Example 6 Example 6 Let f : R3 → R3 be the matrix transformation defined by where r is a real number, so we have f(u) = ru . If r > 1, then dilation; stretches a vector; if 0 < r < 1, then contraction; shrinks a vector. dilation 1.膨脹,擴大。2.【醫學】擴張(症)。 stretches 1.展開,鋪開,擴張;張,繃,拉直;拉長,拉扯。2.使(精神,肌肉等)緊張,傾注全力;睜大(兩眼等)。3.勉強解釋,曲解;充分利用;亂用,濫用(法律等);誇大(地講)。1.(時間)繼續,拖長,延長到;伸手(腳),伸懶腰;能伸長擴張。The forest stretches for miles. 森林綿延數英里。stretch a carpet 鋪開地毯。 stretch an umbrella 撐開洋傘。 contraction 1.縮短,收縮;【醫學】攣縮。2.(開支等)縮減;收斂,狹窄;縮度。3.【語法】縮略〔如將 never 略成 ne'er, do not 略成 don't 等〕;略體,縮寫〔如 department 縮為 dep't〕。 shrink 1.皺縮;縮短,收縮。2.變小,減小。3.退縮,畏縮,害怕。1.使皺縮,弄皺;使縮短。2.縮進,拉回。

63 Example 7 Example 7 - Rotate every point in R2 counterclockwise through an angle  about the origin of a rectangular coordinate system u = (x, y) f(u) = (x’, y’) 長度 r u = (x, y) f(u) = (x’, y’) 長度 r

64 since x’ = r cos  cos  – r sin  sin  ,
(cont’d) Let x = r cos  , y = r sin  , x’ = r cos ( + ) , y’ = r sin ( + ) , since x’ = r cos  cos  – r sin  sin  , and y’ = r sin  cos  + r cos  sin  .

65 so x’ = x cos  – y sin  , and y’ = x sin  + y cos  . Thus,
(cont’d) so x’ = x cos  – y sin  , and y’ = x sin  + y cos  . Thus, where u = (x, y)T.

66 Similarly, x = x’ cos  + y’ sin  , and y = -x’ sin  + y’ cos  .
(cont’d) Similarly, x = x’ cos  + y’ sin  , and y = -x’ sin  + y’ cos  . Thus, where u’ = (x’, y’)T. Moreover, f’ is the inverse function of f .

67 Note: u = (x, y)  f(u) = (x’, y’)  f’(u’) = (x, y)  u’ = (x’, y’) 
(cont’d) Note: u = (x, y) f(u) = (x’, y’) f’(u’) = (x, y) u’ = (x’, y’)


Download ppt "資訊科學數學12 : Dot Product & Matrix Operation"

Similar presentations


Ads by Google