CS计算机代考程序代写 algorithm Linear Algebra primer

Linear Algebra primer
31

Matrices & matrix elements
32

Vectors
33

Matrix addition
34

Scalar multiplication
35

Combination of operands
𝑥=2× 1 + 0 − 6 /3 353
36

Matrix-vector multiplication
25 10 43
1 3
=
➔To get 𝑦𝑖, multiply 𝐴’s 𝑖-th row with the elements of the vector 𝑥, and then add them up 37

Example
Tumor sizes (mm): 17, 14, 26, 9
h 𝑥; 𝜃, 𝜃0 , with 𝜃 = 4, 𝜃0 = −75: h𝑥 =4𝑥−75
39

Matrix-matrix multiplication
24 02 51
130 413
=
➔The 𝑖-th column of 𝐶 is obtained by multiplying 𝐴 with the 𝑖-th column of B 40

Example
Tumor sizes (mm): 17, 14, 26, 9
3 competing hypotheses:
h𝑥 =4𝑥−75 h𝑥 =6𝑥−105 h𝑥 =3𝑥−30
42

Matrix multiplication properties
2 × 4 = 4 × 2 (commutative) 𝐴×𝐵 ≠𝐵×𝐴 (notcommutative)
43

Matrix multiplication properties
2 × 4 × 5
(associative)
𝐴 × 𝐵 × 𝐶
(associative)
44

Matrix multiplication properties
𝑎 𝑏 + 𝑐 = 𝑎𝑏 + 𝑎𝑐 𝑏+𝑐 𝑎=𝑏𝑎+𝑐𝑎
𝐴 𝐵 + 𝐶 = 𝐴𝐵 + 𝐴𝐶 𝐵+𝐶 𝐴=𝐵𝐴+𝐶𝐴
(distributive)
(distributive)
45

Identity matrix
46

Matrix/vector transpose
• Example: 𝐴=
• Definition: 𝑇
Let 𝐴 be an 𝑛 × 𝑚 matrix, and let 𝐵 = 𝐴 .
Then 𝐵 is an 𝑚 × 𝑛 matrix, and 𝐵 = 𝐴 . 𝑖𝑗 𝑗𝑖
130 413
47

Dot product
𝑛
𝑎 ⋅ 𝑏 = ෍ 𝑎𝑘𝑏𝑘 where 𝑎, 𝑏 ∈ R𝑛 𝑘=1
➔See Justin Solomon, Numerical Algorithms, Subchapter 1.2.3 48

Vector norm
• 𝑎 = 𝑎2+⋯+𝑎2 21𝑛
L2 or Euclidean norm – calculates the distance of the vector coordinate from the origin of the vector space
➔Please make sure to read Solomon Chapters 1.1, 1.2 and 1.3! 49